xyzzy42 / tg

A program for timing mechanical watches
GNU General Public License v2.0
34 stars 10 forks source link

Fails to start while JackD is running #2

Open galileo-pkm opened 2 years ago

galileo-pkm commented 2 years ago

This fork (master branch and package from fedora copr) fails to start while jackd is running. The upstream version (0.5) has no issue with jack and connects without problems. Additionally it seems that this implementation is trying to gain exclusive access to the selected alsa device so workarounds like alsa bridge are unusable. This is on Fedora 36.

trentp-igor commented 2 years ago

can you compile with debug turned on and provide a trace?

galileo-pkm commented 2 years ago

Output and trace log attached

output.txt trace.log

xyzzy42 commented 2 years ago

I don't see any evidence of trying to use ALSA. PortAudio queries all the available devices, which finds the alsa devices as well as jack. Then it looks like it tries to use jack and gets killed. I've never used PortAudio's JACK support. Might be a bug with it or some way the device is opened that causes a problem with just with jack.

Are you using pipewire?

galileo-pkm commented 2 years ago

It's not getting killed, the process is alive, the GUI simply does not show up. Upstream version (0.5) does not have this issue. I do not use pipewire, it is explicitly blacklisted on my system, it causes more issues than it is worth.

xyzzy42 commented 2 years ago

I saw the signal at the end of the trace, but that was you manually killing tg when it was hung?

tg 0.5 only supports using whatever device PortAudio decides is the default. I added device selection support. So it should be possible to select a specific direct alsa device, or use portaudio's virtual device, or use jack and select between them at run time.

But it looks like trying to start PortAudio on Jack is hanging and so the GUI never comes up to select another device.

I think trying to query the supported sample rates of the jack device is hanging.

galileo-pkm commented 2 years ago

Yes, ctrl+c (SIGINT). The problem is in Pa_IsFormatSupported, it locks up when the actual sample rate of jack server is tested. I disabled that test and tg seems to run fine.