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

AudioSync Realtime Smoothing? #214

Open
jdtsmith opened this issue Jan 12, 2025 · 0 comments
Open

AudioSync Realtime Smoothing? #214

jdtsmith opened this issue Jan 12, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@jdtsmith
Copy link

jdtsmith commented Jan 12, 2025

From this discussion it was noted that there are a few problems with network AudioSync generation and transmission:

latency - our audio processing code needs a continuous data stream from the audio source. Any gap, network hickup, or out-of-order packet will be visible as random noise in led effects
network latency - we found that the wifi protocol sometimes delivers a bunch of UDP packets in bursts, with 100ms (up to 250ms) between bursts. This would be a major problem when directly transmitting audio samples.

For network (non-mic) sources of AudioSync packets (e.g. from PC or other packet generator), we had discussed on Discord some years back adapting my old RealTime smoothing algorithm to treat AudioSync packets instead of the realtime pixel stream. See the notes for all the details.

The approach would be:

  1. Configure your audio playback to be "behind" the stream by a tunable amount, based on average network latency (say 50-200ms).
  2. Update the audio reactive code to use a small ring buffer to "play back" those 44 byte packets at regular cadence (cost: being slightly delayed half the average ring-buffer size). 5 or 6 frame depth is usually fine.

The latter is already quite well tuned and was working very well for the realtime protocol. Audio sync packet sizes are even smaller, so the ring buffer should be pretty trivial.

How complicated do you think it would be to adapt this into audio_reactive.h.

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

No branches or pull requests

1 participant