[PATCH] pcm: dmix: fix access to sum-buffer in non-interleaved mixing mode

Takashi Iwai tiwai at suse.de
Thu Aug 13 16:20:07 CEST 2020


On Wed, 12 Aug 2020 08:18:25 +0200,
Vijay Palaniswamy (RBEI/ECF3) wrote:
> 
> Hi All,
> 
> When dmix uses non-interleaved mixing mode the offset and step width to
> sum_buffer was calculated by using the dmix channels instead of the slave
> channels. This leads to audio distortions due to frame corruption.
> 
> Issue happens while doing channel wise mixing of src and destination buffers.
> 
> Attached the patch to fix the offset and step width calculation based on slave
> channels for sum buffer. So mixed data will be saved in respective channels of
> sum buffer.
> 
> Steps to reproduce the issue:
> 
> With below configuratio, Do aplay on both device in parallel for audio
> distortion
> 
> pcm.dmix_2_channels {
> 
>         type dmix
> 
>         ipc_key 5678293
> 
>         ipc_perm 0660
> 
>         ipc_gid audio
> 
>         bindings [0 1]
> 
>         slave {
> 
>                 pcm "hardware"
> 
>                 channels 2
> 
>                 periods  4
> 
>                 period_time 40000
> 
>         }
> 
> }
> 
> pcm.dmix_1_channels {
> 
>         type dmix
> 
>         ipc_key 5678293
> 
>         ipc_perm 0660
> 
>         ipc_gid audio
> 
>         bindings [0]
> 
>         slave {
> 
>                 pcm "hardware"
> 
>                 channels 1
> 
>                 periods  4
> 
>                 period_time 40000
> 
>         }
> 
> }
> 
> pcm.hardware {
> 
>         type hw
> 
>         card 0
> 
>         channels 2
> 
>         rate 48000
> 
>         format S16_LE
> 
> }
> 
> Best regards
> 
> Palaniswamy Vijay

Applied now.  Thanks.


Takashi


More information about the Alsa-devel mailing list