Increasing CPU usage while recording

8 replies [Last post]
toersi
User offline. Last seen 1 year 16 weeks ago. Offline
Joined: 2007-03-04
Posts:

Hi @ everyone!

I'm really looking forward for the version 2 of Ardour! Until now, I used Windows for recording with my 2 SEKD ARC88 cards. After writing an ALSA Driver for this cards, I tried this with Ardour (using last svn version). 8 Channels recording is no problem.

But the problem is, that with proceeding recording the CPU usage is increasing. At beginning recording the CPU usage is at about 40%. When the recording pointer arrives the right side of my screen the CPU is at 100% usage. After flipping the screen to a new side, it falls down to nearly 40%.

Tring with version 0.99 of Ardour, the usage is nearly constant at 40%.

I have a Pentium 4 with 2 GHz and 256 MB of rom and ubuntu-studio. Is there a change in version 2 causing this issue or is my system just to slow? Does anyone have the same problem?

SK
User offline. Last seen 6 years 49 weeks ago. Offline
Joined: 2007-01-23
Posts:

This amount of CPU useage is unusual high. I normally have below 10%.

First thing:
Does jackd run in realtime mode? ("ps -C jackd -cmL" -> two FF threads or only TS?)

Second thing:
256MB of RAM are very low. Maybe your system already starts to swap. Check with "free" how much is used.

If you have a realtime system you shouldn't use swap, because this can trigger problems. Therefore you should have at least something more than enough RAM, maybe get another 512MB or 1GB. Then try to disable swap with "swapoff -a".

Third thing: (least likely)
You harddrive might be the bottleneck, even if it should be fast enough, it could be a problem when it's amost full (over 80-90% depending on the filesystem). If you record to a USB-Drive it could be connected via slow USB1.1 or just be too slow. (Recording to an USB-Drive caused 1 minute drive activity after 5 mins of recording for me one time. That minute was cached in system RAM.)

toersi
User offline. Last seen 1 year 16 weeks ago. Offline
Joined: 2007-03-04
Posts:

Jack is running in real mode. I don't have in mind which threads are running. I don't think its because of swapping or harddisk, since there is a direct depenency between the position of the recording pointer on the screen and the cpu load.

As I wrote, ardour version 0.99 has a constant load of 40 percent.

I don't have my recording system here, so I can give you detailed answers after the weekend.

SK
User offline. Last seen 6 years 49 weeks ago. Offline
Joined: 2007-01-23
Posts:

It also could be a problem with the graphic card.

Try to run "glxgears" while recording and look at reported CPU load of ardour and the FPS of glxgears. I get about 4500 FPS and ardour is not affected if running in realtime.

toersi
User offline. Last seen 1 year 16 weeks ago. Offline
Joined: 2007-03-04
Posts:

I tested some configurations as you said. I upgraded my memory to 512 MB and turned off swaping. The usage of my harddisk decrease, but the CPU load is nealy the same as before. OpenGL of my Nvidia graphic card is also running. I made a screenshot to show you how it looks like:
(Click for better resolution)

I tested it also on my Laptop (1,8 GHz 1200 MB ram) and its nealy the same.

SK
User offline. Last seen 6 years 49 weeks ago. Offline
Joined: 2007-01-23
Posts:

This is truely strange but one thing jumps to my mind:
* Ardour reports 4.5% useage which is normal.
* In older kernels there was a bug which could result in just this behaviour.

The CPU-Time is counted wrong in some situations with realtime enabled. I don't know how to check the real CPU-useage without upgrading to a newer kernel that fixes this bug.

As long as the CPU useage reported by ardour is that low there should be no problem because the time-critical parts have enough time to compute even with total CPU-load of 100%.

It's strange anyways.

toersi
User offline. Last seen 1 year 16 weeks ago. Offline
Joined: 2007-03-04
Posts:

I don't think its because of the kernel. On that machine kernel 2.6.20 with low-latency patch is running and on my laptop with 2.6.17 (normal) it is nearly the same.

top shows 60% for the ardour process and 20% for Xorg. The recording is not affected as you said, but I think I will get problems with using playback plugins at the same time.

sampo
User offline. Last seen 11 weeks 1 day ago. Offline
Joined: 2006-03-16
Posts:

Current SVN should be fixed thanks to Paul. You should try it and tell us if it helped.

Thanks for the report.

toersi
User offline. Last seen 1 year 16 weeks ago. Offline
Joined: 2007-03-04
Posts:

I updated to the current svn version and everything seems to be fine! Many thanks to Paul! And thanks for helping!