FluidSynth / fluidsynth

Software synthesizer based on the SoundFont 2 specifications
https://www.fluidsynth.org
GNU Lesser General Public License v2.1
1.76k stars 246 forks source link

fluidsynth doesn't play sound and hangs my sound card untill reboot (gentoo-gnome-wayland-pipewire) #1285

Closed kfirufk closed 3 months ago

kfirufk commented 7 months ago

Hi

I'm having a problem when i try to play a note on fluidsynth, it actually doesn't play and hangs my sound card until reboot.

I have gentoo linux ~amd64 with the following:

kernel: 6.6.2-gentoo sound card: 00:1f.3 Audio device: Intel Corporation Device 7a50 (rev 11) Desktop: Gnome on Wayland with pipewire and alsa

I also emerged media-sound/fluid-soundfont-3.1 to have

the results are exactly the same with fluidsynth when i run it with alsa or pipewire, it doesn't play anything and it breaks the sound card.

lets do it now live:

i run:

fluidsynth -a pipewire /usr/share/sounds/sf2/FluidR3_GM.sf2

I got:

ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/pcm/pcm.c:2675:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/pcm/pcm.c:2675:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/pcm/pcm.c:2675:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/pcm/pcm_route.c:878:(find_matching_chmap) Found no matching channel map
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/pcm/pcm_route.c:878:(find_matching_chmap) Found no matching channel map
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/pcm/pcm_route.c:878:(find_matching_chmap) Found no matching channel map
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/pcm/pcm_route.c:878:(find_matching_chmap) Found no matching channel map
ALSA lib /var/tmp/portage/media-plugins/alsa-plugins-1.2.7.1-r1/work/alsa-plugins-1.2.7.1/a52/pcm_a52.c:1001:(_snd_pcm_a52_open) a52 is only for playback
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib /var/tmp/portage/media-plugins/alsa-plugins-1.2.7.1-r1/work/alsa-plugins-1.2.7.1/usb_stream/pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.10-r2/work/alsa-lib-1.2.10/src/confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib /var/tmp/portage/media-plugins/alsa-plugins-1.2.7.1-r1/work/alsa-plugins-1.2.7.1/usb_stream/pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
FluidSynth runtime version 2.3.4
Copyright (C) 2000-2023 Peter Hanappe and others.
Distributed under the LGPL license.
SoundFont(R) is a registered trademark of Creative Technology Ltd.

lash_open_socket: could not connect to host 'localhost', service '14541'
lash_comm_connect_to_server: could not create server connection
JACK error: connect(2) call to /dev/shm/jack-1000/default/jack_0 failed (err=No such file or directory)
jackd 0.125.0
Copyright 2001-2009 Paul Davis, Stephane Letz, Jack O'Quinn, Torben Hohn and others.
jackd 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 compiled with System V SHM support.
loading driver ..
creating alsa driver ... hw:0|hw:0|1024|2|48000|0|0|nomon|swmeter|-|32bit
configuring for 48000Hz, period = 1024 frames (21.3 ms), buffer = 2 periods
ALSA: final selected sample format for capture: 32bit integer little-endian
ALSA: use 2 periods for capture
ALSA: final selected sample format for playback: 32bit integer little-endian
ALSA: use 2 periods for playback
lash_open_socket: could not connect to host 'localhost', service '14541'
lash_comm_connect_to_server: could not create server connection
Connected to JACK server with client name 'LASH_Server'
Opened ALSA sequencer with client ID 128
Listening for connections
fluidsynth: error: Unknown integer parameter 'lash.enable'
Created project project-1 in directory /home/ufk/audio-projects/project-1
Added client b859e652-84f9-48a3-8584-4fadb69cebe0 of class fluidsynth to project project-1
fluidsynth: Using PipeWire audio driver
Type 'help' for help topics.

then i run

noteon 0 80 60

and that's it, no sound and i can't play any other sound in the system until i reboot.

noteoff 0 80 60

doesn't really change anything.

i tried to google for the last.enable error couldn't find anything.

i tried to restart pipewire thinking that it will resolve sound issue so i ran this:

systemctl --user restart pipewire.service

and it just removed my default sound card output device from the list of outputs in my gnome desktop, so only restart resolve it.

derselbst commented 6 months ago

My only idea is that Jack keeps the soundcard locked. Pls. check whether jackd keeps running and whether terminating the process resolves the situation.

Also try to start fluidsynth with -a alsa. Given you description you apparently did that, pls. provide the logs in this case.

mawe42 commented 3 months ago

It seems that you have compiled FluidSynth with LASH support. I don't think the LASH support in FluidSynth is actually working anymore, that is also where the "fluidsynth: error: Unknown integer parameter 'lash.enable'" comes from. The LASH bindings use a setting lash.enable, but that setting isn't registered anywhere in the code.

As the last LASH version was released around 19 years ago, maybe we should simply remove it from the codebase. What do you think, @derselbst?

@kfirufk Either remove LASH from your system, or compile FluidSynth with cmake [...] -Denable-lash=0.

derselbst commented 3 months ago

Good point @mawe42, thanks! I've disabled LASH by default and added a deprecation warning.

kfirufk commented 3 months ago

ahh ok i reopened because i didn't hear anything but my default output just wasn't set properly. i can confirm that now with pipewire and alsa it works properly without freezing. thank you.