Ardour 2.3 on Ubuntu Hardy - 100% cpu

No replies
doloras
User offline. Last seen 5 years 47 weeks ago. Offline
Joined: 2008-05-08
Posts:

The upgrade to Ubuntu Hardy and thus to Ardour 2.3 seems to have broken my system. Simply put: I open an Ardour session and the CPU use jumps to 100% and stays there. It takes something like ten seconds for the program to register when I try to select a different sound file. It will play a session fine, but doing any real editing (let alone trying to run a sequencer at the same time!) causes overload, crashes etc. It doesn't seem to be anything to do with the plugins - disable or enable, it's still 100% CPU. The really weird thing is that the programme doesn't want to close down! It ignores a "Quit" command from the menu - I can "Close" the session and then quit from the next window but - here's the surprise - check System Monitor and the Ardour session is STILL running, consuming 50% of CPU.

Hardware specs: Celeron 2GHz processor, 768M RAM, running kernel 2.6.24-16-rt.

Any suggestions? I can't see this anywhere as an already-noted bug.

Benjamin Scherrer
User offline. Last seen 1 day 15 hours ago. Offline
Joined: 2006-07-27
Posts:

Hi,

don't know what's the matter there... could you tell us your jackd version?

Also, are you familiar with kernels? Is this a self build kernel, or the -rt kernel from the Ubuntu Studio project?
Can you try another one?

Benjamin

L1nX
User offline. Last seen 38 weeks 3 days ago. Offline
Joined: 2006-04-18
Posts:

Just note that on Hardy they seem to have automatically enabled dynamic CPU scaling.

You can do a: sudo apt-get install cpufrequtils
and then run: sudo cpufreq-set -g performance
to get the most performance from your CPU (ie: No underclocking it)

You can also uninstall powernowd (I think :P) which will disable the cpu scaling.

It tied me up for a while.

Also while you're at it, it is a good idea to install the rt kernel in the Ubuntu repos by doing a:
sudo apt-get install linux-rt

You can also install the ubuntustudio metapackages to install lots of audio plugins and applications, should you require: ubuntustudio-video, ubuntustudio-audio, ubuntustudio-graphics, ubuntustudio-audio-plugins

Cheers

TomB
User offline. Last seen 46 weeks 3 days ago. Offline
Joined: 2006-11-29
Posts:

Thanks for the useful info on cpu scaling. Why on earth would they enable that by default?

Anyway, my audio apps run a lot smoother now on my Hardy box :-)

doloras
User offline. Last seen 5 years 47 weeks ago. Offline
Joined: 2008-05-08
Posts:

Ok, tried as advised (disabling freq scaling) and it seems to make not a lot of difference. I am using the Ubuntu Studio default RT kernel (as I said above, 2.6.24-16-rt), and jack version 0.3.2. I'll try the generic kernel but I'm not sure it will be any better.

TomB
User offline. Last seen 46 weeks 3 days ago. Offline
Joined: 2006-11-29
Posts:

Hmm, I don't think Using the generic kernel will improve your situation. Seems to be something with your set-up, as I'm not experiencing any of the issues you have. As I'm typing this I'm playing back a Rosegarden midi sequence to QSynth, synced to a Hydrogen drum sequence and an Ardour session containing the vocals with some fx plugins, all without a glitch and CPU at about 15%.

I do have a better spec machine though (AMD X2 4400+ with 1G RAM), but still you should be able to use Ardour normally. Possibly some stuff broke during the upgrade? Is an install from scratch an option? Upgrading from Gutsy to Hardy broke my display, so the method isn't flawless for sure.

doloras
User offline. Last seen 5 years 47 weeks ago. Offline
Joined: 2008-05-08
Posts:

I really don't want to reinstall my entire system, as my UbuntuStudio is highly customised and I really don't want to go through doing that again.

Further experiment: opening a new session, the CPU usage only goes from 25-40%. It's the older sessions, which I recorded in the last version of Ardour in Ubuntu Gutsy, that demand a 80-100% CPU load.

Benjamin Scherrer
User offline. Last seen 1 day 15 hours ago. Offline
Joined: 2006-07-27
Posts:

Doloras,

could you post the entire *.project file of an older session that consumes 80-100%cpu somewhere (maybe your own webspace or so, but there should be free spaces around to keep the code for a week or so)?

Maybe we can find out what's wrong there.

Benjamin

p.s. In linux, there's no need to reinstall the system, even if major things went wrong - it can always be changed without redoing everything. If people do or recommend so, they don't know enough about this.

TomB
User offline. Last seen 46 weeks 3 days ago. Offline
Joined: 2006-11-29
Posts:

p.s. In linux, there’s no need to reinstall the system, even if major things went wrong - it can always be changed without redoing everything. If people do or recommend so, they don’t know enough about this.

While this is very true, sometimes reinstalling (ans thus reconfiguring) from scratch is easier and quicker than finding the solution for a broken system.

doloras
User offline. Last seen 5 years 47 weeks ago. Offline
Joined: 2008-05-08
Posts:

Thanks, Benjamin. I'm not sure what you mean by a .project file - there's a .ardour file, if that's what you mean, or do you mean the entire project folder?

Benjamin Scherrer
User offline. Last seen 1 day 15 hours ago. Offline
Joined: 2006-07-27
Posts:

doloras:

Sorry, this was a very bad typo ;) I meant the .ardour file, you are right.

If you don't find a place to post it, you could send it to me via e-mail "realhangman (you know what to fill in here) web.de", I'll post it on my website and post it here.

I know http://rafb.net/paste, but this expires after 24 hours, not so good for a forum conversation and archives.

TomB: true ;)

Benjamin

doloras
User offline. Last seen 5 years 47 weeks ago. Offline
Joined: 2008-05-08
Posts:

Done - http://posthypnotic.randomstatic.net/Abomination.ardour

Benjamin Scherrer
User offline. Last seen 1 day 15 hours ago. Offline
Joined: 2006-07-27
Posts:

hi,

unfortunately the code seems to be incomplete. There is at least a closing
tag missing, but much more. Could you check this? The xml is invalid if it's not complete and Ardour cannot read it.

Have you considered asking for real time help on irc?

Benjamin

Benjamin Scherrer
User offline. Last seen 1 day 15 hours ago. Offline
Joined: 2006-07-27
Posts:

whoooooooooops!

Sorry! What's missing here is a good version of Opera! It only shows me a part of the page, firefox is working...

ok, forget my last posting, it's complete. I'll have a look at the file.

Benjamin

Benjamin Scherrer
User offline. Last seen 1 day 15 hours ago. Offline
Joined: 2006-07-27
Posts:

First impression:

Works normal. I have 1 GB Ram and a 2 GHz AMD Athlon and have about 5 % cpu usage. Of course I don't have the wav files, but the rest project loads. I only tells me about a missing plugin ("1767"), but I don't think it matters.

Ok, some more things to do:

1. try to play with somewhere like Options -> Denormals (but I see you have already enabled an option... maybe another?

2. Upgrade to 2.4.1
(adding
deb http://ppa.launchpad.net/spacepluk/ubuntu hardy main
to /etc/apt/sources.lst should do it)

see
http://www.mail-archive.com/ubuntu-studio-users@lists.ubuntu.com/msg01897.html

3. check realtime mode - how do you start jackd? Via the Ardour dialog, or via qjackctl?
how is your /etc/limits.conf looking?

4. for all this step-by-step, better enter
#ardour at freenode :)
http://ardour.org/support

Benjamin

doloras
User offline. Last seen 5 years 47 weeks ago. Offline
Joined: 2008-05-08
Posts:

Thanks for all that. Have upgraded to 2.4.1 now. I seem to have put my finger on something - when I start jackd via qjackctl, the same problem recurs (though it takes more time before the 100% cpu now). However, when I start via the Ardour dialog, no problem - quick and clean. The problem is that I need to sync up Ardour with sequencers and software synths (Rosegarden) in particular and I'm pretty sure I need a qjackctl interface to do that. Is this a recognized problem with qjackctl, and if so, where can I get information on it?

I've tried all the denormals settings and none of them seem to make much difference. I don't have an /etc/limits.conf - should I? I'm not sure what I'm supposed to be looking for in "realtime mode".

Benjamin Scherrer
User offline. Last seen 1 day 15 hours ago. Offline
Joined: 2006-07-27
Posts:

Hi doloras,

great! If everything works fine when using the Ardour - audio dialog, it's propably gotta to with some qjackctl configuration (great because we are getting closer to resolve this completely).

You don't have to change anything in Ardour now, because the problem seems to be before Ardour. The realtime file might be in /etc/security/limits.conf, but this does not matter anymore, because if there would be something wrong, it wouldn't work with the Ardour audio dialog either.

So now we should check the configuration of qjackctl. Normally, qjackctl saves a file called ".jackdrc" to your home directory (hidden because of the dot). Do you find this file? Could you post the content of it here? It's propably only 1 line.

Ardour should save it's audio configuration to ".ardour2/ardour.rc". This one is abit longer, but could you also post the content here? We need the part between
AudioSetup
.
.
.
/AudioSetup
but you could also post the entire file.

Which version af qjackctl do you use?

Cheers,
Benjamin

doloras
User offline. Last seen 5 years 47 weeks ago. Offline
Joined: 2008-05-08
Posts:

I'm using qjackctl 0.3.2-1ubuntu1. I should note that it's working a little better since I ticked "No memory lock" in Jack setup. Now I can run Ardour and Rosegarden in sync with a hardware synth - barely (CPU still at or near 100%). But Ardour plus Rosegarden plus software synth is still impossible.

.jackdrc contents as follows:

/usr/bin/jackd -R -m -dalsa -dhw:0 -r44100 -p1024 -n2 -s -Xseq -zs

.ardour2/ardour.rc contents as follows (angle brackets changed to square brackets):

[AudioSetup]
[periods val="2"/]
[priority val="60"/]
[ports val="128"/]
[inchannels val="0"/]
[outchannels val="0"/]
[inlatency val="0"/]
[outlatency val="0"/]
[realtime val="0"/]
[nomemorylock val="0"/]
[unlockmemory val="0"/]
[softmode val="0"/]
[force16bit val="0"/]
[hwmonitor val="0"/]
[hwmeter val="0"/]
[verbose val="0"/]
[samplerate val="48000Hz"/]
[periodsize val="1024"/]
[serverpath val="/usr/bin/jackd"/]
[driver val="ALSA"/]
[interface val="C-Media PCI DAC/ADC"/]
[timeout val="Ignore"/]
[dither val="None"/]
[audiomode val="Playback/Recording on 1 Device"/]
[inputdevice val="C-Media PCI DAC/ADC"/]
[outputdevice val="C-Media PCI DAC/ADC"/]
[/AudioSetup]

I hope it's not anything to do with the budget soundcard I'm using at the moment while I save up for a pro-quality one.

Benjamin Scherrer
User offline. Last seen 1 day 15 hours ago. Offline
Joined: 2006-07-27
Posts:

Hi,

I see 2 main differences between the Ardour audio setup and qjackctl configuration:

1. In qjackctl, you use 44.1 kHz sample rate, in the Ardour audio setup you use 48 kHz
2. The Ardour audio setup does not start jackd in realtime mode whereas qjackctl does.

Activate "Realtime" under the option tag and set the sample rate to 44.1 kHz in the device tag, then start your session and report if it's again at 100% cpu.

Please have a look at /etc/security/limits.conf (or search your system for a limits.conf file). At the end of the file, there should be some lines without a "#" in front of. Post them here.
Then, type "groups" into a terminal (as normal user) and give us the output here.

Benjamin

doloras
User offline. Last seen 5 years 47 weeks ago. Offline
Joined: 2008-05-08
Posts:

Selecting 44.1 kHz and realtime in Ardour audio setup actually makes things a bit better - I can play comfortably at a latency of 512, which I couldn't before. But as stated, I need qjackctl, or some other way to sync with Rosegarden, Hydrogen etc.

From /etc/security/limits.conf:

@audio - rtprio 99

@audio - memlock 512000

And:

Sebastienne:~$ groups
root adm lp dialout cdrom floppy audio dip video plugdev scanner netdev lpadmin powerdev admin

mtaht
mtaht's picture
User offline. Last seen 3 years 46 weeks ago. Offline
Joined: 2006-12-02
Posts:

In a long irc conversation last night I discovered 4 things about ubuntu hardy.

1) As shipped in Hardy, Jack and Ardour are apparently compiled with SSE disabled. SSE is really critical to performance, recompile your jack with --enable-dynsimd. I honestly don't know how to turn off SSE in ardour, it always comes up with SSE when I compile it myself.

You will see "SSE" on the output of both jack and ardour when they start, if it is enabled.

2) As shipped in Hardy, the sound drivers all talk to pulseaudio by default. You need to get pulseaudio out of the picture. I've seen how to do this for ubuntu fiesty, but not hardy. Google for pulseaudio jack fiesty.

3) Compiz is enabled in Hardy. While pretty, it's hard on the cpu and the bus.

4) irqbalance is not installed by default.

L1nX
User offline. Last seen 38 weeks 3 days ago. Offline
Joined: 2006-04-18
Posts:

When I load jack (From the ubuntu repo) I see:
Enhanced3DNow! detected
SSE2 detected

Another thing is that (at least for me and one or two others) it appears disabling the "nohz" option of the kernel improves performance at the moment.

Look for something similar to this in /boot/grub/menu.lst:
title Ubuntu hardy, kernel 2.6.24-16-rt
root (hd1,1)
kernel /boot/vmlinuz-2.6.24-16-rt root=UUID=a118dfcd-89d1-4aa7-8be9-85e206edf080 ro quiet splash

And add to the end of the kernel options:
nohz=off

Hopefully that will make some improvements.

doloras
User offline. Last seen 5 years 47 weeks ago. Offline
Joined: 2008-05-08
Posts:

Thanks for your help. But I am afraid that I am completely ignorant about how to go about recompiling jack. Plus, the links given about pulseaudio go into great detail about how to turn it on, not turn it off.

It is looking increasingly like the upgrade to Ubuntu Hardy has broken Ubuntu Studio.

Benjamin Scherrer
User offline. Last seen 1 day 15 hours ago. Offline
Joined: 2006-07-27
Posts:

Hi,

I wouldn't recommend compiling these things by yourself if you aren't familiar with it. It also has the big disadvantage that you would need to compile every new version, because if you compile things yourself, you obviously don't get updates via synaptic or alike.

I think one should talk to the ubuntu people. Doloras, are you using ubuntu studio 8.04 or the normal ubuntu 8.04 release with a realtime kernel?

If these are really problems of ubuntu studio, the maintainers should fix these things. Maybe someone using ubuntu studio could hook up with these people?

@doloras:

You could change your /etc/security/limits.conf
line
@audio - memlock 512000
to
@audio - memlock unlimited

This is the only improvement to the file I know of.

Which realtime priority are using with qjackctl? It should be displayed under options.

Benjamin

doloras
User offline. Last seen 5 years 47 weeks ago. Offline
Joined: 2008-05-08
Posts:

Thanks, Benjamin. I am using Ubuntu Studio 8.04, and I certainly intend to take up the suggestions you guys have raised with the maintainers once I get a few minutes leisure time!

I'm using the "(default)" option for realtime priority in qjackctl. Have you got a better suggestion?

I'll try removing the memlock point when I get home from work and give a further report.

doloras
User offline. Last seen 5 years 47 weeks ago. Offline
Joined: 2008-05-08
Posts:

All right, guys, partial breakthrough - adding the "nohz=off" line to grub means that jackd is not crashing any more - but Ardour still is. Thanks for the recommendation.

Specifically: what I am trying to do is running a sequence from Rosegarden into ZynAddFX software synth and trying to record it on Ardour. Before, trying to run the sequence would instantly bring down jackd's MIDI module, crashing Rosegarden. Now, Rosegarden stays up and plays the sequence happily - but Ardour won't record, giving a "your disk system wasn't fast enough to keep up" error.

So, I feel I'm getting closer to solving the problem here! I know that the "disk system not fast enough" error is quite a common one - can someone give me some tips? If you also had time, you could tell me how to stop the error on startup which tells me that connection to the Mackie control surface failed. I don't have a Mackie control surface, I never have, I don't even know what one looks like, but Ardour 2.3 and 2.4 seem upset about this for some reason. :)

nowhiskey
User offline. Last seen 3 weeks 6 days ago. Offline
Joined: 2006-09-30
Posts:

for the last of your questions go menu->options->sync
and disable the mmc stuff. it should help.
you ll have to do this for every session once, since it is the default setting for some time now and is always turned on an a session creation.

cheers,
doc

doloras
User offline. Last seen 5 years 47 weeks ago. Offline
Joined: 2008-05-08
Posts:

Okay, thank you, everyone. It seems obvious in retrospect that my problem was the recognized big problem with inflated jackd latencies which has been reported by many users of Ubuntu Hardy. When I added the following to limits.conf:

"@audio - nice -19"

and unchecked both "unlock memory" and "no memory lock" in qjackctl, and cranked up the Ardour latency REAL high, I finally managed to get sequencing and Ardour working together. Now I just have to figure out why Rosegarden crashes for no reason, and I should be set. :)

CaseyShultz
User offline. Last seen 1 year 10 weeks ago. Offline
Joined: 2008-07-02
Posts:

Benjamin, thanks for posting the repository for 2.4.1. I've been banging my head against a wall trying to find the info from the Ubuntu forums. That was a real help. :)

Casey Shultz

SciFi Surplus
News, Talk, Geeks and Fun!
http://scifisurplus.com