morgon
Posts: 68
Joined: Sun Dec 22, 2013 1:10 pm

MIDI sound issues

Wed May 07, 2014 6:17 am

Hi,

on my PC I use a MIDI-keyboard with jackd and fluidsynth (with a soundfont) and I can get a decent piano-sound (my PC does not have an external sound-card but has one integrated into the mainboard).

The same setup on the Pi works in principle but the resuting sound (speakers connected via the 3.5mm cinch) is awful.

I have not seen this big quality discrepancy when playing mp3s or streams. Here the Pi does not sound that much worse than my PC but here it does (in general playback of media on the Pi is of acceptable quality).

I now would like to understand why that is and what I can do about it.

Would an external USB sound-card improve the situation? If so would a very cheap one (e.g. Daffodil US01) be enough?

Or could it be that the process of "rendering" a soundfont via fluidsynth hits some other limitation of the Pi so that an external card would change nothing?

Any other ideas on what I could try?

Many thanks!

User avatar
AutoStatic
Posts: 326
Joined: Tue Jan 01, 2013 10:27 pm
Contact: Website

Re: MIDI sound issues

Wed May 07, 2014 7:12 am

morgon wrote:The same setup on the Pi works in principle but the resuting sound (speakers connected via the 3.5mm cinch) is awful.
Describe awful ;)
morgon wrote:Any other ideas on what I could try?
What JACK settings are you using?
RPi and real-time, low-latency audio: http://wiki.linuxaudio.org/wiki/raspberrypi
RPi audio repository: http://rpi.autostatic.com/
RPi and audio blog: https://autostatic.com/tag/raspberrypi/

morgon
Posts: 68
Joined: Sun Dec 22, 2013 1:10 pm

Re: MIDI sound issues

Wed May 07, 2014 8:33 pm

Describe awful
I don't know how to describe it properly, the sound is distorted, not clear.
What JACK settings are you using?
I run jack via "/usr/bin/jackd -dalsa -dhw:0 -r44100".

It is the jack from the raspian repositories, version 1.9.9. On my PC I use version 1.9.10.

I have added

@audio - rtprio 99
@audio - memlock unlimited
@audio - nice -19

to /etc/security/limits.conf, but that does not seem to make a difference.

morgon
Posts: 68
Joined: Sun Dec 22, 2013 1:10 pm

Re: MIDI sound issues

Wed May 07, 2014 9:56 pm

I have now tried to use the jack from rpi.autostatic.com but the problem persists...

User avatar
AutoStatic
Posts: 326
Joined: Tue Jan 01, 2013 10:27 pm
Contact: Website

Re: MIDI sound issues

Thu May 08, 2014 6:44 pm

morgon wrote:I don't know how to describe it properly, the sound is distorted, not clear.
Sounds like buffer under runs: http://www.linuxjournal.com/article/673 ... 0x19ba7ca0
morgon wrote:I run jack via "/usr/bin/jackd -dalsa -dhw:0 -r44100".
The onboard audio is not the best option for doing low-latency audio. Maybe it works better if you use JACK like this:

Code: Select all

jackd -P89 -t2000 -dalsa -dhw:0 -p256 -n2 -P -s
morgon wrote:@audio - rtprio 99
@audio - memlock unlimited
@audio - nice -19

to /etc/security/limits.conf, but that does not seem to make a difference.
That's right, setting these limits doesn't improve anything, you have to use them ;) The JACK incantation I mentioned earlier does that, it sets the rtprio for JACK to 89 instead of the default rtprio of 10.
morgon wrote:I have now tried to use the jack from rpi.autostatic.com but the problem persists...
The JACK version probably doesn't make a difference, it's the onboard sound that is probably the bottleneck. You'll get better results with an USB audio interface or with an external audio codec like the Wolfson Pi Audio Card.
RPi and real-time, low-latency audio: http://wiki.linuxaudio.org/wiki/raspberrypi
RPi audio repository: http://rpi.autostatic.com/
RPi and audio blog: https://autostatic.com/tag/raspberrypi/

morgon
Posts: 68
Joined: Sun Dec 22, 2013 1:10 pm

Re: MIDI sound issues

Fri May 09, 2014 5:04 am

Many thanks for your reply.

I have tried to start jackd with the parameters you suggested but that did not solve the issue.

In the meantime I have tried to run fluidsynth with "-a alsa" and not run jackd at all and in that setup the sound is ok. That seems to prove that it is indeed jackd that causes the problems.

For the time being I can live without jack, but I really would like to have a setup with jack eventually - is there anything else I could try?

Assuming that it is indeed jackd causing buffer underruns - would using an external sound card help? And if so what features one would have to look for in a card when digital audio processing is the goal? Would a something like a Daffoldil (I can it from Amazon for less then 5 Euros) be good enough or are there benefits in using a better card?



Many thanks!

Return to “Graphics, sound and multimedia”