caroline: Mic/headphone underrun after switching use case with loopback dongle |
|||
Issue description*** This issue is found when I was trying cras use case under development on caroline. Steps to repro: 1. CRAS with use case support 2. Add a Multimedia use case to alsa ucm (a copy of HiFi.conf is okay) 3. restart cras (so cras now supports Default and Multimedia use cases 4. Plug in audio loopback dongle 5. Open 2 terminals, one for playback stream and the other for capturing stream: - cras_test_client --playback_file /dev/urandom --stream_type 1 - cras_test_client --capture_file /tmp/cap.wav --stream_type 1 Observed: 1. /var/log/message has errors: 2017-04-27T16:09:07.557930+08:00 ERR cras_server[2552]: pcm_avail returned frames larger than buf_size: sklnau8825adi: :0,0: 24064 > 16384 for 183 times 2. both output and input devices have underruns. The num_underruns for input device accumulates very quickly and then the stream/device closed in less than 5 seconds. The num_underruns for output device accumulates not so quickly but still going up. - Attached bugreport2.txt is when the streams are added and num_underruns quickly built up - Attached bugreport3.txt is when the input stream/device is closed. 3. When the error happens, the next playback might come out from internal speaker, even the loopback dongle is plugged (no manual audio output selection has been done) 4. This only happens when the loopback dongle is used and use case switch is involved. - does not happen if the stream type used is 0 with loopback dongle - does not happen if the stream type used is 1 without loopback dongle
,
Apr 28 2017
Yes normal headphone/mic can repro this issue, it just happened while I have loopback dongle plugged.
So I suspect this issue happens when headphone/mic is used, and the mixer controls in the enable sequence are set again. (Although the value of the mixer controls are the same.)
SectionVerb {
Value {
OutputDspName "speaker_eq"
}
EnableSequence [
cdev "hw:sklnau8825adi"
cset "name='codec1_out mo media0_in mi Switch' off"
cset "name='codec0_out mo media0_in mi Switch' on"
cset "name='DAC Oversampling Rate' 128"
cset "name='Headset Mic Switch' off"
cset "name='media0_out mo codec0_in mi Switch' off"
cset "name='media0_out mo dmic01_hifi_in mi Switch' on"
cset "name='Pin 5 Mux' cvt 2"
cset "name='Pin 6 Mux' cvt 3"
cset "name='Pin 7 Mux' cvt 4"
cset "name='Frontend PGA Volume' 21"
]
DisableSequence [
]
}
,
Apr 28 2017
When normal headphone/mic is used: cras_test_client --playback_file /dev/urandom --stream_type 1 cras_test_client --capture_file /tmp/cap.wav --stream_type 1 Scenario A: Playback first and then capture 1. If start playback first, the playback is fine. 2. Then start capture, the playback sound stops and the num_underruns quickly built up. Scenario B: Capture first and then playback 1. If the capture is started first, the recording is fine at the beginning cras_test_client --capture_file /tmp/cap.wav --stream_type 1 2. And then start playback, the capture stream beginning to record repeated samples, repeating until the stream is closed.
,
Apr 28 2017
Tried removing the cset of Headphone and Mic enable/disable controls from SectionVerb EnableSequence, but the problem is still there. Will add some logging to what cras calls to ucm...
,
May 3 2018
,
Aug 3
This bug has an owner, thus, it's been triaged. Changing status to "assigned". |
|||
►
Sign in to add a comment |
|||
Comment 1 by cychiang@chromium.org
, Apr 27 2017