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

Output latency with Jack backend doesn't seem to work #294

Open
b-ma opened this issue Jun 19, 2023 · 3 comments
Open

Output latency with Jack backend doesn't seem to work #294

b-ma opened this issue Jun 19, 2023 · 3 comments

Comments

@b-ma
Copy link
Collaborator

b-ma commented Jun 19, 2023

see #293

@orottier
Copy link
Owner

The change in #293 works around timestamp.playback.duration_since(&timestamp.callback) returning None.
Checking https://docs.rs/cpal/latest/cpal/struct.StreamInstant.html this can only happen when callback is later than playback (docs: https://docs.rs/cpal/latest/cpal/struct.OutputStreamTimestamp.html ). Which is indeed puzzling and requires some further investigation of cpal+jack

@uklotzde
Copy link
Contributor

uklotzde commented Jun 19, 2023

The playback timestamp is not updated and falls behind the callback timestamp on the second invocation:

[2023-06-19T11:10:26Z INFO  web_audio_api::io::cpal] Output device: Ok("cpal_client_out")
[2023-06-19T11:10:26Z DEBUG web_audio_api::io::cpal] Attempt output stream with prefered config: StreamConfig { channels: 2, sample_rate: SampleRate(48000), buffer_size: Fixed(1024) }
[2023-06-19T11:10:26Z DEBUG web_audio_api::io::cpal] Determining output latency for callback OutputCallbackInfo { timestamp: OutputStreamTimestamp { callback: StreamInstant { secs: 5929, nanos: 915391332 }, playback: StreamInstant { secs: 5929, nanos: 936641333 } } }
[2023-06-19T11:10:26Z DEBUG web_audio_api::io::cpal] Output stream set up successfully
stereo
[2023-06-19T11:10:27Z DEBUG web_audio_api::io::cpal] Determining output latency for callback OutputCallbackInfo { timestamp: OutputStreamTimestamp { callback: StreamInstant { secs: 5930, nanos: 455891332 }, playback: StreamInstant { secs: 5929, nanos: 936641333 } } }
thread '<unnamed>' panicked at 'assertion failed: timestamp.callback <= timestamp.playback', src/io/cpal.rs:429:5

@orottier
Copy link
Owner

Probably best to report it to cpal then.
There's similar (but different) shenanigans happening for ALSA timestamps: RustAudio/cpal#710

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

3 participants