Decklink: Use frame scheduling API to fix output audio drift#1865
Decklink: Use frame scheduling API to fix output audio drift#1865DDRBoxman wants to merge 2 commits intoobsproject:masterfrom
Conversation
|
How bad is the drift without the fix? |
|
I'm having some pretty bad drift/desync on a 24/7 system using a declink output to a channel injection system. I've seen desync as high as 600msec after a few days of obs uptime. I hope this isnt dead. |
|
Does this still require more extensive testing? I don't have or use decklink hardware, so it would be welcome to hear from people who do. |
|
I haven't tested it yet, Last time I tried it was still drifting so I'm sticking with my external ffmpeg to decklink method for now |
|
@PatTheMav AFAIK last time I tested it it had some pretty bad desync issues too. |
|
I tested how the |
|
If further reduction of jitter is required, I'd like to propose a lag lead filter. I've created two filter implementations to for the feedback of the clock drift to
I'd like to provide figures how the buffer amount, the drift, and
|
|
I think I definitely like the simplicity of the proportional filter a lot. The only thing I notice is that it appears to be writing new offsets to the card very often, which somewhat worries me as we don't know whether writing new configuration values correlates to wear of the card's storage. That was the main focus behind my method, though my method definitely has flaws worth fixing. Do you think it would be possible in a simple manner to apply the filter more aggressively while drift is still above a certain deviation? I also see that the average value is ignored. Perhaps it would be good to begin using the average value once drift has settled to a sustainable amount? |
Do you have a chance to ask Blackmagickdesign?
I was thinking to drop the moving-average instance. If keeping it, it might be worth to try always use it. Btw, |
|
The implementation of proportional filter is revised 59bcf19, which is at my branch.
|
|
Tested your method on my end, and indeed it works very well. Not understanding why it always sits at ~-200us of drift, but at least it's steady and not really notable. |
Use frame scheduling API to fix output audio drift Co-authored-by: DDRBoxman <colin@recursivepenguin.com> Co-authored-by: tt2468 <tt2468@gmail.com>
Use frame scheduling API to fix output audio drift
|
@norihiro, @tt2468, @DDRBoxman so what is the state of this? The adjusted proportional filter seems to work well from the feedback I read (it looks like it uses slight adjustments to slowly oscillate in on a good clock alignment). |
|
Last call for this PR - it's over 6 years old by this point, is in draft stage, heavily outdated and my last CTA from 2023 went unanswered. If I don't see any further progress here I'll close it next week. |
|
As discussed above, my proposal should work fine. However, are there a demand to fix this issue? If so, I may create another PR but I guess no many users are waiting. IMO, just closing this PR should be fine. |
|
I currently have my workaround with a local instance of FFMPEG connecting to the RTMP server that OBS is streaming to, but I am waiting for a fix still. This is for a slide show machine that outputs to a tv channel insertion box over composite. |
Then I'd suggest opening a new PR with the proportional filter - from the limited domain knowledge I have and based on @tt2468's comment it seems to achieve the stability that people are looking for. |




This code uses the deckling scheduling API to use frame / audio timestamps to make sure that audio / video don't drift apart. This also add in clock drift compensation for this API.
This needs more testing but seemed to be successful with a 24 hour stream on my end.