mod-audio / mod-desktop

MOD Audio for the desktop
https://mod.audio/
GNU Affero General Public License v3.0
169 stars 9 forks source link

Could not start MOD Host - Fedora #42

Closed victorolinasc closed 9 months ago

victorolinasc commented 9 months ago

On release 0.0.7 I can't start the Jack / Pipewire option on Fedora 39.

The app shows the "Could not start MOD Host". Running the output of jackd command line gives:

Music/mod-desktop-8d4e2463-linux-x86_64/mod-desktop 
❯ export JACK_DRIVER_DIR="$(pwd)/jack"

Music/mod-desktop-8d4e2463-linux-x86_64/mod-desktop 
❯ ./jackd -R -S -n mod-desktop -C ./jack/jack-session-alsamidi.conf -v -d portaudio -r 48000 -p 128 -d JACK::system
jackdmp 1.9.22
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2023 Filipe Coelho.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK server starting in realtime mode with priority 10
self-connect-mode is "Don't restrict self connect requests"
Jack: JackPosixThread::StartImp : create non RT thread
Jack: JackPosixThread::ThreadHandler : start
Jack: Initializing PortAudio...
libjack.so.0 loaded successfully!
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Jack: JackPortAudioDriver::Open nframes = 128 in = 0 out = 0 capture name = JACK::system playback name = JACK::system samplerate = 48000
Can't open JACK::system, PortAudio will use default input device.
Can't open default PortAudio device
Jack: Terminate PortAudio...
Jack: ~JackDriver
Cannot initialize driver
Jack: no message buffer overruns
Jack: JackPosixThread::Stop
Jack: JackPosixThread::ThreadHandler : exit
JackServer::Open failed with -1
Jack: Succeeded in unlocking 107341340 byte memory area
Jack: JackShmMem::delete size = 0 index = 0
Jack: ~JackDriver
Jack: Succeeded in unlocking 1196 byte memory area
Jack: JackShmMem::delete size = 0 index = 1
Jack: Cleaning up shared memory
Jack: Cleaning up files
Jack: Unregistering server `mod-desktop'
Failed to open server

System:

Thanks for all your work!

victorolinasc commented 9 months ago

0.0.6 (mod-desktop-app edition) also did not start with the Jack/pipewire option:

(haven't tried earlier editions but if it can help I can test all)

Music/mod-desktop-app-384cab1c-linux-x86_64/mod-desktop-app 
❯ export JACK_DRIVER_DIR="$(pwd)/jack"

Music/mod-desktop-app-384cab1c-linux-x86_64/mod-desktop-app 
❯ ./jackd -R -S -n mod-desktop-app -C ./jack/jack-session.conf -v -d portaudio -r 48000 -p 128 -d JACK::Focusrite Scarlett 2i2 2nd Gen Headphones / Line 1-2
jackdmp 1.9.22
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2023 Filipe Coelho.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK server starting in realtime mode with priority 10
self-connect-mode is "Don't restrict self connect requests"
Jack: JackPosixThread::StartImp : create non RT thread
Jack: JackPosixThread::ThreadHandler : start
Jack: Initializing PortAudio...
libjack.so.0 loaded successfully!
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Jack: JackPortAudioDriver::Open nframes = 128 in = 0 out = 0 capture name = JACK::Focusrite playback name = JACK::Focusrite samplerate = 48000
Can't open JACK::Focusrite, PortAudio will use default input device.
Can't open default PortAudio device
Jack: Terminate PortAudio...
Jack: ~JackDriver
Cannot initialize driver
Jack: no message buffer overruns
Jack: JackPosixThread::Stop
Jack: JackPosixThread::ThreadHandler : exit
JackServer::Open failed with -1
Jack: Succeeded in unlocking 107341340 byte memory area
Jack: JackShmMem::delete size = 0 index = 0
Jack: ~JackDriver
Jack: Succeeded in unlocking 1196 byte memory area
Jack: JackShmMem::delete size = 0 index = 1
Jack: Cleaning up shared memory
Jack: Cleaning up files
Jack: Unregistering server `mod-desktop-app'
Failed to open server
falkTX commented 9 months ago

there is no point trying older releases, they wont work with pipewire.

weirdly, the logs you posted here are different from the previous ticket, which showed the libjack pw-jack libs being used. what changed?

victorolinasc commented 9 months ago

I think I might have polluted the exports before, but here is a clean new terminal session reproducing only the steps above (export and run).

Just to be sure, I've redone it here and it shows the same output as in this thread:

Music/mod-desktop-8d4e2463-linux-x86_64/mod-desktop 
❯ export JACK_DRIVER_DIR="$(pwd)/jack"

Music/mod-desktop-8d4e2463-linux-x86_64/mod-desktop 
❯ echo $JACK_DRIVER_DIR 
/home/victornascimento/Music/mod-desktop-8d4e2463-linux-x86_64/mod-desktop/jack

Music/mod-desktop-8d4e2463-linux-x86_64/mod-desktop 
❯ ./jackd -R -S -n mod-desktop -C ./jack/jack-session-alsamidi.conf -v -d portaudio -r 48000 -p 128 -d JACK::system
jackdmp 1.9.22
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2023 Filipe Coelho.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK server starting in realtime mode with priority 10
self-connect-mode is "Don't restrict self connect requests"
Jack: JackPosixThread::StartImp : create non RT thread
Jack: JackPosixThread::ThreadHandler : start
Jack: Initializing PortAudio...
libjack.so.0 loaded successfully!
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Jack: JackPortAudioDriver::Open nframes = 128 in = 0 out = 0 capture name = JACK::system playback name = JACK::system samplerate = 48000
Can't open JACK::system, PortAudio will use default input device.
Can't open default PortAudio device
Jack: Terminate PortAudio...
Jack: ~JackDriver
Cannot initialize driver
Jack: no message buffer overruns
Jack: JackPosixThread::Stop
Jack: JackPosixThread::ThreadHandler : exit
JackServer::Open failed with -1
Jack: Succeeded in unlocking 107341340 byte memory area
Jack: JackShmMem::delete size = 0 index = 0
Jack: ~JackDriver
Jack: Succeeded in unlocking 1196 byte memory area
Jack: JackShmMem::delete size = 0 index = 1
Jack: Cleaning up shared memory
Jack: Cleaning up files
Jack: Unregistering server `mod-desktop'
Failed to open server

Sorry for the noise!

falkTX commented 9 months ago

try with the filename env var set too, as the method to find pw-jack libs is failing. for you this should work:

export JACK_DRIVER_DIR="$(pwd)/jack"
export JACKBRIDGE_FILENAME=/usr/lib64/pipewire-0.3/jack/libjack.so.0
./jackd ...
victorolinasc commented 9 months ago
Music/mod-desktop-8d4e2463-linux-x86_64/mod-desktop 
❯ export JACKBRIDGE_FILENAME=/usr/lib64/pipewire-0.3/jack/libjack.so.0

Music/mod-desktop-8d4e2463-linux-x86_64/mod-desktop 
❯ ./jackd -R -S -n mod-desktop -C ./jack/jack-session-alsamidi.conf -v -d portaudio -r 48000 -p 128 -d JACK::system
jackdmp 1.9.22
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2023 Filipe Coelho.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK server starting in realtime mode with priority 10
self-connect-mode is "Don't restrict self connect requests"
Jack: JackPosixThread::StartImp : create non RT thread
Jack: JackPosixThread::ThreadHandler : start
Jack: Initializing PortAudio...
/usr/lib64/pipewire-0.3/jack/libjack.so.0 loaded successfully!
Jack: JackPortAudioDriver::Open nframes = 128 in = 0 out = 0 capture name = JACK::system playback name = JACK::system samplerate = 48000
Jack: JackDriver::Open capture_driver_name = JACK::system
Jack: JackDriver::Open playback_driver_name = JACK::system
Jack: Check protocol client = 9 server = 9
Jack: JackEngine::ClientInternalOpen: name = system
Jack: JackEngine::AllocateRefNum ref = 0
Jack: JackLinuxFutex::Allocate name = jack_sem.1000_mod-desktop_system val = 0
Jack: JackEngine::NotifyAddClient: name = system
Jack: JackGraphManager::SetBufferSize size = 128
Jack: JackConnectionManager::DirectConnect first: ref1 = 0 ref2 = 0
Jack: JackGraphManager::ConnectRefNum cur_index = 0 ref1 = 0 ref2 = 0
Jack: JackDriver::SetupDriverSync driver sem in normal mode
Jack: JackPortAudioDriver::Open fInputDevice = 0, fOutputDevice 0
Jack: JackPortAudioDriver::Open setup max in channels = 2
Jack: JackPortAudioDriver::Open setup max out channels = 2
Jack: JackPortAudioDriver::OpenStream buffer_size = 128
Falha de segmentação (imagem do núcleo gravada)

(last line reads as "core dumped")

falkTX commented 9 months ago

huh so now it really is the same thing as the last ticket. I think I need to setup some VM to try this out.

is your fedora install a regular one, or very costumized?

victorolinasc commented 9 months ago

It is a default KDE Spin.

Nothing fancy on my side, just enabled RPM Fusion (free and nonfree). Added user to audio group and configured limits.

No big/explicit pipewire configuration whatsoever...

If you want me to try anything else just send it away!

Thanks once again.

falkTX commented 9 months ago

yeah, here is the debug build matching the 0.0.7 release https://github.com/moddevices/mod-desktop/actions/runs/7769483533/artifacts/1217753242

in theory running this through gdb, as explained in the other ticket, should provide some details for why it crashes.

magillos commented 9 months ago

I posted gdb output in the other ticket moment ago. Maybe it will help.

victorolinasc commented 9 months ago

My gdb dump is a bit different (after it downloaded debug_infod from fedora servers):

Starting program: /home/victornascimento/Music/mod-desktop-8d4e2463-linux-x86_64-debug/mod-desktop/jackd -R -S -n mod-desktop -C ./jack/jack-session-alsamidi.conf -v -d portaudio -r 48000 -p 128 -d JACK::system

This GDB supports auto-downloading debuginfo from the following URLs:
  <https://debuginfod.fedoraproject.org/>
Enable debuginfod for this session? (y or [n]) y
Debuginfod has been enabled.
To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit.
Downloading separate debug info for system-supplied DSO at 0x7ffff7fc7000
Downloading separate debug info for /lib64/libdbus-1.so.3                                                                                                                               
Downloading separate debug info for /home/victornascimento/.cache/debuginfod_client/1621e6dde34f99c1cd6f59dd422ed3fe34ff186c/debuginfo                                                  
Downloading separate debug info for /lib64/libc.so.6                                                                                                                                    
Downloading separate debug info for /home/victornascimento/.cache/debuginfod_client/7ea8d85df0e89b90c63ac7ed2b3578b2e7728756/debuginfo                                                  
[Thread debugging using libthread_db enabled]                                                                                                                                           
Using host libthread_db library "/lib64/libthread_db.so.1".
Downloading separate debug info for /lib64/libpthread.so.0
Downloading separate debug info for /lib64/librt.so.1                                                                                                                                   
Downloading separate debug info for /lib64/libdl.so.2                                                                                                                                   
Downloading separate debug info for /lib64/libm.so.6                                                                                                                                    
Downloading separate debug info for /lib64/libsystemd.so.0                                                                                                                              
Downloading separate debug info for /home/victornascimento/.cache/debuginfod_client/d76474476bdadb5aec3142724a12520954fb2807/debuginfo                                                  
Downloading separate debug info for /lib64/libcap.so.2                                                                                                                                  
Downloading separate debug info for /home/victornascimento/.cache/debuginfod_client/cacac5d875db04ffd15c6c4d241a229fd35aa103/debuginfo                                                  
Downloading separate debug info for /lib64/liblz4.so.1                                                                                                                                  
Downloading separate debug info for /home/victornascimento/.cache/debuginfod_client/417acaa73abbb1a80c8bf5992167901cf3e968d0/debuginfo                                                  
Downloading separate debug info for /lib64/liblzma.so.5                                                                                                                                 
Downloading separate debug info for /lib64/libzstd.so.1                                                                                                                                 
Downloading separate debug info for /home/victornascimento/.cache/debuginfod_client/b1a48bfe9633d216b886e4935b368ab798bcfaaf/debuginfo                                                  
Downloading separate debug info for /lib64/libgcc_s.so.1                                                                                                                                
Downloading separate debug info for /home/victornascimento/.cache/debuginfod_client/2a04c81c800e0445aeb36c136939653bbefd65ec/debuginfo                                                  
jackdmp 1.9.22                                                                                                                                                                          
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2023 Filipe Coelho.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
Downloading separate debug info for /lib64/libasound.so.2
Downloading separate debug info for /usr/lib64/pipewire-0.3/jack/libjack.so.0                                                                                                           
Downloading separate debug info for /home/victornascimento/.cache/debuginfod_client/a2cc8d0c37281053aeef6bee802f5a1f0f8388af/debuginfo                                                  
Downloading separate debug info for /lib64/libpipewire-0.3.so.0                                                                                                                         
Downloading separate debug info for /usr/lib64/spa-0.2/support/libspa-support.so                                                                                                        
Downloading separate debug info for /usr/lib64/spa-0.2/support/libspa-journal.so                                                                                                        
Downloading separate debug info for /lib64/libstdc++.so.6                                                                                                                               
JACK server starting in realtime mode with priority 10                                                                                                                                  
self-connect-mode is "Don't restrict self connect requests"
Jack: JackPosixThread::StartImp : create non RT thread
[New Thread 0x7fffefc066c0 (LWP 36328)]
Jack: JackPosixThread::ThreadHandler : start
Jack: Initializing PortAudio...
/usr/lib64/pipewire-0.3/jack/libjack.so.0 loaded successfully!                                                                                                                          
Downloading separate debug info for /usr/lib64/spa-0.2/support/libspa-dbus.so
Downloading separate debug info for /usr/lib64/pipewire-0.3/libpipewire-module-rt.so                                                                                                    
Downloading separate debug info for /usr/lib64/pipewire-0.3/libpipewire-module-protocol-native.so                                                                                       
Downloading separate debug info for /lib64/libselinux.so.1                                                                                                                              
Downloading separate debug info for /home/victornascimento/.cache/debuginfod_client/c3ca2b00f1505a173d44417dc98dced2ec390268/debuginfo                                                  
Downloading separate debug info for /lib64/libpcre2-8.so.0                                                                                                                              
Downloading separate debug info for /home/victornascimento/.cache/debuginfod_client/adf4c0e4901bdc5d8019e9ca137b9048beee3e1f/debuginfo                                                  
Downloading separate debug info for /usr/lib64/pipewire-0.3/libpipewire-module-client-node.so                                                                                           
Downloading separate debug info for /usr/lib64/pipewire-0.3/libpipewire-module-metadata.so                                                                                              
[New Thread 0x7fffef6da6c0 (LWP 36329)]                                                                                                                                                 
[Thread 0x7fffef6da6c0 (LWP 36329) exited]
[New Thread 0x7fffef6da6c0 (LWP 36330)]
[New Thread 0x7fffeeed96c0 (LWP 36331)]
[New Thread 0x7fffee6d86c0 (LWP 36332)]
Jack: JackPortAudioDriver::Open nframes = 128 in = 0 out = 0 capture name = JACK::system playback name = JACK::system samplerate = 48000
Jack: JackDriver::Open capture_driver_name = JACK::system
Jack: JackDriver::Open playback_driver_name = JACK::system
Jack: Check protocol client = 9 server = 9
Jack: JackEngine::ClientInternalOpen: name = system
Jack: JackEngine::AllocateRefNum ref = 0
Jack: JackLinuxFutex::Allocate name = jack_sem.1000_mod-desktop_system val = 0
Jack: JackEngine::NotifyAddClient: name = system
Jack: JackGraphManager::SetBufferSize size = 128
Jack: JackConnectionManager::DirectConnect first: ref1 = 0 ref2 = 0
Jack: JackGraphManager::ConnectRefNum cur_index = 0 ref1 = 0 ref2 = 0
Jack: JackDriver::SetupDriverSync driver sem in normal mode
Jack: JackPortAudioDriver::Open fInputDevice = 0, fOutputDevice 0
Jack: JackPortAudioDriver::Open setup max in channels = 2
Jack: JackPortAudioDriver::Open setup max out channels = 2
Jack: JackPortAudioDriver::OpenStream buffer_size = 128

Thread 1 "jackd" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00007ffff7ace9f9 in GetMicroSeconds () at ../linux/JackLinuxTime.c:212
#2  0x00007ffff7aaa1be in jack_get_time () at ../common/JackAPI.cpp:1370
#3  0x00007ffff74e9c15 in jack_frame_time (client=0x55555565db20) at ../pipewire-jack/src/pipewire-jack.c:6427
#4  0x00007fffef80a55e in jackbridge_frame_time (client=0x55555565db20) at src/hostapi/jack/JackBridge.c:1818
#5  0x00007fffef80ce16 in OpenStream (hostApi=0x55555562a170, s=0x5555556b95f8, inputParameters=0x7fffffffc7d0, outputParameters=0x7fffffffc7b0, sampleRate=48000, 
    framesPerBuffer=128, streamFlags=0, 
    streamCallback=0x7fffef80581c <Jack::JackPortAudioDriver::Render(void const*, void*, unsigned long, PaStreamCallbackTimeInfo const*, unsigned long, void*)>, 
    userData=0x5555556b86f0) at src/hostapi/jack/pa_jack.c:1145
#6  0x00007fffef808ce5 in Pa_OpenStream (stream=0x5555556b95f8, inputParameters=0x7fffffffc870, outputParameters=0x7fffffffc850, sampleRate=48000, framesPerBuffer=128, streamFlags=0, 
    streamCallback=0x7fffef80581c <Jack::JackPortAudioDriver::Render(void const*, void*, unsigned long, PaStreamCallbackTimeInfo const*, unsigned long, void*)>, 
    userData=0x5555556b86f0) at src/common/pa_front.c:1256
#7  0x00007fffef805e55 in Jack::JackPortAudioDriver::OpenStream (this=0x5555556b86f0, buffer_size=128) at ../windows/portaudio/JackPortAudioDriver.cpp:188
#8  0x00007fffef806689 in Jack::JackPortAudioDriver::Open (this=0x5555556b86f0, buffer_size=128, samplerate=48000, capturing=true, playing=true, inchannels=2, outchannels=2, 
    monitor=false, capture_driver_uid=0x555555629b24 "JACK::system", playback_driver_uid=0x555555629b24 "JACK::system", capture_latency=0, playback_latency=0)
    at ../windows/portaudio/JackPortAudioDriver.cpp:328
#9  0x00007fffef80734c in driver_initialize (engine=0x55555562a8a0, table=0x7ffff74912e0, params=0x555555629a50) at ../windows/portaudio/JackPortAudioDriver.cpp:642
#10 0x00007ffff7ae6385 in JackDriverInfo::Open (this=0x555555629a30, driver_desc=0x555555635250, engine=0x55555562a8a0, synchro=0x7ffff74912e0, params=0x555555629a50)
    at ../common/JackDriverLoader.cpp:794
#11 0x00007ffff7ae10f3 in Jack::JackServer::Open (this=0x7ffff6266010, driver_desc=0x555555635250, driver_params=0x555555629a50) at ../common/JackServer.cpp:94
#12 0x00007ffff7aec6c7 in jackctl_server_open (server_ptr=0x555555622b80, driver_ptr=0x55555562d860) at ../common/JackControlAPI.cpp:1071
#13 0x0000555555403d37 in main (argc=16, argv=0x7fffffffd208) at ../common/Jackdmp.cpp:560
falkTX commented 9 months ago

ok I think I know what the issue is now. will need to do some tests, will get back to you soon but not today

victorolinasc commented 9 months ago

No worries! Glad to help :)

I can use it with pure ALSA but that obviously monopolizes my sound card.

falkTX commented 9 months ago

please try the latest build https://github.com/moddevices/mod-desktop/actions/runs/7786176308/artifacts/1221831434

when running the mod-desktop gui tool it will print some info on console/terminal that helps me diagnose the issue. something like this:

MOD Desktop DEBUG: jacklib syms 0x7f2eb5697e80 0x7f2eb569c310 | 257 | ok with filename'/usr/lib/x86_64-linux-gnu/pipewire-0.3/jack/libjack.so.0'

let me know what that line says for you, thanks!

magillos commented 9 months ago

It fixed pipewire issue for me on arch.

falkTX commented 9 months ago

potentially fixed with the latest 0.0.8 release, please check, thanks!

victorolinasc commented 9 months ago

Solved my issue completely :)

Thanks a lot! It is awesome!