mbox series

[v2,0/5] ASoC: q6apm: fix under runs and fragment sizes

Message ID 20250220162847.11994-1-srinivas.kandagatla@linaro.org (mailing list archive)
Headers show
Series ASoC: q6apm: fix under runs and fragment sizes | expand

Message

Srinivas Kandagatla Feb. 20, 2025, 4:28 p.m. UTC
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

On Qualcomm Audioreach setup, some of the audio artifacts are seen in
both recording and playback. These patches fix issues by
1. Adjusting the fragment size that dsp can service.
2. schedule available playback buffers in time for dsp to not hit under runs 
3. remove some of the manual calculations done to get hardware pointer.

With these patches, am able to see Audio quality improvements.

Any testing would be appreciated.

thanks,
Srini

Changes since v1:
	- added new patches to fix the fragment size, pointer
	  calculations
	- updated to schedule only available buffers.

Srinivas Kandagatla (4):
  ASoC: q6apm-dai: schedule all available frames to avoid dsp under-runs
  ASoC: q6apm: add q6apm_get_hw_pointer helper
  ASoC: q6apm-dai: make use of q6apm_get_hw_pointer
  ASoC: qdsp6: q6apm-dai: set correct period size
  ASoC: q6apm-dai: remove redundant hw_constraints setup

 sound/soc/qcom/qdsp6/q6apm-dai.c | 94 +++++++++++++-------------------
 sound/soc/qcom/qdsp6/q6apm.c     | 18 +++++-
 sound/soc/qcom/qdsp6/q6apm.h     |  3 +
 3 files changed, 57 insertions(+), 58 deletions(-)

Comments

Johan Hovold Feb. 20, 2025, 5:38 p.m. UTC | #1
Hi Srini,

On Thu, Feb 20, 2025 at 04:28:42PM +0000, Srinivas Kandagatla wrote:

> On Qualcomm Audioreach setup, some of the audio artifacts are seen in
> both recording and playback. These patches fix issues by
> 1. Adjusting the fragment size that dsp can service.
> 2. schedule available playback buffers in time for dsp to not hit under runs 
> 3. remove some of the manual calculations done to get hardware pointer.
> 
> With these patches, am able to see Audio quality improvements.
> 
> Any testing would be appreciated.

With this series, the choppy (robotic) capture when using pipewire
appears to be fixed (pulseaudio worked before).

Playback is still choppy (heavily distorted), though, and now it also
appears to be too slow.

I tested using pw-record and pw-play (and mpv) on the T14s (6.14-rc3).

Johan
Srinivas Kandagatla Feb. 20, 2025, 5:44 p.m. UTC | #2
Hi Johan,
thanks for testing.
On 20/02/2025 17:38, Johan Hovold wrote:
> Hi Srini,
> 
> On Thu, Feb 20, 2025 at 04:28:42PM +0000, Srinivas Kandagatla wrote:
> 
>> On Qualcomm Audioreach setup, some of the audio artifacts are seen in
>> both recording and playback. These patches fix issues by
>> 1. Adjusting the fragment size that dsp can service.
>> 2. schedule available playback buffers in time for dsp to not hit under runs
>> 3. remove some of the manual calculations done to get hardware pointer.
>>
>> With these patches, am able to see Audio quality improvements.
>>
>> Any testing would be appreciated.
> 
> With this series, the choppy (robotic) capture when using pipewire
> appears to be fixed (pulseaudio worked before).
> 

> Playback is still choppy (heavily distorted), though, and now it also
> appears to be too slow.

Interesting, Am running 6.14-rc2 aswell on t14
Both pw-play and youtube, it seems to be fine.
Let me check my pipewire config if I had disabled the tsched.



--srini

> 
> I tested using pw-record and pw-play (and mpv) on the T14s (6.14-rc3).
> 
> Johan
Johan Hovold Feb. 21, 2025, 8:29 a.m. UTC | #3
On Thu, Feb 20, 2025 at 06:38:11PM +0100, Johan Hovold wrote:
> On Thu, Feb 20, 2025 at 04:28:42PM +0000, Srinivas Kandagatla wrote:

> > On Qualcomm Audioreach setup, some of the audio artifacts are seen in
> > both recording and playback. These patches fix issues by
> > 1. Adjusting the fragment size that dsp can service.
> > 2. schedule available playback buffers in time for dsp to not hit under runs 
> > 3. remove some of the manual calculations done to get hardware pointer.
> > 
> > With these patches, am able to see Audio quality improvements.
> > 
> > Any testing would be appreciated.
> 
> With this series, the choppy (robotic) capture when using pipewire
> appears to be fixed (pulseaudio worked before).
> 
> Playback is still choppy (heavily distorted), though, and now it also
> appears to be too slow.
> 
> I tested using pw-record and pw-play (and mpv) on the T14s (6.14-rc3).

Retested this morning and realised that playback is only choppy (and too
slow) while I have pavucontrol open. That would be nice to fix if
possible, but this is still a great improvement since pipewire was not
usable at all before these changes.

Tested-by: Johan Hovold <johan+linaro@kernel.org>

Johan
Johan Hovold Feb. 21, 2025, 8:59 a.m. UTC | #4
On Fri, Feb 21, 2025 at 09:29:39AM +0100, Johan Hovold wrote:
> On Thu, Feb 20, 2025 at 06:38:11PM +0100, Johan Hovold wrote:
> > On Thu, Feb 20, 2025 at 04:28:42PM +0000, Srinivas Kandagatla wrote:
> 
> > > On Qualcomm Audioreach setup, some of the audio artifacts are seen in
> > > both recording and playback. These patches fix issues by
> > > 1. Adjusting the fragment size that dsp can service.
> > > 2. schedule available playback buffers in time for dsp to not hit under runs 
> > > 3. remove some of the manual calculations done to get hardware pointer.
> > > 
> > > With these patches, am able to see Audio quality improvements.
> > > 
> > > Any testing would be appreciated.
> > 
> > With this series, the choppy (robotic) capture when using pipewire
> > appears to be fixed (pulseaudio worked before).
> > 
> > Playback is still choppy (heavily distorted), though, and now it also
> > appears to be too slow.
> > 
> > I tested using pw-record and pw-play (and mpv) on the T14s (6.14-rc3).
> 
> Retested this morning and realised that playback is only choppy (and too
> slow) while I have pavucontrol open. That would be nice to fix if
> possible, but this is still a great improvement since pipewire was not
> usable at all before these changes.
> 
> Tested-by: Johan Hovold <johan+linaro@kernel.org>

Hmm... Scratch that.

This series apparently breaks pulseaudio instead.

Too fast playback on the T14s with mpv, and after I stopped it I wasn't
able too play any audio anymore. And systemd complains about a stop job
running for long when rebooting. Similar issues on the X13s.

Johan
Srinivas Kandagatla Feb. 21, 2025, 10:15 a.m. UTC | #5
On 21/02/2025 08:59, Johan Hovold wrote:
> On Fri, Feb 21, 2025 at 09:29:39AM +0100, Johan Hovold wrote:
>> On Thu, Feb 20, 2025 at 06:38:11PM +0100, Johan Hovold wrote:
>>> On Thu, Feb 20, 2025 at 04:28:42PM +0000, Srinivas Kandagatla wrote:
>>
>>>> On Qualcomm Audioreach setup, some of the audio artifacts are seen in
>>>> both recording and playback. These patches fix issues by
>>>> 1. Adjusting the fragment size that dsp can service.
>>>> 2. schedule available playback buffers in time for dsp to not hit under runs
>>>> 3. remove some of the manual calculations done to get hardware pointer.
>>>>
>>>> With these patches, am able to see Audio quality improvements.
>>>>
>>>> Any testing would be appreciated.
>>>
>>> With this series, the choppy (robotic) capture when using pipewire
>>> appears to be fixed (pulseaudio worked before).
>>>
>>> Playback is still choppy (heavily distorted), though, and now it also
>>> appears to be too slow.
>>>
>>> I tested using pw-record and pw-play (and mpv) on the T14s (6.14-rc3).
>>
>> Retested this morning and realised that playback is only choppy (and too
>> slow) while I have pavucontrol open. That would be nice to fix if
>> possible, but this is still a great improvement since pipewire was not
>> usable at all before these changes.
>>
>> Tested-by: Johan Hovold <johan+linaro@kernel.org>
> 
> Hmm... Scratch that.
> 
> This series apparently breaks pulseaudio instead.
> 
Thanks for trying out pulseaudio, I will try to reproduce this with my t14.
--srini
> Too fast playback on the T14s with mpv, and after I stopped it I wasn't
> able too play any audio anymore. And systemd complains about a stop job
> running for long when rebooting. Similar issues on the X13s.
> 
> Johan