PortAudio / portaudio

PortAudio is a cross-platform, open-source C language library for real-time audio input and output.
Other
1.37k stars 286 forks source link

How to hide this log in terminal on fedora 35 ? #695

Open Nelson-numerical-software opened 2 years ago

Nelson-numerical-software commented 2 years ago

At each startup of my application, on Fedora 35 only (with pipewire)

portaudio-19-37.fc35.src.rpm

Expression '(jack_ports = jack_get_ports( jackApi->jack_client, "", JACK_PORT_TYPE_FILTER, 0 )) && jack_ports[0]' failed in 'src/hostapi/jack/pa_jack.c', line: 538

Thanks

RossBencina commented 2 years ago

The comment on line 534 of 'src/hostapi/jack/pa_jack.c' says If jack_get_ports returns NULL, there's nothing for us to do which makes me thing that this shouldn't be displaying a log message. Maybe we should remove the UNLESS macro and directly code the check.

@Be-ing any thoughts?

Be-ing commented 2 years ago

Please post the output of jack_lsp.

Nelson-numerical-software commented 2 years ago
$ jack_lsp -t
ES1371/ES1373 / Creative Labs CT2518 (Audio PCI 64V/128/5200 / Creative CT4810/CT5803/CT5806 [Sound Blaster PCI]) Stéréo analo:capture_FL
    32 bit float mono audio
ES1371/ES1373 / Creative Labs CT2518 (Audio PCI 64V/128/5200 / Creative CT4810/CT5803/CT5806 [Sound Blaster PCI]) Stéréo analo:capture_FR
    32 bit float mono audio
ES1371/ES1373 / Creative Labs CT2518 (Audio PCI 64V/128/5200 / Creative CT4810/CT5803/CT5806 [Sound Blaster PCI]) Stéréo analo:playback_FL
    32 bit float mono audio
ES1371/ES1373 / Creative Labs CT2518 (Audio PCI 64V/128/5200 / Creative CT4810/CT5803/CT5806 [Sound Blaster PCI]) Stér� Monitor:monitor_FL
    32 bit float mono audio
ES1371/ES1373 / Creative Labs CT2518 (Audio PCI 64V/128/5200 / Creative CT4810/CT5803/CT5806 [Sound Blaster PCI]) Stéréo analo:playback_FR
    32 bit float mono audio
ES1371/ES1373 / Creative Labs CT2518 (Audio PCI 64V/128/5200 / Creative CT4810/CT5803/CT5806 [Sound Blaster PCI]) Stér� Monitor:monitor_FR
    32 bit float mono audio
Midi-Bridge:Midi Through:(capture_0) Midi Through Port-0
    8 bit raw midi
Midi-Bridge:Ensoniq AudioPCI:(capture_0) ES1371
    8 bit raw midi
Midi-Bridge:Midi Through:(playback_0) Midi Through Port-0
    8 bit raw midi
Midi-Bridge:Ensoniq AudioPCI:(playback_0) ES1371
    8 bit raw midi
Be-ing commented 2 years ago

Did you have the pipewire-jack-audio-connection-kit package installed before running jack_lsp?

Nelson-numerical-software commented 2 years ago

Yes, pipewire-jack-audio-connection-kit-0.3.47-1.fc35.x86_64 is installed.

Be-ing commented 2 years ago

And you are still seeing the

Expression '(jack_ports = jack_get_ports( jackApi->jack_client, "", JACK_PORT_TYPE_FILTER, 0 )) && jack_ports[0]' failed in 'src/hostapi/jack/pa_jack.c', line: 538

error with pipewire-jack-audio-connection-kit installed? What application are you using?

Nelson-numerical-software commented 2 years ago

Currently, it is worse

Previously I had just a warning in terminal, now my application do a core dump.

[mcallan@fedora nelson]$ bin/linux64/nelson-gui
nelson-gui-exec: src/hostapi/jack/pa_jack.c :557 : BuildDeviceList:  l'assertion « match_info.rm_eo - match_info.rm_so < jack_client_name_size() » a échoué.
bin/linux64/nelson-gui : ligne 32 :  4044 Abandon                 (core dumped)$SCRIPT_DIRECTORY/nelson-gui-exec "$@"
Be-ing commented 2 years ago

I suspect the / characters in the JACK device name may be causing problems. Can you post a backtrace of that crash?

Nelson-numerical-software commented 2 years ago

I am not expert with core dump on Fedora:

               Stack trace of thread 26441:
                #0  0x00007f772010488c __pthread_kill_implementation (libc.so.6 + 0x8f88c)
                #1  0x00007f77200b76a6 raise (libc.so.6 + 0x426a6)
                #2  0x00007f77200a17d3 abort (libc.so.6 + 0x2c7d3)
                #3  0x00007f77200a16fb __assert_fail_base.cold (libc.so.6 + 0x2c6fb)
                #4  0x00007f77200b0396 __assert_fail (libc.so.6 + 0x3b396)
                #5  0x00007f770ca1b6ca PaJack_Initialize (libportaudio.so.2 + 0xe6ca)
                #6  0x00007f770ca1b8d2 Pa_Initialize (libportaudio.so.2 + 0xe8d2)
                #7  0x00007f770ca5630d n/a (/home/mcallan/nelson/bin/linux64/libnlsAudio.so.0.6.2>
                #8  0x00007f772211d4df n/a (/home/mcallan/nelson/bin/linux64/libnlsDynamic_link.s>
                #9  0x0000000000000037 n/a (n/a + 0x0)
Be-ing commented 2 years ago

The name of your JACK device is very long at 127 printed characters, so I think that is 128 with the non-printed \0 string terminator. Pipewire defines jack_client_name_size as 128. I think there is a bug in the assertion testing the length of the JACK client string:

assert(match_info.rm_eo - match_info.rm_so < jack_client_name_size());

I think that should use <= instead of <.

Please try:

cp /usr/share/pipewire/jack.conf ~/.config/pipewire/jack.conf

edit ~/.config/pipewire/jack.conf to change the line

#jack.short-name    = false

to

jack.short-name    = true

Then run

systemctl --user restart pipewire

post the output of jack_lsp again and try running your program.

Nelson-numerical-software commented 2 years ago
$ jack_lsp
Ensoniq AudioPCI:capture_FL
Ensoniq AudioPCI:capture_FR
Ensoniq AudioPCI:playback_FL
Ensoniq AudioPCI Monitor:monitor_FL
Ensoniq AudioPCI:playback_FR
Ensoniq AudioPCI Monitor:monitor_FR
Midi-Bridge:Midi Through:(capture_0) Midi Through Port-0
Midi-Bridge:Ensoniq AudioPCI:(capture_0) ES1371
Midi-Bridge:Midi Through:(playback_0) Midi Through Port-0
Midi-Bridge:Ensoniq AudioPCI:(playback_0) ES1371

Application works with portaudio and no more warnings in terminal

Thanks !!!

Be-ing commented 2 years ago

Please set jack.short-name = false again in ~/.config/pipewire/jack.conf and try linking your program with #698.

Nelson-numerical-software commented 2 years ago

If set jack.short-name = false again in ~/.config/pipewire/jack.conf

[mcallan@fedora nelson]$ code -n  ~/.config/pipewire/jack.conf
[mcallan@fedora nelson]$ systemctl --user restart pipewire
[mcallan@fedora nelson]$ bin/linux64/nelson-gui
nelson-gui-exec: src/hostapi/jack/pa_jack.c :557 : BuildDeviceList:  l'assertion « match_info.rm_eo - match_info.rm_so < jack_client_name_size() » a échoué.
bin/linux64/nelson-gui : ligne 32 :  6101 Abandon                 (core dumped)$SCRIPT_DIRECTORY/nelson-gui-exec "$@"
[mcallan@fedora nelson]$ jack_lsp
ES1371/ES1373 / Creative Labs CT2518 (Audio PCI 64V/128/5200 / Creative CT4810/CT5803/CT5806 [Sound Blaster PCI]) Stéréo analo:capture_FL
ES1371/ES1373 / Creative Labs CT2518 (Audio PCI 64V/128/5200 / Creative CT4810/CT5803/CT5806 [Sound Blaster PCI]) Stéréo analo:capture_FR
ES1371/ES1373 / Creative Labs CT2518 (Audio PCI 64V/128/5200 / Creative CT4810/CT5803/CT5806 [Sound Blaster PCI]) Stéréo analo:playback_FL
ES1371/ES1373 / Creative Labs CT2518 (Audio PCI 64V/128/5200 / Creative CT4810/CT5803/CT5806 [Sound Blaster PCI]) Stér� Monitor:monitor_FL
ES1371/ES1373 / Creative Labs CT2518 (Audio PCI 64V/128/5200 / Creative CT4810/CT5803/CT5806 [Sound Blaster PCI]) Stéréo analo:playback_FR
ES1371/ES1373 / Creative Labs CT2518 (Audio PCI 64V/128/5200 / Creative CT4810/CT5803/CT5806 [Sound Blaster PCI]) Stér� Monitor:monitor_FR
Midi-Bridge:Midi Through:(capture_0) Midi Through Port-0
Midi-Bridge:Ensoniq AudioPCI:(capture_0) ES1371
Midi-Bridge:Midi Through:(playback_0) Midi Through Port-0
Midi-Bridge:Ensoniq AudioPCI:(playback_0) ES1371

I try #698 quickly

Nelson-numerical-software commented 2 years ago

I confirm, I build/installed #698 with jack.short-name = false in ~/.config/pipewire/jack.conf IT WORKS !!! No coredump or warnings when I start my application Thanks

Be-ing commented 2 years ago

Great, thank you for testing!

RossBencina commented 2 years ago

We've merged #698, which fixes the assert at line 554, however it seems like the UNLESS macro at 538 remains a problem(?)

What exactly was done to stop the following console message from appearing?

Expression '(jack_ports = jack_get_ports( jackApi->jack_client, "", JACK_PORT_TYPE_FILTER, 0 )) && jack_ports[0]' failed in 'src/hostapi/jack/pa_jack.c', line: 538

Based on the analysis we did earlier, that check at 538 looks bogus. Thoughts?