Repository navigation
Description
The firmware currently does not support change of EQ configuration during streaming so it returns -EBUSY error if the configuration cannot be changed immediately. The change of response should happen with next playback start without errors.
It's not clear that this is a driver issue. While the switch capability is not yet implemented in EQ the choice what is done in this situation could be different. Eventually the FW will have capability for on-the-fly reconfiguration, at least when the needed allocation sizes for configuration data and filter delay lines is equal or smaller than previous configuration.
But since it creates a fail in the current shape it must be treated as bug in driver and/or FW.
The sequence to this error is to start playback in one window with aplay. Then immediately in other window do command:
$ amixer controls | grep EQ
numid=23,iface=MIXER,name='EQFIR1.0 EQFIR'
numid=22,iface=MIXER,name='EQIIR1.0 EQIIR'
$ sof-eqctl -n 22 -s eq_iir_bassboost.txt
Control size is 304.
Applying configuration "eq_iir_bassboost.txt" into device hw:0 control numid=22.
4607827,0,116,50331648,0,0,0,0,116,2,1,0,0,0,0,0,0,2,2,0,0,0,0,3227172081,2141520527,536653443,3221660410,536653443,0,16384,3260252783,2107733822,161646111,3961037800,172645501,4294967294,27910
Success.
The command appears to pass but after next playback attempt dmesg shows this
[63012.786246] sof-audio-pci 0000:00:0e.0: ipc tx: 0x60010000: GLB_STREAM_MSG: PCM_PARAMS
[63012.786513] sof-audio-pci 0000:00:0e.0: ipc tx succeeded: 0x60010000: GLB_STREAM_MSG: PCM_PARAMS
[63012.800463] sof-audio-pci 0000:00:0e.0: pcm: trigger stream 0 dir 0 cmd 1
[63012.800475] sof-audio-pci 0000:00:0e.0: ipc tx: 0x60040000: GLB_STREAM_MSG: TRIG_START
[63012.800735] sof-audio-pci 0000:00:0e.0: ipc tx succeeded: 0x60040000: GLB_STREAM_MSG: TRIG_START
[63013.769847] sof-audio-pci 0000:00:0e.0: ipc rx: 0x90020000: GLB_TRACE_MSG
[63013.769861] sof-audio-pci 0000:00:0e.0: ipc rx done: 0x90020000: GLB_TRACE_MSG
[63022.640975] sof-audio-pci 0000:00:0e.0: ipc tx: 0x50030000: GLB_COMP_MSG: SET_VALUE: SET_DATA
[63022.641159] sof-audio-pci 0000:00:0e.0: error: ipc error for 0x50030000 size 240
[63022.641167] sof-audio-pci 0000:00:0e.0: error: set/get ctrl ipc comp 0
In firmware trace it looks like the re-sent binary command to FIR becomes corrupt and fails the ABI check. The configuration was sent to IIR.
0 2 IPC 47998.958333 65.677086 /home/singalsu/work/current/sof/sof/src/ipc/handler.c:865 ipc: hdr 0x50030000 tx (180) > rx (92)
0 2 IPC 48002.447917 3.489583 /home/singalsu/work/current/sof/sof/src/ipc/handler.c:867 ipc: comp 3 -> cmd 3
0 2 EQ_FIR 48007.083333 4.635417 /home/singalsu/work/current/sof/sof/src/audio/eq_fir.c:614 eq_fir_cmd()
0 2 EQ_FIR 48009.947917 2.864583 /home/singalsu/work/current/sof/sof/src/audio/eq_fir.c:561 fir_cmd_set_data(), SOF_CTRL_CMD_BINARY
0 2 EQ_FIR 48014.166667 4.218750 /home/singalsu/work/current/sof/sof/src/audio/eq_fir.c:581 fir_cmd_set_data(): blob size: 56
0 2 IPC 48108.541667 94.375000 /home/singalsu/work/current/sof/sof/src/ipc/handler.c:865 ipc: hdr 0x50030000 tx (125) > rx (92)
0 2 IPC 48111.666667 3.125000 /home/singalsu/work/current/sof/sof/src/ipc/handler.c:867 ipc: comp 2 -> cmd 3
0 1 COMP 48115.937500 4.270833 /home/singalsu/work/current/sof/sof/src/include/sof/audio/component.h:424 comp_cmd() error: invalid version, data->magic = 0, data->abi = 65536
Activity
singalsu commentedon Mar 27, 2019
@cujomalainey @juimonen @ranj063 I've now entered this issue that I briefly described in email.
cujomalainey commentedon Mar 28, 2019
Is there a case where we could change config in the middle of playback? I'm thinking for someone running tuning tools, this way they could make changes without having to constantly restart playback.
singalsu commentedon Mar 29, 2019
Yep that would be one case. Also if there's an audio server it likely also extends the playback to be continuous from ALSA point of view over successive music tracks.
singalsu commentedon Apr 23, 2019
I'm starting with this now.
Edit: I worked with volume overflow instead. So far only confirmed exactly this same happens. The driver is busy not handled properly by kernel.
singalsu commentedon Apr 29, 2019
This quick fix shows that the DSP response with -EBUSY corrupts the PM cache. If we omit this copy the next playback starts with new EQ configuration.
However I think it's better to instead in snd_sof_bytes_ext_put() to copy the data from userspace into a temporary buffer, send it, and copy to cache only if IPC was successful. Thanks for help @kv2019i !
singalsu commentedon Jun 14, 2019
ETA to continue fixing this is end of June after my vacation. I need to change the approach because of fundamental changes done into control.c in SOF kernel.
singalsu commentedon Jan 13, 2020
The PRs to avoid this are under review in SOF.
singalsu commentedon Jan 14, 2020
Merge of SOF PRs thesofproject/sof#2259 and thesofproject/sof#2065 fix this issue on FW side. Due to new scontrols caching for power management the fix on Linux kernel side would have been much more complex.
singalsu commentedon Jan 14, 2020
It's now OK to close this issue!