ASoc / PCM recording-related regression between v5.4 and v5.5

Hin-Tak Leung htl10 at users.sourceforge.net
Tue Apr 20 16:19:58 CEST 2021


 Kuninori Morimoto: Apologies - I have finished bisecting, and flip the problematic commit back and forth twice to confirm. It is not one of yours! Sorry about that.

Hi Peter:

I found the commit of a rather unusual regression between kernel v5.4 and v5.5, for an out-of-tree driver on the raspberrypi. Everything looks identical between v5.4 and 5.5, within accountable differences, even with debugging in sound/ +p and the driver side. 5.4 records fine, 5.5 stucks on recording. The commit is one of yours:

commit 4378f1fbe924054a09ff0d4e39e1a581b9245252
Author: Peter Ujfalusi <peter.ujfalusi at ti.com>
Date: Fri Sep 27 10:16:46 2019 +0300

 ASoC: soc-pcm: Use different sequence for start/stop trigger
 
 On stream stop currently we stop the DMA first followed by the CPU DAI.
 This can cause underflow (playback) or overflow (capture) on the DAI side
 as the DMA is no longer feeding data while the DAI is still active.
 It can be observed easily if the DAI side does not have FIFO (or it is
 disabled) to survive the time while the DMA is stopped, but still can
 happen on relatively slow CPUs when relatively high sampling rate is used:
 the FIFO is drained between the time the DMA is stopped and the DAI is
 stopped.

 The problem was initially at https://github.com/respeaker/seeed-voicecard/issues/290 
then over to https://github.com/raspberrypi/linux/issues/4279 and finally here. The "seeed-8mic-voicecard-overlay.dts" is the dts corresponds to the problematic device ; The one with similar hardware but okay is "seeed-4mic-voicecard-overlay.dts" .

The Raspberry Pi distribution raspbian jumped directly from 5.4.x to 5.10.x at the beginning of February. Considering the change has been in since the v5.5 merge window, I guess I'd like some help to correct / workaround on the out-of-tree driver side? And probably some new dev_err() message in the kernel for problematic driver helping to diagnose similar problems in the future would be nice. 

And everybody: apologies about the mistakes in the initial posting.

Regards
Hin-Tak
  


More information about the Alsa-devel mailing list