Skip to content

[BUG] [BDW] IPC error on hw_params when buffer is too small #3503

@plbossart

Description

@plbossart

Describe the bug

On Broadwell Samus, the following command works fine

root@chrx:~# speaker-test -Dhw:0,0 -c2 -r48000 -FS32_LE -b 100000 -P2 -S5

speaker-test 1.2.2

Playback device is hw:0,0
Stream parameters are 48000Hz, S32_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 48 to 8184
Period size range from 24 to 2040
Requested buffer time 100000 us
Periods = 2
was set period_size = 1608
was set buffer_size = 4800
 0 - Front Left
^C 1 - Front Right
Time per period = 1.273407

Reducing the buffer size to a much smaller value creates unrecoverable IPC errors

root@chrx:~# speaker-test -Dhw:0,0 -c2 -r48000 -FS32_LE -b 10000 -P2 -S5

speaker-test 1.2.2

Playback device is hw:0,0
Stream parameters are 48000Hz, S32_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 48 to 8184
Period size range from 24 to 2040
Requested buffer time 10000 us
Periods = 2
Unable to set hw params for playback: Input/output error
Setting of hwparams failed: Input/output error
root@chrx:~# dmesg
[   61.194616] sof-audio-acpi INT3438:00: error: ipc error for 0x60010000 size 20
[   61.194621] sof-audio-acpi INT3438:00: error: hw params ipc failed for stream 0
[   61.194624] sof-audio-acpi INT3438:00: ASoC: error at snd_soc_pcm_component_hw_params on INT3438:00: -5
[   61.194627]  Low Latency: ASoC: hw_params FE failed -5
root@chrx:~# speaker-test -Dhw:0,0 -c2 -r48000 -FS32_LE -b 10000 -P2 -S5

speaker-test 1.2.2

Playback device is hw:0,0
Stream parameters are 48000Hz, S32_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 48 to 8184
Period size range from 24 to 2040
Requested buffer time 10000 us
Periods = 2
Unable to set hw params for playback: Device or resource busy
Setting of hwparams failed: Device or resource busy
root@chrx:~# ls

sof-logger trace

root@chrx:~# ./sof-logger -l sof-bdw.ldc 
         TIMESTAMP              DELTA C# COMPONENT          LOCATION                      CONTENT
[423296081.770833] (423296096.000000) c0 dma-trace             src/trace/dma-trace.c:327  ERROR FW ABI 0x3011000 DBG ABI 0x5002001 tag v1.5-rc1-756-g242be345ca9f src hash 0x0b028c9a (ldc hash 0x0b028c9a)
[1019902789.739583] (596606720.000000) c0 wait                         src/lib/wait.c:46   ERROR ewt
[1019902837.864583] (       48.125000) c0 ipc                ../ipc/ipc-host-ptable.c:126  ERROR ipc_get_page_descriptors(): dma_start() failed
[1019903013.489583] (      175.625000) c0 ipc                ../ipc/ipc-host-ptable.c:153  ERROR ipc: get descriptors failed -5
[1189245422.604167] (169342416.000000) c0 dw-dma                 src/drivers/dw/dma.c:283  ERROR dw_dma_start(): dma 1 channel 3 not ready ena 0x8 status 0x3
[1189245486.145833] (       63.541668) c0 ipc                ../ipc/ipc-host-ptable.c:126  ERROR ipc_get_page_descriptors(): dma_start() failed
[1189245661.770833] (      175.625000) c0 ipc                ../ipc/ipc-host-ptable.c:153  ERROR ipc: get descriptors failed -16

Full trace included
sof-logger.txt

To Reproduce

Install latest firmware and kernel and run command above

Reproduction Rate

100%

Expected behavior

Error flagged by kernel and/or recoverable IPC error

Impact

Showstopper

Environment

  1. Branch name and commit hash of the 2 repositories: sof (firmware/topology) and linux (kernel driver).
    • Kernel: 96b9d7cf347158efac3d830d9937e8efc39579c8
    • SOF: 242be34
  2. Name of the topology file
    • Topology: sof-bdw-rt5677.tplg
  3. Name of the platform(s) on which the bug is observed.
    • Platform: Broadwell

Screenshots or console output
If applicable, add a screenshot (drag-and-drop an image), or console logs
(cut-and-paste text and put a code fence (```) before and after, to help
explain the issue.

Please also include the relevant sections from the firmware log and kernel log in the report (and attach the full logs for complete reference). Kernel log is taken from dmesg and firmware log from sof-logger. See https://thesofproject.github.io/latest/developer_guides/debugability/logger/index.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    BDWBroadwellbugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions