You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG][CML] audio stops during aplay playback #3619
From kernel side only drop command fails. It's interesting that if the trace feature is disabled, the following pcm_free and config commands will fail, too.
I do more tests today and found that the issue disappear with topology file built by myself. Still don't know what's wrong with the topology file used by google (sof-cml-rt5682.tplg) but it could explain why this issue does not happen to other CML chromebooks since the topology file is different.
I will test more times to confirm it's the topology.
This issue still could happen with topology built by 1.2.4 but the rate decreases dramatically on my machine. But it seems no difference on other fail machines according to ODM's report.
@brentlu can you confirm if aplay works for longer than 10mins. i.e. aplay /dev/zero Lets try and work out if this is down to a timebase difference coming from youtube.
Can you also confirm if the binary topology files built with different toolchains are the same or different.
0 2 BUFFER 160288579.218750 85802368.000000 src/audio/buffer.c:126 comp_update_buffer_produce(), no bytes to produce, source->comp.id = 16, source->comp.type = 1, sink->comp.id = 17, sink->comp.type = 5
0 2 BUFFER 160289829.114583 1249.895874 src/audio/buffer.c:126 comp_update_buffer_produce(), no bytes to produce, source->comp.id = 16, source->comp.type = 1, sink->comp.id = 17, sink->comp.type = 5
0 2 BUFFER 160291059.583333 1230.468750 src/audio/buffer.c:126 comp_update_buffer_produce(), no bytes to produce, source->comp.id = 17, source->comp.type = 5, sink->comp.id = 20, sink->comp.type = 2
0 2 BUFFER 160291064.739583 5.156250 src/audio/buffer.c:208 comp_update_buffer_consume(), no bytes to consume, source->comp.id = 16, source->comp.type = 1, sink->comp.id = 17, sink->comp.type = 5
0 2 BUFFER 160292308.958333 1244.218750 src/audio/buffer.c:126 comp_update_buffer_produce(), no bytes to produce, source->comp.id = 17, source->comp.type = 5, sink->comp.id = 20, sink->comp.type = 2
0 2 BUFFER 160292313.958333 5.000000 src/audio/buffer.c:208 comp_update_buffer_consume(), no bytes to consume, source->comp.id = 16, source->comp.type = 1, sink->comp.id = 17, sink->comp.type = 5
0 1 DAI 4.20 160293556.145833 1242.187500 src/audio/dai.c:586 dai_check_for_xrun() error: underrun due to no data available
0 1 COMP 160293562.864583 6.718750 of/audio/component.h:743 comp_underrun() error: dev->comp.id = 20, source->avail = 0, copy_bytes = 0
But from Linux side, the hw_ptr/appl_prt suggests the buffer is full so audio server stops feeding data. My best guess is there is something wrong in the hda_dsp_pcm_pointer() function for HDMI playback stream.
I print IPC commends in kernel log. The sequence of TPLG_COMP_CONNECT commands is different but it should be fine. I see no other difference in IPC command parameters. Cannot explain why them make difference on certain machine.
This is the command:
$ aplay -D hw:0,2 -c 2 -f S16_LE -r 48000 /dev/zero
It takes 13mins to reproduce:
2020-12-07T09:41:46.395049Z DEBUG kernel: [ 93.594668] sound pcmC0D2p: snd_pcm_playback_open:
...
2020-12-07T09:54:51.025137Z DEBUG kernel: [ 877.832337] sof_rt5682 sof_rt5682: playback write error (DMA or IRQ trouble?)
It's interesting that this only happen to few Kaisa devices which is CML chromebox with rt5682 headphone codec. My experience is that for those devices which has this issue, there is an around 80% possibility to fail in 10 mins audio playback. OS version seems irrelevant according to ODM's rest result since we are using cml-008-patch-backport for long time.
Activity
brentlu commentedon Nov 18, 2020
From kernel side only drop command fails. It's interesting that if the trace feature is disabled, the following pcm_free and config commands will fail, too.
[ 4442.604052] sound pcmC0D2p: snd_pcm_common_ioctl: DROP
[ 4442.604138] sof-audio-pci 0000:00:1f.3: ipc tx: 0x60050000: GLB_STREAM_MSG: TRIG_STOP
[ 4442.604403] sof-audio-pci 0000:00:1f.3: error: ipc error for 0x60050000 size 12
[ 4442.604431] HDMI1: ASoC: trigger FE cmd: 0 failed: -22
[ 4442.604508] sound pcmC0D2p: snd_pcm_common_ioctl: HW_FREE
[ 4442.604526] sof-audio-pci 0000:00:1f.3: ipc tx: 0x60030000: GLB_STREAM_MSG: PCM_FREE
[ 4442.604844] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x60030000: GLB_STREAM_MSG: PCM_FREE
[ 4442.604920] sound pcmC0D2p: snd_pcm_release:
[ 4442.604982] sof-audio-pci 0000:00:1f.3: ipc tx: 0x80010000: GLB_DAI_MSG: CONFIG
[ 4442.605296] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x80010000: GLB_DAI_MSG: CONFIG
[ 4444.934238] sof-audio-pci 0000:00:1f.3: ipc tx: 0x40010000: GLB_PM_MSG: CTX_SAVE
[ 4444.934503] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x40010000: GLB_PM_MSG: CTX_SAVE
From SOF side I can only see some suspicious "no bytes to produce" messages.
lgirdwood commentedon Nov 19, 2020
@brentlu can you confirm the test ? Are you testing long duration youtube playback or are you testing runtime suspend.
It looks like there is no audio data coming from the host (which tries to recover).
Comp ID 16 is host DMA. It looks like userspace is sending some ioctls below to recover.
brentlu commentedon Nov 19, 2020
I'm testing youtube playback.
I do more tests today and found that the issue disappear with topology file built by myself. Still don't know what's wrong with the topology file used by google (sof-cml-rt5682.tplg) but it could explain why this issue does not happen to other CML chromebooks since the topology file is different.
I will test more times to confirm it's the topology.
lgirdwood commentedon Nov 20, 2020
@brentlu please let us know the differences in topology files.
brentlu commentedon Dec 4, 2020
The difference is tool chain. Google's version is built by alsa-lib/alsa-utils 1.1.9 and my version is built by 1.2.4.
brentlu commentedon Dec 4, 2020
This issue still could happen with topology built by 1.2.4 but the rate decreases dramatically on my machine. But it seems no difference on other fail machines according to ODM's report.
lgirdwood commentedon Dec 4, 2020
@brentlu can you confirm if aplay works for longer than 10mins. i.e.
aplay /dev/zeroLets try and work out if this is down to a timebase difference coming from youtube.Can you also confirm if the binary topology files built with different toolchains are the same or different.
brentlu commentedon Dec 7, 2020
I've got more log for this issue.
From SOF side, it's a buffer underrun.
But from Linux side, the hw_ptr/appl_prt suggests the buffer is full so audio server stops feeding data. My best guess is there is something wrong in the hda_dsp_pcm_pointer() function for HDMI playback stream.
[ 128.437711] sound pcmC0D2p: [P] pos 5000 hw_ptr 3294968 appl_ptr 3309568 avail 1768
...
[ 239.652829] sound pcmC0D2p: [P] pos 5000 hw_ptr 3294968 appl_ptr 3311336 avail 0
dmesg.txt is the kernel log. sof-log.txt is SOF trace before this issue happens and sof-log-3.txt is the trace after the issue happens.
dmesg.txt
sof-log.txt
sof-log-3.txt
brentlu commentedon Dec 7, 2020
I print IPC commends in kernel log. The sequence of TPLG_COMP_CONNECT commands is different but it should be fine. I see no other difference in IPC command parameters. Cannot explain why them make difference on certain machine.
dmesg-1.1.9.txt
dmesg-1.2.4.txt
brentlu commentedon Dec 7, 2020
It also happens to aplay.
From kernel side the buffer is full.
[ 877.329983] sound pcmC0D2p: snd_pcm_common_ioctl: WRITEI_FRAMES
[ 877.329993] sound pcmC0D2p: [P] pos 16328 hw_ptr 36467864 appl_ptr 36483360 avail 872
[ 877.832337] sof_rt5682 sof_rt5682: playback write error (DMA or IRQ trouble?)
[ 877.832384] sound pcmC0D2p: snd_pcm_poll:
[ 877.932653] sound pcmC0D2p: snd_pcm_poll:
[ 877.932685] sound pcmC0D2p: snd_pcm_common_ioctl: WRITEI_FRAMES
[ 877.932708] sound pcmC0D2p: [P] pos 1064 hw_ptr 36468968 appl_ptr 36484232 avail 1104
[ 878.440176] sof_rt5682 sof_rt5682: playback write error (DMA or IRQ trouble?)
[ 878.440212] sound pcmC0D2p: snd_pcm_poll:
[ 878.540487] sound pcmC0D2p: snd_pcm_poll:
[ 878.540519] sound pcmC0D2p: snd_pcm_common_ioctl: WRITEI_FRAMES
[ 878.540541] sound pcmC0D2p: [P] pos 1064 hw_ptr 36468968 appl_ptr 36485336 avail 0
[ 879.047743] sof_rt5682 sof_rt5682: playback write error (DMA or IRQ trouble?)
[ 879.047850] sound pcmC0D2p: snd_pcm_common_ioctl: DROP
[ 879.048109] sof-audio-pci 0000:00:1f.3: error: ipc error for 0x60050000 size 12
[ 879.048134] HDMI1: ASoC: trigger FE cmd: 0 failed: -22
[ 879.048161] sound pcmC0D2p: snd_pcm_common_ioctl: HW_FREE
[ 879.048446] sound pcmC0D2p: snd_pcm_release:
No error observed in SOF side.
sof-log-aplay.txt
dmesg-aplay.txt
lgirdwood commentedon Dec 7, 2020
@slawblauciak fyi - aplay can also cause this issue. Could be HDA DMA getting confused over data free/avail ?
[-][BUG][CML] audio stops during youtube playback[/-][+][BUG][CML] audio stops during aplay playback[/+]lgirdwood commentedon Dec 7, 2020
@brentlu can you tell us the aplay command line and length of time it takes to fail with aplay (plus any other settings).
brentlu commentedon Dec 7, 2020
@lgirdwood
Hi,
This is the command:
$ aplay -D hw:0,2 -c 2 -f S16_LE -r 48000 /dev/zero
It takes 13mins to reproduce:
2020-12-07T09:41:46.395049Z DEBUG kernel: [ 93.594668] sound pcmC0D2p: snd_pcm_playback_open:
...
2020-12-07T09:54:51.025137Z DEBUG kernel: [ 877.832337] sof_rt5682 sof_rt5682: playback write error (DMA or IRQ trouble?)
It's interesting that this only happen to few Kaisa devices which is CML chromebox with rt5682 headphone codec. My experience is that for those devices which has this issue, there is an around 80% possibility to fail in 10 mins audio playback. OS version seems irrelevant according to ODM's rest result since we are using cml-008-patch-backport for long time.
messages.txt
plbossart commentedon Jun 10, 2021
@brentlu did your backports solve this issue? if yes can we close?
brentlu commentedon Oct 22, 2021
Since the FW has been deployed since March 2020 without issue feedback til today, we can close it.