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

Vijay Palaniswamy (RBEI/ECF3) Vijay.Palaniswamy at in.bosch.com
Wed Aug 12 08:18:25 CEST 2020


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-pcm-dmix-fix-access-to-sum-buffer-in-non-interleaved.patch
Type: application/octet-stream
Size: 2684 bytes
Desc: 0001-pcm-dmix-fix-access-to-sum-buffer-in-non-interleaved.patch
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20200812/079969cf/attachment.obj>


More information about the Alsa-devel mailing list