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

investigate running multiple scsynth instances #417

Closed
catfact opened this issue Jun 9, 2018 · 2 comments
Closed

investigate running multiple scsynth instances #417

catfact opened this issue Jun 9, 2018 · 2 comments
Assignees

Comments

@catfact
Copy link
Collaborator

@catfact catfact commented Jun 9, 2018

scsynth's audio processing is single-threaded. so it runs on a single core.

when that thread uses ~60% or more CPU, we get audio glitches. they sound like xruns but might be something else - they aren't reported as xruns by jackd, but on the other hand running jack without -s seems to cause jack to crash occasionally when these artfiacts occur.

anyways, one weird idea i had is to run two instances of scsynth, connected with jack. call them the 'main' server and the 'aux' server. we would run aux and insert effects on the aux server, and Engines on the main server.

pros:

  • the servers can run on separate cores, basically doubling the CPU cycles available for engines (improve MLR sound quality) and for aux / insert effects (add EQ section or whatever.)

cons:

  • latency. adds either one buffer or two, depending on how jack implements inter-client connections. on the other hand might give us enough headroom to make the buffers smaller.
  • complexity. more process lifecycles to keep track of.

implementation issues

  • as far as i can tell, would need a utility like njconnect, or roll our own, to manage persistent jack client connections.
  • we'd need the the aux server to have 4 inputs (2 hardware ADC and 2 virtual), to accommodate routing like ADC->aux, main->aux , &c. it seems possible to invoke scsynth this way.
@catfact catfact added the enhancement label Jun 9, 2018
@catfact catfact self-assigned this Jun 9, 2018
@catfact catfact added the crone label Jun 9, 2018
@catfact catfact changed the title investigate running multiple scsynth isntances investigate running multiple scsynth instances Jun 10, 2018
@simonvanderveldt
Copy link
Member

@simonvanderveldt simonvanderveldt commented Jun 10, 2018

I think at least investigating this approach makes sense since we're currently unable to use a large part of the available CPU cycles. Another approach might be figuring out the issues (on ARM) with SuperCollider's supernova engine (which is multithreaded) and fix those.

when that thread uses ~60% or more CPU, we get audio glitches. they sound like xruns but might be something else - they aren't reported as xruns by jackd, but on the other hand running jack without -s seems to cause jack to crash occasionally when these artfiacts occur.

Especially the -s part seems to hint at the soundcard/driver being the issue. Maybe it's worth the time to investigate the ALSA driver code and see if there are obvious improvements that can be made there?

@catfact
Copy link
Collaborator Author

@catfact catfact commented Aug 4, 2018

supernova seems like a better solution and is working so far, closing this

@catfact catfact closed this Aug 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants