OSDN Git Service

pcm: dmix: fix access to sum-buffer in non-interleaved mixing mode
authorVijay Palaniswamy <vijay.palaniswamy@in.bosch.com>
Thu, 23 Jul 2020 06:19:10 +0000 (11:49 +0530)
committerTakashi Iwai <tiwai@suse.de>
Thu, 13 Aug 2020 14:19:30 +0000 (16:19 +0200)
commit82cb27c165d4337fe3183668bd0fa21ff6287e8e
treedeb999568d08012a026645f81a62995e719af7b9
parent464c2f8b61855cb22d61c4b232f74d6767fac5fb
pcm: dmix: fix access to sum-buffer in non-interleaved mixing mode

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.

example:
- 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
}

Signed-off-by: Vijay Palaniswamy <vijay.palaniswamy@in.bosch.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/pcm/pcm_dmix.c