Opened 15 years ago
Closed 14 years ago
Last modified 14 years ago
#8500 closed patch (fixed)
more accurate audio timestamps
Reported by: | Mark Spieth | Owned by: | JYA |
---|---|---|---|
Priority: | minor | Milestone: | 0.24 |
Component: | MythTV - Audio Output | Version: | Master Head |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
with the inclusion of hdaudio, timestamps are not that accurate, and delay is not enough for various media like some dvb.
patch addresses
- 2.6 sec worst case delay, needed for 32 bit 6ch output.
- race condition in lockless audio timestamp calculation.
- guarantee int64 for various critical parameters in audio ts generation.
only tested with alsa so far.
Attachments (3)
Change History (10)
Changed 15 years ago by
Attachment: | accurate_audiots.patch added |
---|
Changed 15 years ago by
Attachment: | accurate_audiots.2.patch added |
---|
comment:1 Changed 15 years ago by
also existed a race when seeking and audio is reset. can cause 2 secs of old audio to be played before new audio. patch 2 fixes this too.
also see #7964
comment:2 Changed 15 years ago by
The whole concept of the lockless audio framework was that timecode would be calculated in one thread only, not two (read and write). It's the reason why SetAudioTime? was removed this patch breaks that, without having any of the required lock.
There is no need to increase the size of the audio buffer by a factor of 2, it will only cause seeking delays. Where does that requirement of 2.6s delay comes from?
yes, there is a "race" in audiotime calc, but the worst case error is negligible.
Will try to implement your timecode calculation cleanly and neatly soon.
comment:3 Changed 15 years ago by
understood. however the part that needs to be lockless is only modifying the ringbuffer pointers. the storage in the other process components is only modified in AddSamples?. Thus these latencies are static and can be excluded from the lockless component as they can be precalculated. This also makes GetAudiotime? faster as it doesnt have to include these latencies. audbuf_timecode becomes the top of the ringbuffer, not the latest timecode of the added audio data.
1.3-1.4 secs is marignal avsync delay for 6ch audio out. with the increase of bytes per sample to 4 (float32 due to processing enabled, upmix+timestretch), all that the increase does is maintain the worst case storage. it doesnt work properly otherwise. could go to a dynamic. the number is also that to make sure it is divisible by all the possible alternatives, including 8 ch out.
for smooth sync to work correctly, the race is very important.
comment:4 Changed 14 years ago by
patch 3 also with timecode wrap fix which happens for dvb timestamps.
comment:5 Changed 14 years ago by
Status: | new → assigned |
---|
comment:6 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:7 Changed 14 years ago by
Milestone: | unknown → 0.24 |
---|
with reset race fix