Skip to content

Add PortAudio non-blocking stream support #31

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kareandersen
Copy link
Contributor

@kareandersen kareandersen commented Apr 7, 2025

  • Supports non-blocking (callback based) streams
  • Still supports blocking io
  • Now we can suspend/resume properly on Linux in the text-mode player, restart the tune etc. without issues (tested to the best of my ability)
  • WIP on tweaking the latency

@kareandersen
Copy link
Contributor Author

kareandersen commented Apr 10, 2025

Ok, let's see if we can tweak the latency for both non-blocking and blocking scenarios. It may not be possible to make a "perfect" solution for all systems, instead it may be an idea to let the user override the latency (perhaps even interactively in the text-mode player).

I just had a quick read through at the BufferingLatencyAndTimingImplementationGuidelines wiki page and found it to be a very well written and informative wall of text.

The current code is simply accepting the value provided for the default device's defaultLowOutputLatency, which may be ok - but I have not yet had a look at what the actual value provided is and if it is indeed based on buffer length or other factors. What I have noticed is that I can sometimes get glitches with the ALSA backend (possibly due to a configuration issue on the host machine) but not on PortAudio (which could also be explained by the relatively huge buffer I set up).

I'll poke around a bit and see what's up on multiple systems while digging into the documentation.

Edit: Let's keep this in the scope here too: Latency rationale documentation commit

@kareandersen kareandersen marked this pull request as draft April 10, 2025 08:57
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

Successfully merging this pull request may close these issues.

1 participant