Repository navigation
Description
Describe the bug
DMIC can not work after remove the headset when headset mic is selected in sound setting.
To Reproduce
1.Plug in headset and choose headset mic from sound input setting.
2. Do parecord , and confirm capture can work via headset Mic.
3. Plug out headset
4. Do parecord, check if capture can work via build-in DMIC.
5. Open sound input setting, check if DMIC is highlighted automatically. Tap to select one more time and do parecord again. check if capture can work via build-in DMIC.
Expected behavior
Parecord should work normally at step 4 and 5, i.e. capture via DMIC should work.
Actual result
DMIC parecord always not work, i.e. no sound captured by DMIC. Check via list-sources in pacmd, DMIC 32 is marked after headset is plug out (step 3). Reproduce rate 100%
More info:
- If we plug in headset after step (5) and select DMIC again in Sound Input Setting, can record normally from DMIC.
- If we select DMIC in Sound Input Setting before plugging out headset at step (3), then DMIC capture can work.
Environment
Rander UCM https://github.com/RanderWang/intel-UCM
Kernel repo:c99938c https://github.com/thesofproject/linux/tree/release/sof-v5.0
Firmware repo: 05d4e19 https://github.com/thesofproject/sof/commits/master |
Topology: https://github.com/thesofproject/sof/commits/master . Same as above SOF repo
file: tools/topology/sof-hda-generic.m4, sof-hda-generic-2ch.tplg
No error sof-logger.
[ 4439.273915] sof-audio-pci 0000:00:1f.3: pcm: hw params stream 0 dir 0
[ 4439.273919] sof-audio-pci 0000:00:1f.3: generating page table for 0000000077b04940 size 0xffc0 pages 16
[ 4439.273941] sof-audio-pci 0000:00:1f.3: period_bytes:0x3fc0
[ 4439.273943] sof-audio-pci 0000:00:1f.3: periods:4
[ 4439.273955] sof-audio-pci 0000:00:1f.3: stream_tag 2
[ 4439.273962] sof-audio-pci 0000:00:1f.3: ipc tx: 0x60010000: GLB_STREAM_MSG: PCM_PARAMS
[ 4439.274117] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x60010000: GLB_STREAM_MSG: PCM_PARAMS
[ 4439.274121] sof-audio-pci 0000:00:1f.3: pcm: stream dir 0, posn mailbox offset is 790756
[ 4439.274269] sof-audio-pci 0000:00:1f.3: pcm: trigger stream 0 dir 0 cmd 1
[ 4439.274277] sof-audio-pci 0000:00:1f.3: ipc tx: 0x60040000: GLB_STREAM_MSG: TRIG_START
[ 4439.274409] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x60040000: GLB_STREAM_MSG: TRIG_START
[ 4439.274415] sof-audio-pci 0000:00:1f.3: In hda_link_pcm_trigger cmd=1
[ 4440.124565] sof-audio-pci 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG
[ 4440.124598] sof-audio-pci 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG
[ 4441.903245] sof-audio-pci 0000:00:1f.3: pcm: trigger stream 0 dir 1 cmd 0
[ 4441.903270] sof-audio-pci 0000:00:1f.3: ipc tx: 0x60050000: GLB_STREAM_MSG: TRIG_STOP
[ 4441.903582] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x60050000: GLB_STREAM_MSG: TRIG_STOP
[ 4441.903599] sof-audio-pci 0000:00:1f.3: In hda_link_pcm_trigger cmd=0
[ 4441.903700] sof-audio-pci 0000:00:1f.3: pcm: free stream 0 dir 1
[ 4441.903707] sof-audio-pci 0000:00:1f.3: ipc tx: 0x60030000: GLB_STREAM_MSG: PCM_FREE
[ 4441.903940] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x60030000: GLB_STREAM_MSG: PCM_FREE
[ 4441.904121] sof-audio-pci 0000:00:1f.3: pcm: close stream 0 dir 1
[ 4442.624336] sof-audio-pci 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG
[ 4442.624363] sof-audio-pci 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG
[ 4447.828983] sof-audio-pci 0000:00:1f.3: pcm: trigger stream 0 dir 0 cmd 0
[ 4447.829002] sof-audio-pci 0000:00:1f.3: ipc tx: 0x60050000: GLB_STREAM_MSG: TRIG_STOP
[ 4447.829231] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x60050000: GLB_STREAM_MSG: TRIG_STOP
[ 4447.829245] sof-audio-pci 0000:00:1f.3: In hda_link_pcm_trigger cmd=0
[ 4447.829322] sof-audio-pci 0000:00:1f.3: pcm: free stream 0 dir 0
[ 4447.829329] sof-audio-pci 0000:00:1f.3: ipc tx: 0x60030000: GLB_STREAM_MSG: PCM_FREE
[ 4447.829545] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x60030000: GLB_STREAM_MSG: PCM_FREE
[ 4447.829680] sof-audio-pci 0000:00:1f.3: pcm: close stream 0 dir 0
[ 4448.624566] sof-audio-pci 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG
[ 4448.624608] sof-audio-pci 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG
DmicNotWorkAfterRemoveHeadset.log
DmicNotWorkAfterRemoveHeadset_Logger.log
Activity
ClarexZhou commentedon May 9, 2019
Add alsamixer status when error occurred after plug out headset.
test@test-Inspiron-5490:~$ amixer cget numid=34,iface=CARD,name='Headphone Mic Jack'
numid=34,iface=CARD,name='Headphone Mic Jack'
; type=BOOLEAN,access=r-------,values=1
: values=off
RanderWang commentedon May 9, 2019
After headset is unplugged, DMIC is the default input

RanderWang commentedon May 9, 2019
But when you parecord, HeadSet is still used. So it is caused by pulse audio

RanderWang commentedon May 9, 2019
@ClarexZhou next time testing paplay or parecord, please add flag of : -v. It will show you more info, including which device is used
wenqingfu commentedon May 9, 2019
I guess you mean 'unplugged'? @RanderWang
mengdonglin commentedon May 10, 2019
@jason77-wang Please fix this PulseAudio issue.
RanderWang commentedon May 10, 2019
fixed it
jason77-wang commentedon May 10, 2019
I mentioned it before: because headset-mic and dmic belongs to two different sources in the PA, it will be more difficult for us to support them.
So far, please let headset-mic not support hotplug, that means let headset-mic always shows in the sound-setting no matter the headset is plugged or not, When users want to record via headset-mic, then choose headset-mic from UI, if users want to record sound from DMIC, choose dmic from UI. that is a workaround.
mengdonglin commentedon May 14, 2019
@jason77-wang I think you need to customize the UCM for system integration, like adjusting volume, doing workaround for PulseAudio or providing more user-friendly hot-plug effect in GUI Sound Settings etc.
The UCM provided by @RanderWang is just a reference/prototype for how SOF can work with legacy HD-A codecs and to kick off system integration. But we cannot do further customization or workaround. Canonical needs to take over from here.
So closing this issue as won't fix.
jason77-wang commentedon Jun 20, 2019
This is the fix for this bug:
https://lists.freedesktop.org/archives/pulseaudio-discuss/2019-June/031190.html