Topic: Linux version: JACK auto-connect

Worked on my dedicated Pianoteq linux box this weekend.  I'm trying to get it to suspend or hibernate smoothly, with minimal startup time, so that it could eventually function without any user-interaction. (ie no monitor and keyboard sitting on my piano)

While I'm still trying to get jackd to restart after coming out of suspend (or qjackctl to do the restarting) I noticed something about Pianoteq as well.  Once jackd is running again, Pianoteq still does not play.  Going to the options, it shows JACK as the audio output, but the other settings are blank, meaning it's not connected to jackd.  It is set to auto-detect or auto-connect (I forget the exact wording and I'm not at that computer right now) but it doesn't seem to auto-connect right away.

Could you maybe increase the JACK auto-connect attempt frequency when it's disconnected?  Once I figure out how to get JACK to restart after resuming, this will be the only obstacle.

Obviously, the simple solution is to not suspend the machine, but since it's single-purpose, and since I don't play on it all hours of the day and night, and since my electric bill is already high enough, I would like for it to be able to suspend itself.  And suspending/resuming would certainly be faster than shutting down and starting up.  I also haven't figured out how to get jackd and Pianoteq running automatically after boot-up with no interaction, so suspending seems like my optimal solution.

Actually, what would be perfect for stand-alone linux machines (poor-man's VSTi host, v-machine, etc.) would be some kind of server/daemon mode.  Maybe it could start its own jackd instance if one isn't running already.

Re: Linux version: JACK auto-connect

you mean jackd is killed before suspend, and then relaunched when resuming ? The current pianoteq version does not try to reconnect after jackd has been shutdown, but yes that's something we could try to do.

Did you try to use alsa instead ? If you are not using any other jack client, the alsa backend may be convenient.

Re: Linux version: JACK auto-connect

That's true, ALSA would work for a standalone machine.  I've just been so used to the idea of running it with JACK that it's what I went to first.

But yeah, somewhere in the suspend/resume process, jackd gets killed.  I haven't been able to investigate why.  It causes Pianoteq to lose its JACK connection, and then the only way to restore it is to restart jackd and either restart Pianoteq or select ALSA then JACK again.

This is just using the default Ubuntu suspend operation.  I might try playing with the swsusp/TuxOnIce/hibernate tools.  Maybe it's something about the sound hardware being disabled at some point in the suspend or resume process.

In general, it might be nice to have it try to reconnect to JACK if it loses the connection, though.

Re: Linux version: JACK auto-connect

Pretty much nothing that uses Jack will handle this situation anyway.

A better solution would be for jackd to know about the suspend/resume itself, keeping all clients active. That would work for everything and require no change to PianoTeq.

Jackd just doesn't handle the resume well at all, and will encounter many xruns. PianoTeq is also perfectly capable of running with ALSA with very low latency (lower than with Jack) so on a standalone system there's little need for Jack.

Last edited by petern (10-06-2009 11:44)