On 26 Jan 2005, at 2:14 PM, Chris Birkinshaw wrote:
I need to route audio
accross a dedicated network using jack.udp to an audio only PC. This will
introduce some extra delay - the send and receive buffers for jack.udp and the
1024 samples delay in my brutefir setup - so I need a way to delay the video
Myth already compensates for some audio delay (most sound cards buffer at least half a second), so what you need to do is have this mechanism calculate the delay based on your entire setup. Since the drivers request buffering information from the audio output layer, the correct approach is to make sure jack returns an answer based on what's actually playing from the second PC. Since I know nothing about jack or brutefir, I have no idea if that's technically possible.
Failing that, it would be fairly straightforward to modify audiooutputbase.cpp to add a fixed number when it calculates the number of buffered bytes on the sound card, which would give you what you're asking for. Your latency would have to be extremely consistent for the audio to remain in sync with the video; if you're entering a fixed number guess, I'm not sure that this will be the case.
Usually the timing on the sound card is not identical to what Myth expects, so without the real timing information from the final sound card, you'd get further out of sync as time goes on, until the sound card is either starved for data or runs out of buffer space as it's far behind the video.
Have you tried this setup in practice now, to see what results you get? Can you hook this up and play a 30 or 60 minute program without interruption? I'd be curious to hear what happens, if you're always off by 1 second or whatever throughout, or if it drifts (either falls behind, or stutters as it gets ahead of the sent stream). If it's the latter, then changing Myth's code won't help you.
- Jeremiah
_______________________________________________ mythtv-dev mailing list [email protected] http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
