• Koro Chen's avatar
    ASoC: mediatek: Increase periods_min in capture · e4fba9b5
    Koro Chen authored
    In capture, there is chance that hw_ptr reported at IRQ is
    a little smaller than period_size due to internal AFE buffer.
    In the case of ping-pong buffer:
    
    |xxxxxxxxxxxxxxxxxxxxxxxxxxxx--|-----------------------------|
                                hw_ptr < period_size
    
    This available buffer will not be read since its size is smaller than
    avail_min (which is period_size by default), and read thread continues
    to sleep. If the next hw_ptr is just a little larger than buffer_size,
    overrun occurs. One more period can hold the possible unread buffer.
    Signed-off-by: default avatarKoro Chen <koro.chen@mediatek.com>
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    e4fba9b5
mtk-afe-pcm.c 34.6 KB