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

Enable real time scheduling (ALSA) #54

Open
cklosters opened this issue Sep 24, 2024 · 2 comments
Open

Enable real time scheduling (ALSA) #54

cklosters opened this issue Sep 24, 2024 · 2 comments
Assignees
Labels
audio Audio related Questions & Issues enhancement New feature or request

Comments

@cklosters
Copy link
Member

When going over the ALSA docs for portaudio I noticed you have to explicitly enable real time scheduling:

Of particular importance is PaAlsa_EnableRealtimeScheduling, which allows ALSA to run at a high priority to prevent ordinary processes on the system from preempting audio playback. Without this, low latency audio playback will be irregular and will contain frequent drop-outs. If this is turned on by the stream is started, the audio callback thread will be created with the FIFO scheduling policy, which is suitable for realtime operation.

We should turn it on, because it's (implicitly?) enabled on all other platforms according to @stijnvanbeek - resulting in less frequent drop-outs, although me personally have not noticed any.

@cklosters cklosters added enhancement New feature or request audio Audio related Questions & Issues labels Sep 24, 2024
@lshoek
Copy link
Contributor

lshoek commented Sep 24, 2024

I did actually notice lots of stutter yesterday when running the audiovisual demo (PR) in Release on Ubuntu 22 with audio playback routed to the front output of my system. I will try to see if this makes any difference on my end.

@cklosters
Copy link
Member Author

cklosters commented Sep 24, 2024

I did actually notice lots of stutter yesterday when running the audiovisual demo (PR) in Release on Ubuntu 22 with audio playback routed to the front output of my system. I will try to see if this makes any difference on my end.

Ok, sounds good. To avoid any confusion: I removed libjack as a dependency for the release of 0.7.5 because it's not default (installed) with Ubuntu 24.04. I don't think that's what you used in the past (default often isn't jack) but good to know. Also: You might want to use a Low-Latency Kernel (Ubuntu Studio). and benchmark with and without the PaAlsa_EnableRealtimeScheduling enabled.

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

No branches or pull requests

3 participants