Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nice solid work :-) #1

Open
jorgenkraghjakobsen opened this issue Feb 15, 2021 · 3 comments
Open

Nice solid work :-) #1

jorgenkraghjakobsen opened this issue Feb 15, 2021 · 3 comments

Comments

@jorgenkraghjakobsen
Copy link

jorgenkraghjakobsen commented Feb 15, 2021

I cannot figure out how to implement the sync concept in the ADF pipe line framework. My only suggesting would be a dynamic pipeline buffer element that will delay output according to playback delay set from snapserver.
Still an snap client audio source in the ADF with simple sync model will be of grate value.
There are lots of WIP pase on from my imp. but let gets solved on the way. /J

@douardda
Copy link
Owner

thx. Same, not sure how could the latency be managed and got the same idea of an audio buffer element handling the (re)synchronization task. But I've not started working on this idea yet. TBH, I still don't really understand how the latency control works and how to implement it properly to gain synchronous snapclients. I need to study more your implementation as well as the upstream snapclient one to try to figure it.

@miLORD1337
Copy link

Maybe estimate how fast/slow the frames should be played to reach sync within a set timeframe and then interpolate between frames to reach the estimated playback speed would work? This could of course lead to dropped frames if playback speed has to be fast...

@CarlosDerSeher
Copy link

I did a lot of testing and tried lots of things and came to the conclusion that it is impossible to get good syncing using ADF pipelines. There is just too much unknown and unpredictable processing delay. Also how IDF's i2s driver works is problematic in my opinion. You can't fill DMA buffers before starting transmission, so there will always be the delay of the full DMA length because i2s interrupt will just give you a DMA descriptor after it finished transmission. This probably could be worked around though because DMA buffers size is fixed and delay therefore known, using zero_dma() function and i2s_sop() this could be predictable set. Still I found it impossible to get exact sync using pipelines, even getting repeatable sync points was impossible. For some reason this was always deviating to some amount. I dropped ADF completely except board init parts which I add as custom components, also i modified I2S driver to get perfect syncing.

How is work going on your end regarding this issue? It still would be nice to get this work with an unmodified SDK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants