LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 08-05-2012, 07:01 PM   #1
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,240

Rep: Reputation: 196Reputation: 196
Rosegarden, FluidSynth, and JACK refuse to work


In 2008 when I used Slackware 12.1 I had the problem concerning Rosegarden and the music playback (see: the old thread). LinuxQuestions.org member ppr:kut helped me to solve that:

Quote:
This depends on what you want rosegarden to do. You will only need jack running if you want to play *real* audio files, like mp3, wave, etc inside rosegarden. For midi-playback you will need a softsynth like fluidsynth and a Soundfont. Start fluidsynth before you start rosegarden. If you then start rosegarden, everything should work fine. [...]
Now I use Slackware 13.37. Today I installed Rosegarden as well as all dependencies from SlackBuilds.org in the following order:

1. fontforge-20110222, XML-Twig-3.39, potrace-1.10, t1utils-1.37;
2. jack-audio-connection-kit-0.121.3, ladspa_sdk_1.13, liblo-0.26, mftrace-1.2.17;
3. lirc-0.9.0.tar.bz2, dssi-1.1.0, liblrdf-0.4.0, lilypond-2.14.2;
4. rosegarden-12.04;
5. fluidsynth-1.1.5, fluid-soundfont_3.1.orig (including fluid-soundfont_3.1-5.diff.gz).

I still would like to play MIDI files only but it seems the new FluidSynth uses JACK by default because the following command:

$ fluidsynth /usr/share/sounds/sf2/FluidR3_GM.sf2

displays the message:

Code:
fluidsynth: warning: Failed to pin the sample data to RAM; swapping is possible.
jackd 0.121.3

JACK is running in realtime mode, but you are not allowed to use realtime scheduling.
grep: /etc/security/limits.conf: No such file or directory
Please check your /etc/security/limits.conf for the following line
and correct/add it if necessary:

  @audio          -       rtprio          99

After applying these changes, please re-login in order for them to take effect.

You don't appear to have a sane system configuration. It is very likely that you
encounter xruns. Please apply all the above mentioned changes and start jack again!
fluidsynth: error: Failed to connect to Jack server.
Failed to create the audio driver
The above message is slightly misleading because it isn’t enough to put the mentioned line into /etc/security/limits.conf but one have to install Linux-PAM. I found the version for Slackware 13.37 here, installed it in the system, put into /etc/security/limits.conf the following line:

Code:
@audio          -       rtprio          99
and restarted the system.

I belong to the audio group of course:

$ groups
Code:
users floppy audio video cdrom plugdev power netdev scanner
According to jack-audio-connection-kit SlackBuild README:

Quote:
jackd has to run with realtime privileges. One way to do this on Slackware would be to use set_rlimits. Since 12.2 there's another way - if you have a filesystem that supports posix capabilities (reiserfs does not), you can grant jackd the rights to run in realtime mode [...]
Since I use ReiserFS the only method to run JACK in my case is to use set_rlimits. So I installed set_rlimits using the source found here and I put into /etc/set_rlimits.conf the following line:

Code:
myself /usr/bin/jackd  -1  80
where “myself” is my user name.

I tried to run JACK and FluidSynth using two methods – without realtime scheduling and using realtime scheduling:

$ jackd -r -d alsa
Code:
JACK compiled with System V SHM support.
loading driver ..
creating alsa driver ... hw:0|hw:0|1024|2|48000|0|0|nomon|swmeter|-|32bit
control device hw:0
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: 16bit little-endian
ALSA: use 2 periods for playback
$ fluidsynth /usr/share/sounds/sf2/FluidR3_GM.sf2
Code:
fluidsynth: warning: Failed to pin the sample data to RAM; swapping is possible.
fluidsynth: Jack sample rate mismatch, adjusting. (synth.sample-rate=44100, jackd=48000)
Type 'help' for help topics.

> fluidsynth: warning: Failed to set thread to high priority
and:

$ set_rlimits jackd -R -d alsa
Code:
JACK compiled with System V SHM support.
cannot lock down memory for jackd (Cannot allocate memory)
loading driver ..
creating alsa driver ... hw:0|hw:0|1024|2|48000|0|0|nomon|swmeter|-|32bit
control device hw:0
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: 16bit little-endian
ALSA: use 2 periods for playback
JACK: unable to mlock() port buffers: Cannot allocate memory
JACK: unable to mlock() port buffers: Cannot allocate memory
$ fluidsynth /usr/share/sounds/sf2/FluidR3_GM.sf2
Code:
fluidsynth: warning: Failed to pin the sample data to RAM; swapping is possible.
fluidsynth: Jack sample rate mismatch, adjusting. (synth.sample-rate=44100, jackd=48000)
cannot lock down memory for RT thread (Cannot allocate memory)
cannot use real-time scheduling (FIFO at priority 5) [for thread -1225540752, from thread -1225540752] (1: Operation not permitted)
Type 'help' for help topics.

> fluidsynth: warning: Failed to set thread to high priority
In both cases FluidSynth displays the similar but not the same warnings.

When I start FluidSynth without running JACK it displays the same warnings as at the beginning:

$ fluidsynth /usr/share/sounds/sf2/FluidR3_GM.sf2
Code:
fluidsynth: warning: Failed to pin the sample data to RAM; swapping is possible.
jackd 0.121.3

JACK is running in realtime mode, but you are not allowed to use realtime scheduling.

After applying these changes, please re-login in order for them to take effect.

You don't appear to have a sane system configuration. It is very likely that you
encounter xruns. Please apply all the above mentioned changes and start jack again!
fluidsynth: error: Failed to connect to Jack server.
Failed to create the audio driver
At the end I installed qjackctl-0.3.4 from SlackBuilds.org but the result of running qjackctl and FluidSynth is the same as the result of running FluidSynth alone in the above example.

My question is: how can I force FluidSynth and Rosegarden to work in order to make possible MIDI files playback?
 
Old 08-06-2012, 03:43 AM   #2
e5150
Member
 
Registered: Oct 2005
Location: Sweden
Distribution: Slackware
Posts: 73

Rep: Reputation: 41
First of all, I am assuming that midi playback is actually not working for you, while you imply that it doesn't, you don't explicitly state that.

(If I run `fluidsynth -a alsa ..../gm.sf2` I get the same warnings:

fluidsynth: warning: Failed to pin the sample data to RAM; swapping is possible.
fluidsynth: warning: Failed to set thread to high priority
fluidsynth: warning: Failed to set thread to high priority

but I'm still able to hook up my midi controller to fluidsynth, and it'll play the sound without a problem. (Notice that this is just pure alsa, no jack.))


You should be able to get rid of the "unable to mlock()" warnings from realtime jack by setting something like:
myself /usr/bin/jackd nice=-1 rtprio=80 memlock=800000
in set_rlimits.conf. And to get fluidsynth to run in realtime, just add a similar line for /usr/bin/fluidsynth, and run it through set_rlimits.
This should get rid of the warnings, and theoretically, get playback to work.

Also, depending on your sound card you might want, or need, to add some addition arguments to jackd for it to work decently, check out http://wiki.linuxaudio.org/wiki/reco...ckd_parameters

Maybe you would have more luck using timidity++ rather than fluidsyth...

Since I've never gotten rosegarden to function properly for my workflow I don't think I can be of any further assistance. (I've ended up using linuxsampler for midi playback (.sf2 and .gig), qtractor for track editing and nted for score editing, which might not be sufficient for your usage.)
 
1 members found this post helpful.
Old 08-06-2012, 11:11 AM   #3
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,240

Original Poster
Rep: Reputation: 196Reputation: 196
Thank you, e5150, for your kind assistance. I solved the problem completely thanks to you. The first and the second steps below failed (see also Postscript). The third step solved the problem.

So far I tested the MIDI files which I found in Internet or bought in the MIDI store. Now I tried also the simple MIDI files (ringtones which I prepared with Rosegarden a few years ago).

Both Timidity++ and Audacity play my MIDI ringtones as well as these free and commercial MIDI files properly.

1. First I tried ‘fluidsynth -a alsa /usr/share/sounds/sf2/FluidR3_GM.sf2’ and ‘rosegarden’ commands. In such a case Rosegarden played my MIDI ringtones but was mute during the playback of the mentioned free and commercial MIDI files.

2. Then I tried the other SoundFont named Chorium that I found in http://www.hammersound.net Sounds | SoundFont library | Collections using the commands ‘fluidsynth -a alsa /usr/share/sounds/ChoriumRevA/ChoriumRevA.SF2’ and ‘rosegarden’. The results were the same: Rosegarden played my ringtones but didn’t play the more complicated MIDI files.

3. At the end I tried the commands ‘timidity -iA’ and ‘rosegarden’. In Rosegarden I imported the commercial MIDI file and then I used keyboard button (Manage MIDI Devices). In MIDI Playback I selected General MIDI Device and in MIDI outputs I selected 128:0 TiMidity port 0 (write). In MIDI Recording I selected MIDI input system device and in MIDI inputs I selected 14:0 Midi Through Port-0 (duplex). Finally I closed that window. As a result Rosegarden plays MIDI files properly. (After importing a new file it is necessary to set MIDI outputs and MIDI inputs anew.)

Thank you very much once again.

Postscript

I tried ‘fluidsynth -a alsa /usr/share/sounds/sf2/FluidR3_GM.sf2’ and ‘rosegarden’ commands once again and after importing the MIDI file I set MIDI outputs and MIDI inputs. As a result Rosegarden plays these MIDI files properly. So it is possible to use FluidSynth or Timidity++ but it requires in both cases the proper Rosegarden configuration.

Last edited by w1k0; 08-06-2012 at 11:20 AM. Reason: PostScript
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Jack, Qsynth, Rosegarden and the low latency kernel problem.. rosspy Linux - Software 0 02-24-2008 08:18 PM
Jack server cannot be connected as client when opening Rosegarden Leela77 Linux - Newbie 0 06-06-2006 04:45 PM
Quick rosegarden + jack + timidity howto Linux.tar.gz Linux - Software 0 04-22-2006 06:03 PM
jack and rosegarden cabinetcrafter Linux - Software 1 02-04-2006 08:37 PM
issues setting up rosegarden/JACK/ALSA jgams Linux - Software 7 04-20-2005 01:42 AM


All times are GMT -5. The time now is 03:47 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration