[SLL] Camera + linux-rt, an update

Mathew D. Watson watson at visiongate3d.com
Sat Dec 27 08:40:20 PST 2008


/* I sent a similar message yesterday to the wrong address.
    My apologies if anything bad happened. */

***********
  so far with vanilla Ubuntu 8.04:

I haven't yet figured out what specifically causes the performance 
degradation when running my camera as a regular user as compared to 
root. The performance (measured in incomplete frames) weakly correlates 
to how hard the graphics processor is being pushed and strongly 
correlates to being root or notGallmeister, but that's about all I can 
say. Nice helps sometimes, but not often. The results are not repeatable.

***********
CONFIG_PREEMPT_RT - as per Glenn's suggestion to try Ubuntu Studio:

I put Ubuntu studio on an old machine that was handy. It is really large 
distribution (needs a dvd to install) and did not install with the real 
time kernel. According to some posts in the Ubuntu media forums, 
installing linux-rt is supposed to help with audio problems.

Somewhere along the way I discovered
Gallmeister
http://rt.wiki.kernel.org/index.php/Main_Page

which is implemented in the ubuntu linux-rt package.

Since the old computer was struggling, and I don't really need the media 
stuff, I decided to build a new system for experimenting. The hardware 
is comparable to the system above (8.04). The system runs Ubuntu 8.10 
with the CONFIG_PREEMPT_RT kernel (via the linux-rt package). 
Installation was a piece of cake. So easy that it took me the better 
part of a day to figure out if I had really accomplished anything. 
(Hint: install the manpages-posix-dev package) I finally found 
/usr/lib/librt.a, which contains some real-time modules.

The initial results are encouraging. I just ran a test and got 2 
incomplete frames out of about 1500 at 30 frames per second. That is not 
bad for a beginning. The best I can recall getting as a regular user on 
the other system is about 3 incomplete out of 100 at 30 fps. The only 
only configuration tuning I did was set the ethernet adapter's (intel 
Pro 1000 GT) max packet size (mtu) to 8000.

My manpages contain

sched_setscheduler - set scheduling policy and parameters (REALTIME)

which looks promising.

***********
Update to the update:

I wrote a bare bones C program to test it out. So far I've verified that 
this system supports the REALTIME scheduling calls, and I am able to set 
the scheduling policy to SCHED_FIFO (a real time algorithm).

The initial promising results were run with the standard scheduler 
(SCHED_OTHER), so I am looking forward to seeing some improvement with 
the real time schedulers.

Gallmeister [1] explains why changing nice really doesn't cut it for 
applications like this: the standard scheduler uses nice to control how 
many cpu cycles a process gets overall, but it does not specify when 
those cycles happen with respect to other processes.


I'll report back later with new results.

[1] Gallmeister, "POSIX.4, programming for the real world",p 154, first 
edition

Mat


More information about the linux-list mailing list