[mythtv-commits] Ticket #12827: Raspberry Pi: Digital Audio does not work
MythTV
noreply at mythtv.org
Wed Jul 27 14:25:10 UTC 2016
#12827: Raspberry Pi: Digital Audio does not work
----------------------------------+-----------------------------
Reporter: pbennett | Owner: pbennett
Type: Bug Report - General | Status: accepted
Priority: minor | Milestone: unknown
Component: Ports - rPi | Version: Master Head
Severity: medium | Resolution:
Keywords: | Ticket locked: 0
----------------------------------+-----------------------------
Comment (by pbennett):
Output of Dolby digital passthru audio to a surround sound system works
and gives sound, but the audio and video are jerky. This is because the
omx audio system seems to give incorrect and inconsistent values for audio
latency (i.e. amount of audio in the sound card that has not yet been
played). The result is that AVSync reports Video is behind audio (too
slow) for a few seconds and drops some frames to fix it, then reports that
Video is ahead of audio for a few seconds, and slows video down to
compensate. Thus the video is alternately speeded up and slowed down every
few seconds and the audio is paused and restarted every few seconds.
The audio latency values are incorrect only in the digital passthru case.
If playing digital stereo or analog, it works perfectly.
If I set very high values for MAXDIVERGE and DIVERGELIMIT so that AVSync
ignores the errors, the video plays very well. 5.1 channel Dolby Digital
audio is good, the surround sound receiver reports it as Dolby Digital.
The video is in good sync with the sound. However this is not a solution,
it will certainly get out of sync soon.
Options
1. Try to get some code that will estimate the latency based on amount of
data passed in and elapsed time. I am afraid this would also gradually get
worse over time. Also I am not sure how to handle pauses.
2. Try to minimize latency by passing data to audio only when it is
needed. This is difficult because audio is in a ring buffer before going
to the sound device and the ring buffer does not keep track of time codes.
3. Assume some fixed value for sound card latency all the time.
4. Average the sync calculation over 30, 75, 100, or 300 frames. Currently
it is averaged over 4 frames. This assumes that on average over time the
sound card latencies will be correct. I am afraid this may cause other
problems, for example when using softblend and displaying OSD the AVSync
has to compensate for the extra CPU load by dropping some frames. That
works well but will not work with the averaging calculation.
I am not sure how to proceed.
--
Ticket URL: <https://code.mythtv.org/trac/ticket/12827#comment:4>
MythTV <http://www.mythtv.org>
MythTV Media Center
More information about the mythtv-commits
mailing list