How to Get Rosegarden Sound Working on Fedora Linux

There are some great Rosegarden tutorials on the Internet and even some specifically dedicated to making sound using Rosegarden, e.g. this sourceforge tutorial. However, it took me quite some time to discover how to do it easily, on FC7, so here are some short easy notes that are up to date, keep doing out of date, but do not require the user to understand all the complexities of Rosegarden, ALSA, Jack etc.

I have also tried these instructions out on Fedora 8, and they work fine, but please note the reference to pulseaudio below. Apparently, these instructions work fine on Fedora 9 without any changes. If anyone would like to try them on Fedora 10, 11 and 12 then feed-back, please email me at dwlegg [at] gmail [dot] com. See the email at the bottom for how to make them work in Ubuntu Intrepid and Linux Mint 5.

Of course, the simplest way of getting sound out of Rosegarden is just to export your composition to a MIDI file, then to use timidity++ (or another suitable MIDI synthesiser) to play it.

The next simplest way is simply to provide Rosegarden with a MIDI daemon to use to make sound through. This can be achieved by running timidity++ before starting Rosegarden:

timidity -iA

then start Rosegarden in the usual way. It works with Rosegarden in this way out-of-the-box, and I personally find that it produces better quality sound than you get by following the rest of this tutorial and using jack, qsynth etc. The above command works on Fedora 8, 9, 12 and 13, maybe on 10 and 11 (but not when I last tried.)

On Fedora 14 and 15, the following approach works and has proved reliable for the last few weeks :) Create a new KDE application icon called, say, Rosegarden with Timidity. Use the 'Advanced' button to make KDE run a command in a shell, then choose an icon, perhaps with a rose on it. Put the following command into the Application/Command and Work Path fields:

rosegarden & (sleep 10; timidity -iA -Oj)
This will start Rosegarden when you click on the new icon, wait 10 seconds and then start timidity. You can see timidity connecting to the jackd ports that rosegarden creates. After that you can load a rosegarden file and the sound will work. Make sure that in the rosegarden Edit->Preferences menu the sequencer status says 'MIDI OK, Audio OK'. Also make sure that 'Use Jack Transport' is ticked, and also the 2 boxes after 'Make default jack connections for', called 'audio outputs' and 'audio inputs'.

However, if you still want to do Rosegarden with qsynch, jack and get real-time sound without any delay, read on ...

This guide uses a relatively simple arrangement of just three programs, like this:-
Picture of how ALSA, Rosegarden and Jackd relate

I am assuming:
  1. That you're using Fedora Core 7 (FC7) or Fedora 8 with SELinux disabled.
  2. That you have an Internet connection so that you can use yum.
  3. That you are using KDE V3.x, since Rosegarden is a KDE application.
  4. That you do not have a sound card that supports MIDI directly (because most of us don't).
1. Get the packages using yum
su -
yum install qsynth jack qjackctl lilypond rosegarden4 perl-XML-Twig
2. Edit the /etc/security/limits.conf file
The installation of jack will put this stuff at the bottom of your /etc/security/limits.conf file, meaning that only users in the jackuser group can use Jack.
## Automatically appended by jack-audio-connection-kit
@jackuser - rtprio 20
@jackuser - memlock 4194304
However, most users will want anyone to be able to use jack, so edit the file to look like this instead:
## Automatically appended by jack-audio-connection-kit
#@jackuser - rtprio 20
#@jackuser - memlock 4194304
*       -       rtprio 20
*       -       memlock 4194304
After this, you *must* reboot your system for the security-related real-time sound changes to take affect.

3. Get some sound fonts and install them in Qsynth
The tutorial that I referred to above suggests getting some sound fonts from here.

Unzip them and load them into Qsynth like this:
Qsynth setup menu to load sound fonts

4. Match settings in Jack and Qsynth
Here are some settings for qjackctl and qsynth that seem to work for me using an AMD 64 3500 (64 bit) on FC7 with a kernel-2.6.23.8-34.fc7 kernel. I have noticed that feeble processors (<3GHz ish) with on-board sound do not make a good job of doing real-time sound synthesis using jack. You really need a fast processor or a decent sound card or both. The important thing is to make qsynth and jack compatible with each other, or you will get no sound. Start qjackctl and qsynth from the KDE menus in that order.

qjackctl setup with command: artsshell -q terminate
Note the command 'artsshell -q terminate' in the qjackctl setup window above. This is useful because it kills the KDE sound daemon that would otherwise prevent jackd from talking directly to ALSA (in other words you would get no sound, and perhaps an error message.)
In Fedora 8, you also need to kill the pulseaudio daemon, so the command is:

artsshell -q terminate; pulseaudio -k

Also, and this is important, make sure that the 'Start JACK audio server on application startup' box is ticked under the Misc tab in the qjackctl setup.

qjackctl setup with Force=16bit and SampleRate=48000 entries
The entries 'Force 16bit' and SampleRate=48000 particularly need to match in qjackctl and qsynth. Others may require some experimentation to get your sound sounding good. The entry, Interface=hw:0, will often make the difference between sound and nosound.

qsynth setup with MIDI input enabled
Remember to enable MIDI input in qsynth. That's what it's for :).

qsynth setup with auto-connect Jack selected
The entry 'Auto-connect Jack Outputs' will enable you to start jack, Rosegarden and qsynth such that all the connections via jackd get made automatically. This saves a lot of hassle.

5. Check that the Rosegarden settings are sensible
Rosegarden setup using jackd transport
Tell Rosegarden to use the Jack transport.

Rosegarden setup not starting jackd automatically
No need to tell Rosegarden to start jack, as we will see in a minute. N.B. that the Jack Command is not needed if this guide is followed fully.

6. Test your Rosegarden, Jack and Qsynth Set-ups
From the KDE menus, start in this order: qjackctl, qsynth and rosegarden. There should be no error messages. The jackd transport should start automatically. Load a file into Rosegarden and hit the play button. The MIDI output from Rosegarden will immediately become sound! :) If not, turn on the log files in qjackctl and qsynth and start debugging or googling. If you get xruns in the jack log file and horrid sound quality, you either need to fiddle with the jack and qsynth setups, or you need a faster processor :(

7. Make Rosegarden, Qsynth and Jack start and stop together with a single click
Of course, if you start all three programs from the KDE menus, you have to do it in the right order. Then you have to kill them all individually too, which is a bit of a pain. Here is a script that can be run from a KDE icon easily. It starts and stops all three programs nicely:
#!/bin/sh
# V1.0 DWL 22/12/2007
qjackctl &
sleep 2         # Wait for qjackctl to start jackd
qsynth &
rosegarden --nofork
#
# Kill qjackctl, jackd and qsynth when rosegarden exits.
ps -ef | grep qsynth | grep -v start | awk '{print "kill -15 " $2}' | sh
ps -ef | grep jack   |                 awk '{print "kill -15 " $2}' | sh
exit;

Remember to chmod 755 the script and to reference it from a KDE icon so that you can start Rosegarden and its friends together.

Please send any improvements to this guide to dwlegg a t gmail d o t com.


Back to Main Menu Examples of Rosegarden files and MIDI files on this site: Father of Mercies Immortal Honours Our God, Our Help in Ages Past

Valid HTML 4.0 Transitional

Here is an email explaining how to make these above instructions work with other distributions:-

from	Maurice maurice.d at somewhere
to	dwlegg at somewhere.com
date	3 November 2008 13:26
subject	Rosegarden sound
mailed-by	tiscali.co.uk
	
hide details 3 Nov (3 days ago)
	
	
Reply
	
	
Hi,

Thank you for your Howto on getting Rosegarden sound working on Fedora
Core 7 and Fedora 8. I can confirm that the same instructions work fine
on Fedora 9 without any alterations. I have also used the same
instructions to configure Rosegarden in Ubuntu Intrepid and linux Mint 5
with the following minor changes.

Install Rosegarden from Synaptic Package Manager. The package includes
qjackctl, lilypond and jackd. Also from synaptic install qsynth,
libxml-twig-perl, xml-twig-tools and sox.

There was one error message complaining rosegarden is unable to find
snd-rtctimer. This was solved by changing a setting in Rosegarden,
Settings > Configure Rosegarden > Midi > General tab and changing
Sequence Timing Source from auto to system timer. Two minor changes to
the start up script made it more stable on Ubuntu. Increase the sleep
time to 7 seconds to give Jack time to start before Qsynth loads and add
a 2 second sleep between Qsynth and Rosegarden.

Once again, thank you for sorting out sound in this great software that
is now working perfectly.

Best wishes

Maurice