[mythtv-users] Audio Video Sync on v31 and Alsa Buffer Size

Tim Pletcher pletchtd at gmail.com
Sun Jun 7 17:06:19 UTC 2020

Hi Stephen,

Thank you for working on this and sharing your script. I have also
concluded this is not an easy problem to address in an automated fashion.

7.1 channel TrueHD source material requires 1536 KB alsa buffer to hold 500
ms so I don't think there should be too much need to set it to a higher
value than this. I also question why so many ALSA drivers use such small
default values here if there is no drawback to setting it higher.  One
other complicating factor is that not all ALSA drivers allow for values as
high as even 1536 as the prealloc_max value can differ.  For example, RPi 3
that I just checked has a prealloc_max value of 128 KB.  I suppose any
requested value in a script should probably be sanity checked against the
prealloc_max limit and warn the user if it can't be set to an optimal value.

Searching on this topic seems to suggest prealloc tuning is somewhat unique
to MythTV and most other media software doesn't require this. Speculating
here but it seems as if either the frequency of the loop draining the alsa
buffer in Mythtv is limiting or there is some other way to set the required
DMA buffer within an application.  Unfortunately, I don't have the skillset
to efficiently dig into this too far and could very well be totally off
base in why alsa buffer optimization is more critical for MythTV.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20200607/1d8d47e8/attachment.htm>

More information about the mythtv-users mailing list