You are not logged in.

#1 2019-02-19 09:11:12

bronze colossus
Member
Registered: 2017-03-19
Posts: 4

[Solved] FluidSynth needs missing ALSA modules

Currently trying to install and run FluidSynth so I can play midi files, however I hit a snag when trying to run FluidSynth as stand-alone (and also as a daemon). I followed the guide for FluidSynth on the wiki and have installed the soundfonts.

$ ls /usr/share/soundfonts
FluidR3_GM.sf2  FluidR3_GS.sf2  timidity-freepats.sf2

Then I run the following command from the FluidSynth wiki page I get:

$ fluidsynth -a alsa -m alsa_seq -l -i /usr/share/soundfonts/FluidR3_GM.sf2 example.midi

FluidSynth runtime version 1.1.11
Copyright (C) 2000-2018 Peter Hanappe and others.
Distributed under the LGPL license.
SoundFont(R) is a registered trademark of E-mu Systems, Inc.

ALSA lib pcm_dmix.c:1108:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map
Expression 'alsa_snd_pcm_hw_params_set_buffer_size_near( pcm, hwParams, &alsaBufferFrames )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 922
Expression 'alsa_snd_pcm_hw_params_set_buffer_size_near( pcm, hwParams, &alsaBufferFrames )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 922
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
ALSA lib pcm_dmix.c:1108:(snd_pcm_dmix_open) unable to open slave
Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 933
Parameter 'example.midi' not a SoundFont or MIDI file or error occurred identifying it.

Then I ran and checked which modules where loaded

$  lsmod | grep '^snd' | column -t
snd_seq_dummy          16384   2   
snd_hrtimer            16384   1   
snd_seq                86016   6   snd_seq_dummy
snd_seq_device         16384   1   snd_seq
snd_pcm_oss            65536   0   
snd_mixer_oss          28672   1   snd_pcm_oss
snd_hda_codec_realtek  122880  1   
snd_hda_codec_generic  90112   1   snd_hda_codec_realtek
snd_hda_codec_hdmi     61440   1   
snd_hda_intel          49152   6   
snd_hda_codec          155648  4   snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek
snd_hda_core           98304   5   snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek
snd_hwdep              16384   1   snd_hda_codec
snd_pcm                135168  6   snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_pcm_oss,snd_hda_core
snd_timer              40960   3   snd_seq,snd_hrtimer,snd_pcm
snd                    102400  24  snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek,snd_timer,snd_pcm_oss,snd_pcm,snd_mixer_oss
$ ls -l /dev/snd
total 0
drwxr-xr-x  2 root root       80 Feb 19 08:42 by-path
crw-rw----+ 1 root audio 116,  8 Feb 19 08:42 controlC0
crw-rw----+ 1 root audio 116,  4 Feb 19 08:42 controlC1
crw-rw----+ 1 root audio 116,  7 Feb 19 08:42 hwC0D0
crw-rw----+ 1 root audio 116,  3 Feb 19 08:42 hwC1D0
crw-rw----+ 1 root audio 116,  6 Feb 19 09:01 pcmC0D0c
crw-rw----+ 1 root audio 116,  5 Feb 19 08:49 pcmC0D0p
crw-rw----+ 1 root audio 116,  2 Feb 19 09:01 pcmC1D3p
crw-rw----+ 1 root audio 116,  1 Feb 19 08:49 seq
crw-rw----+ 1 root audio 116, 33 Feb 19 08:42 timer

and here are some additional information

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Generic [HD-Audio Generic], device 0: ALC3227 Analog [ALC3227 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

$ cat /proc/asound/cards
 0 [Generic        ]: HDA-Intel - HD-Audio Generic
                      HD-Audio Generic at 0xfea60000 irq 16
 1 [HDMI           ]: HDA-Intel - HDA ATI HDMI
                      HDA ATI HDMI at 0xfea64000 irq 39

The modules snd_pcm_dmix, snd_pcm_usb and snd_pcm_oss does not seem to exist. I did try to load them with modprobe however only snd_pcm_oss seemed to be successfully loaded, but the error ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port still show up as seen above.


If I have understood my own problem correctly I'm currently missing a couple of modules that prevents me from running FluidSynth possible because it can't properly detect my card. I can otherwise play music, watch videos with both speakers and headphones without problems.  I'm asking how to find and load these missing modules. Thank you for any help.

Last edited by bronze colossus (2019-02-19 19:27:22)

Offline

#2 2019-02-19 09:26:51

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,079

Re: [Solved] FluidSynth needs missing ALSA modules

It is talking about ALSA plugins not kernel modules. FWIW before we suggest something stupid, what's your output for

aplay -L
sudo fuser -v /dev/snd/*

do you have any /etc/asound.conf or ~/.asoundrc or similar, what are their contents?

Last edited by V1del (2019-02-19 09:42:57)

Offline

#3 2019-02-19 09:38:41

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,899

Re: [Solved] FluidSynth needs missing ALSA modules

Something appears to be wrong with your alsa configuration, but I'm not sure it's missing modules.
That aplay output is very short though.

post the output of alsa-info.sh (comes with alsa-utils)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#4 2019-02-19 10:05:12

bronze colossus
Member
Registered: 2017-03-19
Posts: 4

Re: [Solved] FluidSynth needs missing ALSA modules

Thank you for your quick response.
The results for

aplay -L
sudo fuser -v /dev/snd/*

followed by the contents of /etc/asound.conf, ~/.asoundrc files and the results for alsa-info.sh can be found here: https://ptpb.pw/yyn_ .

In /etc/asound.conf I added this snippet

pcm.dsp {
        type plug
        slave.pcm "dmix"
}

when troubleshooting this problem but it didn't seem to have any effect, probably not relevant but I feel it should be mentioned.

Offline

#5 2019-02-19 10:13:03

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,079

Re: [Solved] FluidSynth needs missing ALSA modules

Do you know why you have jack running and do you want to have jack running? Either way with these conditions present, tell fluidsynth to play back to the actual things you have active. use -a jack -m jack if you want it to hook into jack, or -a pulseaudio -m alsa_seq to make it hook into pulseaudio.

That for what you should be doing, the actual reason for why  it doesn't work is that you currently broke your default device with conflicting information. Remove that .asoundrc it doesn't make sense with the rest of the configuration. (and the dsp pcm definition for that matter, it shouldn't break anything, but the less configuration that is there without a proper reason to be there, the better)

Last edited by V1del (2019-02-19 11:50:50)

Offline

#6 2019-02-19 10:35:34

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,899

Re: [Solved] FluidSynth needs missing ALSA modules

Your ALSA information is in /tmp/alsa-info.txt.qTHawsKOCH

can you post the contents of that file , bronze colossus ?


videl wrote:

Do you know why you have jack running and do you want to have jack running?

It has been started automatically for a long time now, I've never figured out how to prevent that.
OP might be in same position.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#7 2019-02-19 14:54:01

bronze colossus
Member
Registered: 2017-03-19
Posts: 4

Re: [Solved] FluidSynth needs missing ALSA modules

Sorry Lone_wolf about that, here's the pastebin https://ptpb.pw/wQJH.

When I run

$ fluidsynth -a alsa -m alsa_seq -l -i /usr/share/soundfonts/FluidR3_GM.sf2 example.midi

with jack off it complaines about no jack server started or found. So I thought jack should be on for FluidSynth to properly work. I changed the command as recommended to -a jack -m jack:

fluidsynth -a jack -m jack -l -i /usr/share/soundfonts/FluidR3_GM.sf2 example.midi

and when running this command with jack on it gives a similar error as before. However when i turned off jack and try the command again jack seems to be started back on and runs until it reaches a rate mismatch (synth.sample-rate=44100, jackd=48000). I tried to change jacks sample rate to 44100 with cadence but it does not seem to have any effect. Don't now if that means that the original problem is solved or not and now it's a (simple) problem of rate mismatch but looks interesting.

I then tested the command with  -a pulseaudio -m alsa_seq:

fluidsynth -a pulseaudio -m alsa_seq -l -i /usr/share/soundfonts/FluidR3_GM.sf2 example.midi

It seems when calling pulseaudio directly it will complain about jack being off and when jack is on it just gives a similar error message as before.

Pastebin of the commands with  -a  -m variations and jack on/off here: https://ptpb.pw/O1XC

Offline

#8 2019-02-19 19:26:14

bronze colossus
Member
Registered: 2017-03-19
Posts: 4

Re: [Solved] FluidSynth needs missing ALSA modules

I fixed the sample rate mismatch by forcing synth.sample-rate=48000 by -r 48000

fluidsynth -a jack -m jack -r 48000-l -i /usr/share/soundfonts/FluidR3_GM.sf2 example.midi
FluidSynth runtime version 2.0.3
Copyright (C) 2000-2019 Peter Hanappe and others.
Distributed under the LGPL license.
SoundFont(R) is a registered trademark of E-mu Systems, Inc.

ALSA lib pcm_dmix.c:1108:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map
Expression 'alsa_snd_pcm_hw_params_set_buffer_size_near( pcm, hwParams, &alsaBufferFrames )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 922
Expression 'alsa_snd_pcm_hw_params_set_buffer_size_near( pcm, hwParams, &alsaBufferFrames )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 922
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
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
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
ALSA lib pcm_dmix.c:1108:(snd_pcm_dmix_open) unable to open slave
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
Parameter 'example.midi' not a SoundFont or MIDI file or error occurred identifying it.
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jackdmp 1.9.12
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2017 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
no message buffer overruns
no message buffer overruns
no message buffer overruns
JACK server starting in realtime mode with priority 10
self-connect-mode is "Don't restrict self connect requests"
audio_reservation_init
Acquire audio card Audio0
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
JackTemporaryException : now quits...
Jack main caught signal 2
Released audio card Audio0
audio_reservation_finish

$

The error message is still there but it seems to run still. Don't know if example.midi is meant to sound but I do experience a second where it seems to stop sound from other programs, tested with firefox or aplay. Most likely do too jack acquires the card Audio0 and stops other programs from using it until it releases the card. Despite this I will mark this thread as solved since it does seem that FluidSynth works now. Thank you for the help.

Offline

Board footer

Powered by FluxBB