spatialaudio / jackclient-python

🂻 JACK Audio Connection Kit (JACK) Client for Python :snake:
https://jackclient-python.readthedocs.io/
MIT License
131 stars 26 forks source link

Anyway to check if client is activated #115

Open flappix opened 2 years ago

flappix commented 2 years ago

Hi, I'm facing the problem that my jack client becomes deactivated at some point of my code even if I'm not calling client.deactivate().
When this happens i'm not able to (de)connect any ports registered by my script. I'm just getting an error message from jack_connect

> jack_connect system:capture_1 test:in
cannot connect client, already connected?
>
>jack_disconnect  system:capture_1 test:in 
cannot disconnect client, already disconnected?

I'm having a hard time to debug the script and determine the exact position in the code where this is happening. So I'm looking for any way to check if the client is still activated. I tried client.status which output <jack.Status 0x0: no flags set> regardless if the client is activated or no. I also tried client.set_shutdown_callback (f) but its not executed when the client becomes deactivated.

Any help would be greatly appreciated :)

mgeier commented 2 years ago

Sorry, I don't really have an idea.

You can try to print something from the process callback, and whenever it stops, the client has probably been deactivated. I know that's not great, but maybe it helps ...

HaHeho commented 2 years ago

@flappix if you post a minimal example (so that we don't have to crawl through obstructing code) then we might be able to help with what is happening.