raspnoobie
Posts: 15
Joined: Sat Apr 18, 2015 7:10 am

Fluidsynth and jackd on RPI3 (raspbian) - broken audio via headphone jack

Tue Jun 18, 2019 5:43 am

Hi,

I am running raspbian and I want to use fluidsynth to make a portable midi setup to connect to my usb midi keyboard.

I have installed jackd and fluidsynth; I run jackd with the following

Code: Select all

jackd -d alsa --device hw:0 --rate 44100 -p 512 &
I am using p as 512 because that's the only value that is allowed; if I use lower values I get an error when starting jackd

Code: Select all

ALSA: cannot set period size to 128 frames for playback
ALSA: cannot configure playback channel
ALSA: cannot initialize driver
Then I run fluidsynth as following

Code: Select all

fluidsynth --server --no-shell --audio-driver=jack \
        --connect-jack-outputs --reverb=0 --chorus=0 --gain=0.8 \
        /usr/share/sounds/sf2/FluidR3_GM.sf2 &
at this point, if I try to test audio with a midi file with

Code: Select all

 aplaymidi -p 128 mymidi.mid
the file play but play as broken.

my output for aplaymidi -l is

Code: Select all

14:0 midi through 
20:0 midi keyboard
128:0 fluid synth
Not sure why this is happening; I am able to play wav with

Code: Select all

aplay -D hw:0 myfile.wav
with clear audio. Same if I use fluidsynth to play the same exact midi file:

Code: Select all

fluidsynth --audio-driver=alsa -o audio.alsa.device=hw:0 /usr/share/sounds/sf2/FluidR3_GM.sf2 mymidi.mid
I thought that it was just the midi that was breaking up, so I plugged my usb midi keyboard, and tried with that, but the result is the same. The audio latency is quite high; and the audio is quite broken.

Code: Select all

aconnect 20:0 128:0
My usb keyboard is set at client 20 and fluidsynth at client 128.

Did anyone experience this? How do you fix it? fundamentally it is impossible to use at this point; with so much latency; from the midi keyboard.

I am running from text linux to minimize the latency, so I don't even start X server to use fluidsynth; but it seems that it is not enough

tvjon
Posts: 704
Joined: Mon Jan 07, 2013 9:11 am

Re: Fluidsynth and jackd on RPI3 (raspbian) - broken audio via headphone jack

Tue Jun 18, 2019 7:20 am

raspnoobie wrote:
Tue Jun 18, 2019 5:43 am
Hi,

I am running raspbian and I want to use fluidsynth to make a portable midi setup to connect to my usb midi keyboard.
...

I am running from text linux to minimize the latency, so I don't even start X server to use fluidsynth; but it seems that it is not enough


I wouldn't use jackd for that job.

Running X shouldn't make much difference to what you're trying to achieve.

Read through this short thread to see if it helps you.


viewtopic.php?f=41&t=235717

Return to “Graphics, sound and multimedia”