Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] dmesg does't stop flushing sof log after s3 when enter s3 with headset connected and sound setting opened. #1594

Closed
ClarexZhou opened this issue Jun 27, 2019 · 12 comments · Fixed by thesofproject/linux#1072
Assignees
Labels
bug Something isn't working as expected CML Applies to Comet Lake platform HDA Applies to HD-Audio bus for codec connection P1 Blocker bugs or important features

Comments

@ClarexZhou
Copy link

Describe the bug
Headset capture not work anymore when suspend & wake up stress test with sound setting opened.

To Reproduce

  1. Headset is connected
  2. Open Settings->Sound, select Input table.
  3. 'sudo rtcwake -m mem -s 30' to enter S3 and wake up.
  4. speaker to headset mic, check 'Input level' for headset in sound setting works
  5. Repeat step3 and step 4 for more than 30 times.

Reproduction Rate
1/30

Expected behavior
Headset capture should always works after wake up

Impact
Headset capture not work, zero data is recorded. Dmesg keeps out ipc rx: 0x90020000: GLB_TRACE_MSG sof-audio-pci 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG repeatly.

Environment
FW: 6cc8da1 https://github.com/thesofproject/sof/tree/cml-hda-dmic-001-drop-stable
Kernel: https://github.com/thesofproject/linux/tree/release/sof-v5.0 (top commit: 1cd1a89) + PR1060
TPLG: sof-hda-generic-2ch.tplg, same branch with FW.

Dmesg:

Jun 26 05:45:02 u kernel: [ 1347.721952] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x50010000: GLB_COMP_MSG: SET_VALUE
Jun 26 05:45:02 u kernel: [ 1347.721960] sof-audio-pci 0000:00:1f.3: ipc tx: 0x50010000: GLB_COMP_MSG: SET_VALUE
Jun 26 05:45:02 u kernel: [ 1347.722184] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x50010000: GLB_COMP_MSG: SET_VALUE
Jun 26 05:45:02 u kernel: [ 1347.722195] sof-audio-pci 0000:00:1f.3: ipc tx: 0x50010000: GLB_COMP_MSG: SET_VALUE
Jun 26 05:45:02 u kernel: [ 1347.722392] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x50010000: GLB_COMP_MSG: SET_VALUE
Jun 26 05:45:02 u kernel: [ 1347.722401] sof-audio-pci 0000:00:1f.3: ipc tx: 0x40020000: GLB_PM_MSG: CTX_RESTORE
Jun 26 05:45:02 u kernel: [ 1347.722517] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x40020000: GLB_PM_MSG: CTX_RESTORE
Jun 26 05:45:02 u kernel: [ 1347.722603] HDMI HDA Codec ehdaudio0D2: hdac_hdmi_present_sense: disconnect for pin:port 5:0
Jun 26 05:45:02 u kernel: [ 1347.722637] HDMI HDA Codec ehdaudio0D2: hdac_hdmi_present_sense: disconnect for pin:port 6:0
Jun 26 05:45:02 u kernel: [ 1347.722649] HDMI HDA Codec ehdaudio0D2: hdac_hdmi_present_sense: disconnect for pin:port 7:0
Jun 26 05:45:02 u kernel: [ 1347.826309] usb 1-6: reset high-speed USB device number 2 using xhci_hcd
Jun 26 05:45:02 u kernel: [ 1347.856298] nvme nvme0: 8/0/0 default/read/poll queues
Jun 26 05:45:02 u kernel: [ 1347.909539] ata1: SATA link down (SStatus 4 SControl 300)
Jun 26 05:45:02 u kernel: [ 1348.221503] sof-audio-pci 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG
Jun 26 05:45:02 u kernel: [ 1348.221527] sof-audio-pci 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG
Jun 26 05:45:02 u kernel: [ 1348.721745] sof-audio-pci 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG
Jun 26 05:45:02 u kernel: [ 1348.721779] sof-audio-pci 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG
Jun 26 05:45:02 u kernel: [ 1349.327973] acpi LNXPOWER:04: Turning OFF
Jun 26 05:45:02 u kernel: [ 1349.328132] OOM killer enabled.
Jun 26 05:45:02 u kernel: [ 1349.328134] Restarting tasks ... 
Jun 26 05:45:02 u kernel: [ 1349.331061] sof-audio-pci 0000:00:1f.3: hda: prepare stream dir 1
Jun 26 05:45:02 u kernel: [ 1349.331075] sof-audio-pci 0000:00:1f.3: ipc tx: 0x80010000: GLB_DAI_MSG: CONFIG
Jun 26 05:45:02 u kernel: [ 1349.331211] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x80010000: GLB_DAI_MSG: CONFIG
Jun 26 05:45:02 u kernel: [ 1349.331231] sof-audio-pci 0000:00:1f.3: format_val=49, rate=48000, ch=2, format=10
Jun 26 05:45:02 u kernel: [ 1349.331268] sof-audio-pci 0000:00:1f.3: pcm: prepare stream 0 dir 1
Jun 26 05:45:02 u kernel: [ 1349.331270] sof-audio-pci 0000:00:1f.3: pcm: hw params stream 0 dir 1
Jun 26 05:45:02 u kernel: [ 1349.331292] sof-audio-pci 0000:00:1f.3: period_bytes:0x3fc0
Jun 26 05:45:02 u kernel: [ 1349.331293] sof-audio-pci 0000:00:1f.3: periods:4
Jun 26 05:45:02 u kernel: [ 1349.331305] sof-audio-pci 0000:00:1f.3: stream_tag 3
Jun 26 05:45:02 u kernel: [ 1349.331311] sof-audio-pci 0000:00:1f.3: ipc tx: 0x60010000: GLB_STREAM_MSG: PCM_PARAMS
Jun 26 05:45:02 u kernel: [ 1349.331471] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x60010000: GLB_STREAM_MSG: PCM_PARAMS
Jun 26 05:45:02 u kernel: [ 1349.331474] sof-audio-pci 0000:00:1f.3: pcm: stream dir 1, posn mailbox offset is 790528
Jun 26 05:45:02 u kernel: [ 1349.331519] sof-audio-pci 0000:00:1f.3: pcm: trigger stream 0 dir 1 cmd 1
Jun 26 05:45:02 u kernel: [ 1349.331525] sof-audio-pci 0000:00:1f.3: ipc tx: 0x60040000: GLB_STREAM_MSG: TRIG_START
Jun 26 05:45:02 u kernel: [ 1349.331974] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x60040000: GLB_STREAM_MSG: TRIG_START
Jun 26 05:45:02 u kernel: [ 1349.331979] sof-audio-pci 0000:00:1f.3: In hda_link_pcm_trigger cmd=1
Jun 26 05:45:02 u kernel: [ 1349.332000] done.
Jun 26 05:45:02 u kernel: [ 1349.347054] thermal thermal_zone4: failed to read out thermal zone (-61)
Jun 26 05:45:02 u systemd-sleep[2668]: System resumed.
Jun 26 05:45:02 u kernel: [ 1349.369124] PM: suspend exit
Jun 26 05:45:02 u systemd[1]: Started Suspend.
Jun 26 05:45:02 u systemd[1]: sleep.target: Unit not needed anymore. Stopping.
Jun 26 05:45:02 u systemd[1]: Stopped target Sleep.
Jun 26 05:45:02 u systemd[1]: tlp-sleep.service: Unit not needed anymore. Stopping.
Jun 26 05:45:02 u systemd[1]: Stopping TLP suspend/resume...
Jun 26 05:45:02 u systemd[1]: Reached target Suspend.
Jun 26 05:45:02 u systemd[1]: suspend.target: Unit not needed anymore. Stopping.
Jun 26 05:45:02 u systemd[1]: Stopped target Suspend.
Jun 26 05:45:02 u gnome-shell[1236]: Failed to set power save mode for output eDP-1: Permission denied
Jun 26 05:45:02 u NetworkManager[997]: <info>  [1561542302.8852] manager: sleep: wake requested (sleeping: yes  enabled: yes)
Jun 26 05:45:02 u NetworkManager[997]: <info>  [1561542302.8852] device (wlp0s20f3): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'managed')
Jun 26 05:45:02 u kernel: [ 1349.380438] sof-audio-pci 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG
Jun 26 05:45:02 u kernel: [ 1349.380461] sof-audio-pci 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG
Jun 26 05:45:02 u kernel: [ 1349.381557] iwlwifi 0000:00:14.3: Applying debug destination EXTERNAL_DRAM
Jun 26 05:45:02 u kernel: [ 1349.406528] sof-audio-pci 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG
Jun 26 05:45:02 u kernel: [ 1349.406550] sof-audio-pci 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG
Jun 26 05:45:02 u kernel: [ 1349.432624] sof-audio-pci 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG
Jun 26 05:45:02 u kernel: [ 1349.432645] sof-audio-pci 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG
Jun 26 05:45:02 u kernel: [ 1349.458535] sof-audio-pci 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG
Jun 26 05:45:02 u kernel: [ 1349.458567] sof-audio-pci 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG
Jun 26 05:45:02 u kernel: [ 1349.484543] sof-audio-pci 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG
Jun 26 05:45:02 u kernel: [ 1349.484570] sof-audio-pci 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG
Jun 26 05:45:03 u kernel: [ 1349.496481] iwlwifi 0000:00:14.3: FW already configured (0) - re-configuring
Jun 26 05:45:03 u kernel: [ 1349.508582] iwlwifi 0000:00:14.3: BIOS contains WGDS but no WRDS
Jun 26 05:45:03 u NetworkManager[997]: <info>  [1561542303.0229] manager: NetworkManager state is now DISCONNECTED
Jun 26 05:45:03 u kernel: [ 1349.510464] sof-audio-pci 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG
Jun 26 05:45:03 u kernel: [ 1349.510497] sof-audio-pci 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG
Jun 26 05:45:03 u kernel: [ 1349.536524] sof-audio-pci 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG
Jun 26 05:45:03 u kernel: [ 1349.536559] sof-audio-pci 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG
Jun 26 05:45:03 u kernel: [ 1349.562493] sof-audio-pci 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG
Jun 26 05:45:03 u kernel: [ 1349.562527] sof-audio-pci 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG
Jun 26 05:45:03 u wpa_supplicant[996]: dbus: fill_dict_with_properties dbus_interface=fi.w1.wpa_supplicant1.Interface dbus_property=Stations getter failed
Jun 26 05:45:03 u wpa_supplicant[996]: dbus: wpa_dbus_get_object_properties: failed to get object properties: (none) none
Jun 26 05:45:03 u wpa_supplicant[996]: dbus: Failed to construct signal
Jun 26 05:45:03 u wpa_supplicant[996]: Failed to create interface p2p-dev-wlp0s20f3: -22 (Invalid argument)
Jun 26 05:45:03 u wpa_supplicant[996]: nl80211: Failed to create a P2P Device interface p2p-dev-wlp0s20f3
Jun 26 05:45:03 u wpa_supplicant[996]: P2P: Failed to enable P2P Device interface
Jun 26 05:45:03 u wpa_supplicant[996]: dbus: fill_dict_with_properties dbus_interface=fi.w1.wpa_supplicant1.Interface dbus_property=Stations getter failed
Jun 26 05:45:03 u systemd[1]: Stopped TLP suspend/resume.
Jun 26 05:45:03 u NetworkManager[997]: <info>  [1561542303.0961] device (wlp0s20f3): supplicant interface state: starting -> ready
Jun 26 05:45:03 u NetworkManager[997]: <info>  [1561542303.0963] device (wlp0s20f3): state change: unavailable -> disconnected (reason 'supplicant-available', sys-iface-state: 'managed')
Jun 26 05:45:03 u kernel: [ 1349.588482] sof-audio-pci 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG
Jun 26 05:45:03 u kernel: [ 1349.588511] sof-audio-pci 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG
Jun 26 05:45:03 u kernel: [ 1349.614522] sof-audio-pci 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG
Jun 26 05:45:03 u kernel: [ 1349.614549] sof-audio-pci 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG

sof logger

CORE  LEVEL      COMP_ID                TIMESTAMP            DELTA                FILE_NAME	CONTENT
    0      1       VOLUME         551989199.375000 551989184.000000 udio/volume/volume.c:510 	volume_copy(): Failed comp_get_copy_limits()
    0      1         PIPE         551989205.260417         5.885417 src/audio/pipeline.c:808 	pipeline_copy() error: ret = -5, start->comp.id = 13, dir = 0
    0      1         PIPE 2.14    551989212.135417         6.875000 src/audio/pipeline.c:920 	pipeline_xrun_recover()
    0      2         PIPE 2.14    551989217.812500         5.677083 src/audio/pipeline.c:402 	pipeline_prepare()
    0      2          DAI 2.13    551989222.239583         4.427083      src/audio/dai.c:447 	dai_prepare()
    0      2         PIPE 2.14    551989227.083333         4.843750 src/audio/pipeline.c:631 	pipeline_trigger()
    0      2          DAI 2.13    551989231.458333         4.375000      src/audio/dai.c:510 	dai_comp_trigger(), command = 1
    0      2          DAI 2.13    551989235.729167         4.270833      src/audio/dai.c:521 	dai_comp_trigger(), START
    0      2          DMA         551990405.781250      1170.052124 intel/cavs/hda-dma.c:555 	hda-dmac: 6 channel 1 -> start
    0      2          DMA         551990410.572917         4.791667 intel/cavs/hda-dma.c:391 	hda-dmac: 6 channel 1 -> enable
    0      2       BUFFER         551991657.343750      1246.770874   src/audio/buffer.c:118 	comp_update_buffer_produce(), no bytes to produce
    0      1         COMP         551991662.812500         5.468750 rc/audio/component.c:252 	comp_get_copy_limits() error: source component buffer has not enough data available
    0      2         COMP         551991668.593750         5.781250 of/audio/component.h:731 	comp_underrun(), ((dev->comp.id << 16) | source->avail) = 655360, ((min_bytes << 16) | copy_bytes) = 0
    0      2         PIPE 2.14    551991672.812500         4.218750 src/audio/pipeline.c:631 	pipeline_trigger()
    0      2          DAI 2.13    551991677.291667         4.479167      src/audio/dai.c:510 	dai_comp_trigger(), command = 8
    0      2          DAI 2.13    551991681.614583         4.322917      src/audio/dai.c:568 	dai_comp_trigger(), XRUN
    0      2          DAI 2.13    551991685.520833         3.906250      src/audio/dai.c:574 	dai_comp_trigger(), PAUSE/STOP
    0      2          DMA         551991690.000000         4.479167 intel/cavs/hda-dma.c:650 	hda-dmac: 6 channel 1 -> stop
    0      1       VOLUME         551991697.500000         7.500000 udio/volume/volume.c:510 	volume_copy(): Failed comp_get_copy_limits()
    0      1         PIPE         551991703.385417         5.885417 src/audio/pipeline.c:808 	pipeline_copy() error: ret = -5, start->comp.id = 13, dir = 0
    0      1         PIPE 2.14    551991710.364583         6.979167 src/audio/pipeline.c:920 	pipeline_xrun_recover()
    0      2         PIPE 2.14    551991715.833333         5.468750 src/audio/pipeline.c:402 	pipeline_prepare()
    0      2          DAI 2.13    551991720.260417         4.427083      src/audio/dai.c:447 	dai_prepare()
    0      2         PIPE 2.14    551991725.104167         4.843750 src/audio/pipeline.c:631 	pipeline_trigger()
    0      2          DAI 2.13    551991729.427083         4.322917      src/audio/dai.c:510 	dai_comp_trigger(), command = 1
    0      2          DAI 2.13    551991733.541667         4.114583      src/audio/dai.c:521 	dai_comp_trigger(), START
    0      2          DMA         551992905.781250      1172.239624 intel/cavs/hda-dma.c:555 	hda-dmac: 6 channel 1 -> start
    0      2          DMA         551992912.083333         6.302083 intel/cavs/hda-dma.c:391 	hda-dmac: 6 channel 1 -> enable
    0      2       BUFFER         551994157.447917      1245.364624   src/audio/buffer.c:118 	comp_update_buffer_produce(), no bytes to produce
    0      1         COMP         551994162.708333         5.260417 rc/audio/component.c:252 	comp_get_copy_limits() error: source component buffer has not enough data available
    0      2         COMP         551994168.593750         5.885417 of/audio/component.h:731 	comp_underrun(), ((dev->comp.id << 16) | source->avail) = 655360, ((min_bytes << 16) | copy_bytes) = 0
    0      2         PIPE 2.14    551994172.500000         3.906250 src/audio/pipeline.c:631 	pipeline_trigger()
    0      2          DAI 2.13    551994176.770833         4.270833      src/audio/dai.c:510 	dai_comp_trigger(), command = 8
    0      2          DAI 2.13    551994180.833333         4.062500      src/audio/dai.c:568 	dai_comp_trigger(), XRUN
    0      2          DAI 2.13    551994184.479167         3.645833      src/audio/dai.c:574 	dai_comp_trigger(), PAUSE/STOP
    0      2          DMA         551994188.645833         4.166667 intel/cavs/hda-dma.c:650 	hda-dmac: 6 channel 1 -> stop
    0      1       VOLUME         551994195.937500         7.291667 udio/volume/volume.c:510 	volume_copy(): Failed comp_get_copy_limits()
    0      1         PIPE         551994201.927083         5.989583 src/audio/pipeline.c:808 	pipeline_copy() error: ret = -5, start->comp.id = 13, dir = 0
    0      1         PIPE 2.14    551994208.802083         6.875000 src/audio/pipeline.c:920 	pipeline_xrun_recover()
    0      2         PIPE 2.14    551994214.270833         5.468750 src/audio/pipeline.c:402 	pipeline_prepare()
    0      2          DAI 2.13    551994218.645833         4.375000      src/audio/dai.c:447 	dai_prepare()
    0      2         PIPE 2.14    551994223.281250         4.635417 src/audio/pipeline.c:631 	pipeline_trigger()
    0      2          DAI 2.13    551994227.500000         4.218750      src/audio/dai.c:510 	dai_comp_trigger(), command = 1
    0      2          DAI 2.13    551994231.406250         3.906250      src/audio/dai.c:521 	dai_comp_trigger(), START
    0      2          DMA         551995405.833333      1174.427124 intel/cavs/hda-dma.c:555 	hda-dmac: 6 channel 1 -> start
    0      2          DMA         551995410.729167         4.895833 intel/cavs/hda-dma.c:391 	hda-dmac: 6 channel 1 -> enable
    0      2       BUFFER         551996657.500000      1246.770874   src/audio/buffer.c:118 	comp_update_buffer_produce(), no bytes to produce
    0      1         COMP         551996663.437500         5.937500 rc/audio/component.c:252 	comp_get_copy_limits() error: source component buffer has not enough data available
    0      2         COMP         551996669.375000         5.937500 of/audio/component.h:731 	comp_underrun(), ((dev->comp.id << 16) | source->avail) = 655360, ((min_bytes << 16) | copy_bytes) = 0
    0      2         PIPE 2.14    551996673.645833         4.270833 src/audio/pipeline.c:631 	pipeline_trigger()
    0      2          DAI 2.13    551996678.281250         4.635417      src/audio/dai.c:510 	dai_comp_trigger(), command = 8
    0      2          DAI 2.13    551996682.708333         4.427083      src/audio/dai.c:568 	dai_comp_trigger(), XRUN
    0      2          DAI 2.13    551996686.770833         4.062500      src/audio/dai.c:574 	dai_comp_trigger(), PAUSE/STOP
    0      2          DMA         551996691.197917         4.427083 intel/cavs/hda-dma.c:650 	hda-dmac: 6 channel 1 -> stop
    0      1       VOLUME         551996699.010417         7.812500 udio/volume/volume.c:510 	volume_copy(): Failed comp_get_copy_limits()
    0      1         PIPE         551996705.000000         5.989583 src/audio/pipeline.c:808 	pipeline_copy() error: ret = -5, start->comp.id = 13, dir = 0
    0      1         PIPE 2.14    551996712.031250         7.031250 src/audio/pipeline.c:920 	pipeline_xrun_recover()
    0      2         PIPE 2.14    551996717.760417         5.729167 src/audio/pipeline.c:402 	pipeline_prepare()
    0      2          DAI 2.13    551996722.343750         4.583333      src/audio/dai.c:447 	dai_prepare()
    0      2         PIPE 2.14    551996727.343750         5.000000 src/audio/pipeline.c:631 	pipeline_trigger()
    0      2          DAI 2.13    551996731.875000         4.531250      src/audio/dai.c:510 	dai_comp_trigger(), command = 1
    0      2          DAI 2.13    551996736.250000         4.375000      src/audio/dai.c:521 	dai_comp_trigger(), START
    0      2          DMA         551997905.833333      1169.583374 intel/cavs/hda-dma.c:555 	hda-dmac: 6 channel 1 -> start
    0      2          DMA         551997910.572917         4.739583 intel/cavs/hda-dma.c:391 	hda-dmac: 6 channel 1 -> enable
    0      2       BUFFER         551999157.812500      1247.239624   src/audio/buffer.c:118 	comp_update_buffer_produce(), no bytes to produce
    0      1         COMP         551999163.385417         5.572917 rc/audio/component.c:252 	comp_get_copy_limits() error: source component buffer has not enough data available
    0      2         COMP         551999169.322917         5.937500 of/audio/component.h:731 	comp_underrun(), ((dev->comp.id << 16) | source->avail) = 655360, ((min_bytes << 16) | copy_bytes) = 0
    0      2         PIPE 2.14    551999173.645833         4.322917 src/audio/pipeline.c:631 	pipeline_trigger()
    0      2          DAI 2.13    551999178.229167         4.583333      src/audio/dai.c:510 	dai_comp_trigger(), command = 8
    0      2          DAI 2.13    551999182.604167         4.375000      src/audio/dai.c:568 	dai_comp_trigger(), XRUN
    0      2          DAI 2.13    551999186.614583         4.010417      src/audio/dai.c:574 	dai_comp_trigger(), PAUSE/STOP
    0      2          DMA         551999191.197917         4.583333 intel/cavs/hda-dma.c:650 	hda-dmac: 6 channel 1 -> stop
    0      1       VOLUME         551999198.750000         7.552083 udio/volume/volume.c:510 	volume_copy(): Failed comp_get_copy_limits()
    0      1         PIPE         551999204.791667         6.041667 src/audio/pipeline.c:808 	pipeline_copy() error: ret = -5, start->comp.id = 13, dir = 0
    0      1         PIPE 2.14    551999211.875000         7.083333 src/audio/pipeline.c:920 	pipeline_xrun_recover()
    0      2         PIPE 2.14    551999217.395833         5.520833 src/audio/pipeline.c:402 	pipeline_prepare()
    0      2          DAI 2.13    551999221.927083         4.531250      src/audio/dai.c:447 	dai_prepare()
    0      2         PIPE 2.14    551999226.875000         4.947917 src/audio/pipeline.c:631 	pipeline_trigger()
    0      2          DAI 2.13    551999231.510417         4.635417      src/audio/dai.c:510 	dai_comp_trigger(), command = 1
    0      2          DAI 2.13    551999235.729167         4.218750      src/audio/dai.c:521 	dai_comp_trigger(), START
    0      2          DMA         552000405.937500      1170.208374 intel/cavs/hda-dma.c:555 	hda-dmac: 6 channel 1 -> start
    0      2          DMA         552000410.885417         4.947917 intel/cavs/hda-dma.c:391 	hda-dmac: 6 channel 1 -> enable
    0      2       BUFFER         552001657.656250      1246.770874   src/audio/buffer.c:118 	comp_update_buffer_produce(), no bytes to produce
    0      1         COMP         552001663.281250         5.625000 rc/audio/component.c:252 	comp_get_copy_limits() error: source component buffer has not enough data available
    0      2         COMP         552001669.218750         5.937500 of/audio/component.h:731 	comp_underrun(), ((dev->comp.id << 16) | source->avail) = 655360, ((min_bytes << 16) | copy_bytes) = 0
    0      2         PIPE 2.14    552001673.385417         4.166667 src/audio/pipeline.c:631 	pipeline_trigger()
    0      2          DAI 2.13    552001678.020833         4.635417      src/audio/dai.c:510 	dai_comp_trigger(), command = 8
    0      2          DAI 2.13    552001682.395833         4.375000      src/audio/dai.c:568 	dai_comp_trigger(), XRUN
    0      2          DAI 2.13    552001686.562500         4.166667      src/audio/dai.c:574 	dai_comp_trigger(), PAUSE/STOP
    0      2          DMA         552001690.989583         4.427083 intel/cavs/hda-dma.c:650 	hda-dmac: 6 channel 1 -> stop
    0      1       VOLUME         552001698.593750         7.604167 udio/volume/volume.c:510 	volume_copy(): Failed comp_get_copy_limits()
    0      1         PIPE         552001704.687500         6.093750 src/audio/pipeline.c:808 	pipeline_copy() error: ret = -5, start->comp.id = 13, dir = 0
    0      1         PIPE 2.14    552001711.666667         6.979167 src/audio/pipeline.c:920 	pipeline_xrun_recover()
    0      2         PIPE 2.14    552001717.187500         5.520833 src/audio/pipeline.c:402 	pipeline_prepare()
    0      2          DAI 2.13    552001721.718750         4.531250      src/audio/dai.c:447 	dai_prepare()
    0      2         PIPE 2.14    552001726.614583         4.895833 src/audio/pipeline.c:631 	pipeline_trigger()
    0      2          DAI 2.13    552001731.093750         4.479167      src/audio/dai.c:510 	dai_comp_trigger(), command = 1
    0      2          DAI 2.13    552001735.312500         4.218750      src/audio/dai.c:521 	dai_comp_trigger(), START
    0      2          DMA         552002905.677083      1170.364624 intel/cavs/hda-dma.c:555 	hda-dmac: 6 channel 1 -> start
    0      2          DMA         552002910.520833         4.843750 intel/cavs/hda-dma.c:391 	hda-dmac: 6 channel 1 -> enable
    0      2       BUFFER         552004157.447917      1246.927124   src/audio/buffer.c:118 	comp_update_buffer_produce(), no bytes to produce
    0      1         COMP         552004163.177083         5.729167 rc/audio/component.c:252 	comp_get_copy_limits() error: source component buffer has not enough data available
    0      2         COMP         552004169.010417         5.833333 of/audio/component.h:731 	comp_underrun(), ((dev->comp.id << 16) | source->avail) = 655360, ((min_bytes << 16) | copy_bytes) = 0
    0      2         PIPE 2.14    552004173.229167         4.218750 src/audio/pipeline.c:631 	pipeline_trigger()
    0      2          DAI 2.13    552004177.760417         4.531250      src/audio/dai.c:510 	dai_comp_trigger(), command = 8
    0      2          DAI 2.13    552004182.239583         4.479167      src/audio/dai.c:568 	dai_comp_trigger(), XRUN
    0      2          DAI 2.13    552004186.250000         4.010417      src/audio/dai.c:574 	dai_comp_trigger(), PAUSE/STOP
    0      2          DMA         552004190.677083         4.427083 intel/cavs/hda-dma.c:650 	hda-dmac: 6 channel 1 -> stop
    0      1       VOLUME         552004198.385417         7.708333 udio/volume/volume.c:510 	volume_copy(): Failed comp_get_copy_limits()
    0      1         PIPE         552004204.375000         5.989583 src/audio/pipeline.c:808 	pipeline_copy() error: ret = -5, start->comp.id = 13, dir = 0
    0      1         PIPE 2.14    552004211.354167         6.979167 src/audio/pipeline.c:920 	pipeline_xrun_recover()
    0      2         PIPE 2.14    552004217.083333         5.729167 src/audio/pipeline.c:402 	pipeline_prepare()
    0      2          DAI 2.13    552004221.614583         4.531250      src/audio/dai.c:447 	dai_prepare()
    0      2         PIPE 2.14    552004226.562500         4.947917 src/audio/pipeline.c:631 	pipeline_trigger()
    0      2          DAI 2.13    552004231.041667         4.479167      src/audio/dai.c:510 	dai_comp_trigger(), command = 1

sof-logger-s3-mantis.log
mantis-s3-headset-fail-2.log

@ClarexZhou ClarexZhou added bug Something isn't working as expected CML Applies to Comet Lake platform HDA Applies to HD-Audio bus for codec connection labels Jun 27, 2019
@mengdonglin mengdonglin added the P1 Blocker bugs or important features label Jun 27, 2019
@RanderWang
Copy link
Collaborator

RanderWang commented Jun 28, 2019

I reproduced the XRUN recovery case by modifying hda_dma_avail_data_size.
Just let hda_dma_avail_data_size always return 0 after capture works 10 seconds,
At this time, FW would recover XRUN and arecord just seems hang but not stop.
then do S3 and resume from S3, you will find so many XRUN recovery messages.

For real case, hda_dma_avail_data_size will only returns 0 when status & DGCS_BNE == 0
let`s check why it is zero

	status = host_dma_reg_read(chan->dma, chan->index, DGCS);

	if (status & DGCS_BF)
		return chan->buffer_bytes;

	if (!(status & DGCS_BNE))
		return 0;

@RanderWang
Copy link
Collaborator

I also did some changes in codecs and sof kernel driver to generate infinite XRUN recovery, but I didn't get any XRUN.

(1) don't program codec for capture stream when resuming from S3. Codec will not send data to controller with this change. But no XRUN occurred.
(2) don't program controller for capture stream when resuming from S3. Still no XRUN occurred.

Until now, our QA still cant reproduce the bug.

@ClarexZhou
Copy link
Author

ClarexZhou commented Jun 28, 2019

Finally got this repeated message send in dmesg issue reproduced. Can be reproduced via below steps:

  1. Boot up with headset connected
  2. Open sound setting quickly after unit boot up
  3. Go to Input page, highlight headset, check capture not work. But no repeat messages send in dmesg. (same issue with kmod_scripts: add da7219 codec support for GLK #1055 Headset arecord not work when plug in headset as soon as wake up from S3 (2/12))
  4. Keep sound setting opened, enter S3 and wake up, check dmesg. Repeated message keep flashing in dmesg issue is reproduced.

After step3, if close sound setting, then do S3, the repeated message flashing issue not occurred. -> Open sound setting and highlight Headset input, then do S3 again, still the repeated message flashing issue not occurred.

@tlauda
Copy link
Contributor

tlauda commented Jun 28, 2019

@ClarexZhou Do you have FW logs?

@ClarexZhou
Copy link
Author

Attach logs.

sof-logger
···
CORE LEVEL COMP_ID TIMESTAMP DELTA FILE_NAME CONTENT
0 1 PIPE 2.14 57460664.635417 57460664.000000 src/audio/pipeline.c:920 pipeline_xrun_recover()
0 1 COMP 57463117.447917 2452.812500 rc/audio/component.c:252 comp_get_copy_limits() error: source component buffer has not enough data available
0 1 VOLUME 57463151.979167 34.531250 udio/volume/volume.c:510 volume_copy(): Failed comp_get_copy_limits()
0 1 PIPE 57463157.864583 5.885417 src/audio/pipeline.c:808 pipeline_copy() error: ret = -5, start->comp.id = 13, dir = 0
0 1 PIPE 2.14 57463164.895833 7.031250 src/audio/pipeline.c:920 pipeline_xrun_recover()
0 1 COMP 57465617.343750 2452.447998 rc/audio/component.c:252 comp_get_copy_limits() error: source component buffer has not enough data available
0 1 VOLUME 57465650.729167 33.385418 udio/volume/volume.c:510 volume_copy(): Failed comp_get_copy_limits()
0 1 PIPE 57465656.614583 5.885417 src/audio/pipeline.c:808 pipeline_copy() error: ret = -5, start->comp.id = 13, dir = 0
0 1 PIPE 2.14 57465663.697917 7.083333 src/audio/pipeline.c:920 pipeline_xrun_recover()
0 1 COMP 57468117.760417 2454.062500 rc/audio/component.c:252 comp_get_copy_limits() error: source component buffer has not enough data available
0 1 VOLUME 57468153.489583 35.729168 udio/volume/volume.c:510 volume_copy(): Failed comp_get_copy_limits()
0 1 PIPE 57468159.479167 5.989583 src/audio/pipeline.c:808 pipeline_copy() error: ret = -5, start->comp.id = 13, dir = 0
0 1 PIPE 2.14 57468166.406250 6.927083 src/audio/pipeline.c:920 pipeline_xrun_recover()
0 1 COMP 57470617.395833 2450.989502 rc/audio/component.c:252 comp_get_copy_limits() error: source component buffer has not enough data available
0 1 VOLUME 57470652.812500 35.416668 udio/volume/volume.c:510 volume_copy(): Failed comp_get_copy_limits()
0 1 PIPE 57470658.802083 5.989583 src/audio/pipeline.c:808 pipeline_copy() error: ret = -5, start->comp.id = 13, dir = 0
0 1 PIPE 2.14 57470665.729167 6.927083 src/audio/pipeline.c:920 pipeline_xrun_recover()
0 1 COMP 57473117.812500 2452.083252 rc/audio/component.c:252 comp_get_copy_limits() error: source component buffer has not enough data available
0 1 VOLUME 57473153.020833 35.208332 udio/volume/volume.c:510 volume_copy(): Failed comp_get_copy_limits()
0 1 PIPE 57473159.010417 5.989583 src/audio/pipeline.c:808 pipeline_copy() error: ret = -5, start->comp.id = 13, dir = 0
0 1 PIPE 2.14 57473166.093750 7.083333 src/audio/pipeline.c:920 pipeline_xrun_recover()
0 1 COMP 57475617.812
···

sof-logger-t_afterstep4.log
dmesgAfterstep4.log
sof-logger_afterstep4.log

@ClarexZhou ClarexZhou changed the title [BUG] Analog capture not work when do S3 stress test with headset connected and sound setting opened. [BUG] dmesg dons't stop flushing sof log after s3 when enter s3 with headset connected and sound setting opened. Jul 1, 2019
@tlauda
Copy link
Contributor

tlauda commented Jul 1, 2019

@ClarexZhou Please get FW log with XRUN disabled as @keqiaozhang did it with different bug: #1578 (comment).

@RanderWang
Copy link
Collaborator

@tlauda @jajanusz
The FW log maybe not useful for you because it is full of XRUN. I have an idea: if XRUN recovery occurs infinite, can we just stop recovery after first continuous recoveries ? So that we can get few log and it is more easy to get the first XRUN point.

For this case, we found that for a special operation, capture didn't work before S3 and infinite XRUN happened after S3. Now I am working on why capture didn't work. I think you could wait for my finding and go on other work.

@mengdonglin mengdonglin changed the title [BUG] dmesg dons't stop flushing sof log after s3 when enter s3 with headset connected and sound setting opened. [BUG] dmesg does't stop flushing sof log after s3 when enter s3 with headset connected and sound setting opened. Jul 1, 2019
@ClarexZhou
Copy link
Author

The dmesg keeps flushing issue can't be reproduced after disabled xrun recovery.

sof-logger:

 CORE  LEVEL      COMP_ID                TIMESTAMP            DELTA                FILE_NAME	CONTENT
    0      1         COMP           1768107.395833   1768107.375000 rc/audio/component.c:252 	comp_get_copy_limits() error: source component buffer has not enough data available
    0      1       VOLUME           1768143.697917        36.302082 udio/volume/volume.c:510 	volume_copy(): Failed comp_get_copy_limits()
    0      1         PIPE           1768149.947917         6.250000 src/audio/pipeline.c:808 	pipeline_copy() error: ret = -5, start->comp.id = 13, dir = 0
    0      1         PIPE 2.14      1768157.187500         7.239583 src/audio/pipeline.c:998 	pipeline_task(): xrun recover failed! pipeline will be stopped!

sof-logger__xrunRecoveryDisbale.log
dmesg_xrunRecoveryDisbale_dmesg.log
sof-logger_all_xrunRecoveryDisbale.log

@jajanusz
Copy link
Contributor

jajanusz commented Jul 1, 2019

@RanderWang Looks more like kernel issue. FW is not spamming anything, you just fell into some loop on your side (maybe there are some interrupts that trigger it on your side but I doubt it). There are no messages generated (by FW) but you keep rereading them, can you check what causes it?

@jajanusz
Copy link
Contributor

jajanusz commented Jul 1, 2019

Probably the same issue as: thesofproject/linux#1064

RanderWang added a commit to RanderWang/linux that referenced this issue Jul 3, 2019
BugLink: thesofproject/sof#1594

In ASoC, hda codecs and SOF driver set the same stream tag
to hardware for a stream and this stream tag should be restored
to hardware after resuming from S3. For this bug, there are
two capture streams active before S3 and one is released when
doing S3. After resuming from S3, hda codec driver restored
stream tag for the active stream, then SOF restored another
stream tag which is allocated again, and this makes controller
don't get any capture data, then infinite XRUN happens in FW.

Now this patch checks whether there is a stored dma data for
stream resuming from S3 and reuses it. And it also removes
dma data when the stream is released.

Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
RanderWang added a commit to RanderWang/linux that referenced this issue Jul 3, 2019
BugLink: thesofproject/sof#1594

In ASoC, hda codecs and SOF driver set the same stream tag
to hardware for a stream and this stream tag should be restored
to hardware after resuming from S3. For this bug, there are
two capture streams active before S3 and one is released when
doing S3. After resuming from S3, hda codec driver restores
stream tag for the active stream, but SOF restores another
stream tag which is allocated again, and this makes controller
don't get any capture data, then infinite XRUN happens in FW.

Now this patch checks whether there is a stored dma data for
stream resuming from S3 and reuses it. And it also removes
dma data when the stream is released.

Tested on whiskylake with SOF driver.

Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
@RanderWang
Copy link
Collaborator

RanderWang commented Jul 3, 2019

@jajanusz @tlauda Thanks for your advice. My finding was changed in my debug progress and the final reason is: wrong link dma channel is set to FW after S3. Actually, we found another bug in the debug progress and it confused us.

@tlauda
Copy link
Contributor

tlauda commented Jul 3, 2019

Kernel issue, fix in thesofproject/linux#1072.

@tlauda tlauda closed this as completed Jul 3, 2019
bardliao pushed a commit to thesofproject/linux that referenced this issue Jul 3, 2019
BugLink: thesofproject/sof#1594

In ASoC, hda codecs and SOF driver set the same stream tag
to hardware for a stream and this stream tag should be restored
to hardware after resuming from S3. For this bug, there are
two capture streams active before S3 and one is released when
doing S3. After resuming from S3, hda codec driver restored
stream tag for the active stream, then SOF restored another
stream tag which is allocated again, and this makes controller
don't get any capture data, then infinite XRUN happens in FW.

Now this patch checks whether there is a stored dma data for
stream resuming from S3 and reuses it. And it also removes
dma data when the stream is released.

Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
RanderWang added a commit to RanderWang/linux that referenced this issue Jul 4, 2019
In ASoC, hda codec and SOF driver set the same stream tag to
hardware for a pcm stream and this stream tag should be restored
to hardware after resuming from system suspend. For this bug,
there are two capture pcm streams active before doing system
suspend and one is terminated by user for the stream is unused
and its stream tag is released. Later after doing system suspend
the stream tag for remained active stream is released by SOF driver.
After system resume, hda codec driver restores the stream tag for
the active pcm stream, but SOF restores another stream tag which is
allocated with a different stream tag, and this makes controller
don't get any capture data, then infinite XRUN happens in FW.

For stream tag is stored in both hda codec and SOF driver, it
shouldn't be released only in SOF driver. This patch just keeps the
stream information in dma data and checks whether there is a stored
DMA data for stream resuming from S3 and restores it. And it also
removes DMA data when the stream is released.

Tested on Whisky Lake platform.

GitHub issue: thesofproject/sof#1594
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
RanderWang added a commit to RanderWang/linux that referenced this issue Jul 5, 2019
In ASoC, hda codec and SOF driver set the same stream tag to
hardware for a pcm stream and this stream tag should be restored
to hardware after resuming from system suspend. For this bug,
there are two capture pcm streams active before doing system
suspend and one is terminated by user for the stream is unused
and its stream tag is released. Later after doing system suspend
the stream tag for remained active stream is released by SOF driver.
After system resume, hda codec driver restores the stream tag for
the active pcm stream, but SOF goes to assign a new one, which now
doesn't match with the stream tag used by codec driver, and this makes
controller don't get any capture data, then infinite XRUN happens in FW.

For stream tag is stored in both hda codec and SOF driver, it
shouldn't be released only in SOF driver. This patch just keeps the
stream information in dma data and checks whether there is a stored
DMA data for stream resuming from S3 and restores it. And it also
removes DMA data when the stream is released.

Tested on Whiskey Lake platform.

GitHub issue: thesofproject/sof#1594
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
bardliao pushed a commit to thesofproject/linux that referenced this issue Jul 5, 2019
In ASoC, hda codec and SOF driver set the same stream tag to
hardware for a pcm stream and this stream tag should be restored
to hardware after resuming from system suspend. For this bug,
there are two capture pcm streams active before doing system
suspend and one is terminated by user for the stream is unused
and its stream tag is released. Later after doing system suspend
the stream tag for remained active stream is released by SOF driver.
After system resume, hda codec driver restores the stream tag for
the active pcm stream, but SOF goes to assign a new one, which now
doesn't match with the stream tag used by codec driver, and this makes
controller don't get any capture data, then infinite XRUN happens in FW.

For stream tag is stored in both hda codec and SOF driver, it
shouldn't be released only in SOF driver. This patch just keeps the
stream information in dma data and checks whether there is a stored
DMA data for stream resuming from S3 and restores it. And it also
removes DMA data when the stream is released.

Tested on Whiskey Lake platform.

GitHub issue: thesofproject/sof#1594
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
bardliao pushed a commit to thesofproject/linux that referenced this issue Jul 5, 2019
In ASoC, hda codec and SOF driver set the same stream tag to
hardware for a pcm stream and this stream tag should be restored
to hardware after resuming from system suspend. For this bug,
there are two capture pcm streams active before doing system
suspend and one is terminated by user for the stream is unused
and its stream tag is released. Later after doing system suspend
the stream tag for remained active stream is released by SOF driver.
After system resume, hda codec driver restores the stream tag for
the active pcm stream, but SOF goes to assign a new one, which now
doesn't match with the stream tag used by codec driver, and this makes
controller don't get any capture data, then infinite XRUN happens in FW.

For stream tag is stored in both hda codec and SOF driver, it
shouldn't be released only in SOF driver. This patch just keeps the
stream information in dma data and checks whether there is a stored
DMA data for stream resuming from S3 and restores it. And it also
removes DMA data when the stream is released.

Tested on Whiskey Lake platform.

GitHub issue: thesofproject/sof#1594
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
bardliao pushed a commit to thesofproject/linux that referenced this issue Jul 5, 2019
In ASoC, hda codec and SOF driver set the same stream tag to
hardware for a pcm stream and this stream tag should be restored
to hardware after resuming from system suspend. For this bug,
there are two capture pcm streams active before doing system
suspend and one is terminated by user for the stream is unused
and its stream tag is released. Later after doing system suspend
the stream tag for remained active stream is released by SOF driver.
After system resume, hda codec driver restores the stream tag for
the active pcm stream, but SOF goes to assign a new one, which now
doesn't match with the stream tag used by codec driver, and this makes
controller don't get any capture data, then infinite XRUN happens in FW.

For stream tag is stored in both hda codec and SOF driver, it
shouldn't be released only in SOF driver. This patch just keeps the
stream information in dma data and checks whether there is a stored
DMA data for stream resuming from S3 and restores it. And it also
removes DMA data when the stream is released.

Tested on Whiskey Lake platform.

GitHub issue: thesofproject/sof#1594
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
jason77-wang pushed a commit to jason77-wang/oem that referenced this issue Jul 5, 2019
BugLink: https://bugs.launchpad.net/bugs/1826181

In ASoC, hda codec and SOF driver set the same stream tag to
hardware for a pcm stream and this stream tag should be restored
to hardware after resuming from system suspend. For this bug,
there are two capture pcm streams active before doing system
suspend and one is terminated by user for the stream is unused
and its stream tag is released. Later after doing system suspend
the stream tag for remained active stream is released by SOF driver.
After system resume, hda codec driver restores the stream tag for
the active pcm stream, but SOF goes to assign a new one, which now
doesn't match with the stream tag used by codec driver, and this makes
controller don't get any capture data, then infinite XRUN happens in FW.

For stream tag is stored in both hda codec and SOF driver, it
shouldn't be released only in SOF driver. This patch just keeps the
stream information in dma data and checks whether there is a stored
DMA data for stream resuming from S3 and restores it. And it also
removes DMA data when the stream is released.

Tested on Whiskey Lake platform.

GitHub issue: thesofproject/sof#1594
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
(cherry picked from commit 09d1ac5f488cac07a08011d7130177dac1f22184
git://github.com/thesofproject/linux.git)
Signed-off-by: Hui Wang <hui.wang@canonical.com>
RanderWang added a commit to RanderWang/linux that referenced this issue Jul 8, 2019
In ASoC, hda codec and SOF driver set the same stream tag to
hardware for a pcm stream and this stream tag should be restored
to hardware after resuming from system suspend. For this bug,
there are two capture pcm streams active before doing system
suspend and one is terminated by user for the stream is unused
and its stream tag is released. Later after doing system suspend
the stream tag for remained active stream is released by SOF driver.
After system resume, hda codec driver restores the stream tag for
the active pcm stream, but SOF goes to assign a new one, which now
doesn't match with the stream tag used by codec driver, and this makes
controller don't get any capture data, then infinite XRUN happens in FW.

For stream tag is stored in both hda codec and SOF driver, it
shouldn't be released only in SOF driver. This patch just keeps the
stream information in dma data and checks whether there is a stored
DMA data for stream resuming from S3 and restores it. And it also
removes DMA data when the stream is released.

Tested on Whiskey Lake platform.

GitHub issue: thesofproject/sof#1594
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
RanderWang added a commit to RanderWang/linux that referenced this issue Jul 9, 2019
For this bug, there are two capture pcm streams active, with one
stream and its related stream tag released before suspend. Later
when system suspend is done, the stream tag for the remaining
active stream is released by SOF driver. After system resume, hda
codec driver restores the stream tag for the active pcm stream,
but SOF goes to assign a new one, which now doesn't match with the
stream tag used by codec driver, and this causes DMA to fail
receiving data, leading to unrecoverable XRUN condition in FW.

For stream tag is stored in both hda codec and SOF driver, it
shouldn't be released only in SOF driver. This patch just keeps the
stream information in dma data and checks whether there is a stored
DMA data for stream resuming from S3 and restores it. And it also
removes DMA data when the stream is released.

Tested on Whiskey Lake platform.

GitHub issue: thesofproject/sof#1594
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
RanderWang added a commit to RanderWang/linux that referenced this issue Jul 9, 2019
For this bug, there are two capture pcm streams active, with one
stream and its related stream tag released before suspend. Later
when system suspend is done, the stream tag for the remaining
active stream is released by SOF driver. After system resume, hda
codec driver restores the stream tag for the active pcm stream,
but SOF goes to assign a new one, which now doesn't match with the
stream tag used by codec driver, and this causes DMA to fail
receiving data, leading to unrecoverable XRUN condition in FW.

For stream tag is stored in both hda codec and SOF driver, it
shouldn't be released only in SOF driver. This patch just keeps the
stream information in dma data and checks whether there is a stored
DMA data for stream resuming from S3 and restores it. And it also
removes DMA data when the stream is released.

Tested on Whiskey Lake platform.

GitHub issue: thesofproject/sof#1594
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
RanderWang added a commit to RanderWang/linux that referenced this issue Jul 9, 2019
For this bug, there are two capture pcm streams active, with one
stream and its related stream tag released before suspend. Later
when system suspend is done, the stream tag for the remaining
active stream is released by SOF driver. After system resume, hda
codec driver restores the stream tag for the active pcm stream,
but SOF goes to assign a new one, which now doesn't match with the
stream tag used by codec driver, and this causes DMA to fail
receiving data, leading to unrecoverable XRUN condition in FW.

For stream tag is stored in both hda codec and SOF driver, it
shouldn't be released only in SOF driver. This patch just keeps the
stream information in dma data and checks whether there is a stored
DMA data for stream resuming from S3 and restores it. And it also
removes DMA data when the stream is released.

Tested on Whiskey Lake platform.

GitHub issue: thesofproject/sof#1594
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
ranj063 pushed a commit to thesofproject/linux that referenced this issue Jul 9, 2019
For this bug, there are two capture pcm streams active, with one
stream and its related stream tag released before suspend. Later
when system suspend is done, the stream tag for the remaining
active stream is released by SOF driver. After system resume, hda
codec driver restores the stream tag for the active pcm stream,
but SOF goes to assign a new one, which now doesn't match with the
stream tag used by codec driver, and this causes DMA to fail
receiving data, leading to unrecoverable XRUN condition in FW.

For stream tag is stored in both hda codec and SOF driver, it
shouldn't be released only in SOF driver. This patch just keeps the
stream information in dma data and checks whether there is a stored
DMA data for stream resuming from S3 and restores it. And it also
removes DMA data when the stream is released.

Tested on Whiskey Lake platform.

GitHub issue: thesofproject/sof#1594
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
plbossart pushed a commit to thesofproject/linux that referenced this issue Jul 17, 2019
For this bug, there are two capture pcm streams active, with one
stream and its related stream tag released before suspend. Later
when system suspend is done, the stream tag for the remaining
active stream is released by SOF driver. After system resume, hda
codec driver restores the stream tag for the active pcm stream,
but SOF goes to assign a new one, which now doesn't match with the
stream tag used by codec driver, and this causes DMA to fail
receiving data, leading to unrecoverable XRUN condition in FW.

For stream tag is stored in both hda codec and SOF driver, it
shouldn't be released only in SOF driver. This patch just keeps the
stream information in dma data and checks whether there is a stored
DMA data for stream resuming from S3 and restores it. And it also
removes DMA data when the stream is released.

Tested on Whiskey Lake platform.

GitHub issue: thesofproject/sof#1594
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
plbossart pushed a commit to thesofproject/linux that referenced this issue Jul 17, 2019
For this bug, there are two capture pcm streams active, with one
stream and its related stream tag released before suspend. Later
when system suspend is done, the stream tag for the remaining
active stream is released by SOF driver. After system resume, hda
codec driver restores the stream tag for the active pcm stream,
but SOF goes to assign a new one, which now doesn't match with the
stream tag used by codec driver, and this causes DMA to fail
receiving data, leading to unrecoverable XRUN condition in FW.

For stream tag is stored in both hda codec and SOF driver, it
shouldn't be released only in SOF driver. This patch just keeps the
stream information in dma data and checks whether there is a stored
DMA data for stream resuming from S3 and restores it. And it also
removes DMA data when the stream is released.

Tested on Whiskey Lake platform.

GitHub issue: thesofproject/sof#1594
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
plbossart pushed a commit to thesofproject/linux that referenced this issue Jul 22, 2019
For this bug, there are two capture pcm streams active, with one
stream and its related stream tag released before suspend. Later
when system suspend is done, the stream tag for the remaining
active stream is released by SOF driver. After system resume, hda
codec driver restores the stream tag for the active pcm stream,
but SOF goes to assign a new one, which now doesn't match with the
stream tag used by codec driver, and this causes DMA to fail
receiving data, leading to unrecoverable XRUN condition in FW.

For stream tag is stored in both hda codec and SOF driver, it
shouldn't be released only in SOF driver. This patch just keeps the
stream information in dma data and checks whether there is a stored
DMA data for stream resuming from S3 and restores it. And it also
removes DMA data when the stream is released.

Tested on Whiskey Lake platform.

GitHub issue: thesofproject/sof#1594
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
keyonjie pushed a commit to keyonjie/linux that referenced this issue Oct 17, 2019
For this bug, there are two capture pcm streams active, with one
stream and its related stream tag released before suspend. Later
when system suspend is done, the stream tag for the remaining
active stream is released by SOF driver. After system resume, hda
codec driver restores the stream tag for the active pcm stream,
but SOF goes to assign a new one, which now doesn't match with the
stream tag used by codec driver, and this causes DMA to fail
receiving data, leading to unrecoverable XRUN condition in FW.

For stream tag is stored in both hda codec and SOF driver, it
shouldn't be released only in SOF driver. This patch just keeps the
stream information in dma data and checks whether there is a stored
DMA data for stream resuming from S3 and restores it. And it also
removes DMA data when the stream is released.

Tested on Whiskey Lake platform.

GitHub issue: thesofproject/sof#1594
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190722141402.7194-19-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
joelagnel pushed a commit to joelagnel/linux-kernel that referenced this issue Apr 17, 2020
For this bug, there are two capture pcm streams active, with one
stream and its related stream tag released before suspend. Later
when system suspend is done, the stream tag for the remaining
active stream is released by SOF driver. After system resume, hda
codec driver restores the stream tag for the active pcm stream,
but SOF goes to assign a new one, which now doesn't match with the
stream tag used by codec driver, and this causes DMA to fail
receiving data, leading to unrecoverable XRUN condition in FW.

For stream tag is stored in both hda codec and SOF driver, it
shouldn't be released only in SOF driver. This patch just keeps the
stream information in dma data and checks whether there is a stored
DMA data for stream resuming from S3 and restores it. And it also
removes DMA data when the stream is released.

Tested on Whiskey Lake platform.

GitHub issue: thesofproject/sof#1594
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190722141402.7194-19-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 934bf82)

BUG=b:140723130
TEST=Test Audio use cases for CML with full SOF patch series applied

Change-Id: I899bd5bd85f406c08a8f82c033d03ea279ea3268
Signed-off-by: Sachin Kumar <sachin.kumar@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2010615
Tested-by: Ben Zhang <benzh@chromium.org>
Commit-Queue: Ben Zhang <benzh@chromium.org>
Reviewed-by: Ben Zhang <benzh@chromium.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected CML Applies to Comet Lake platform HDA Applies to HD-Audio bus for codec connection P1 Blocker bugs or important features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants