[linux-audio-user] Jack and SHM

Steve Harris S.W.Harris at ecs.soton.ac.uk
Thu Jan 22 05:13:41 EST 2004

cc'd to jackit-devel list.

This is a tricky problem. There was some concern about this previosuly.
I wonder if its possbile to inspect the library map locations (ala 
"cat /proc/$$/maps", libelf maybe?) and selectivly munlock the ones that
are known to be realtime unsafe (toolkits basicly).

Its a bit of a gruesome hack, but it may help.

- Steve

On Thu, Jan 22, 2004 at 10:48:36 +0100, Robert Jonsson wrote:
> On Thursday 22 January 2004 09.45, Christophe Vescovi wrote:
> > Since there has been a lot of post concerning jack usage and
> > optimisation recently it has remind me a problem I got that I never been
> > able to understand.
> > I have never been able to run jackstart with -R option when compiling
> > jack with Sys V shm support. jackd -R as root work with SysV shm but if
> > I want to use jackstart I have to use POSIX shm.
> > The error message I am getting with SysV shm is the classical "cannot
> > lock down memory for RT thread (Cannot allocate memory)".
> > I am running a Mandrake 9.2 multimedia kernel (2.4.22, low latency,
> > preemption and capability patches).
> > Since most of jack users seem to use SysV shm I don't understand why I
> > cannot (I am the only exception ....)
> >
> > Christophe
> Hi Christophe,
> I'm glad you brought it up, I have this problem too (actually with an Mdk9.2 
> system but I don't think it's related) and have forgotten to report it back 
> here.
> I've done a fair bit of investigation in this area. The problem seems to be 
> that when locking the program tries to lock _all_ memory that the program 
> touches. 
> If you have DRI running in your X configuration (as I do) and utilize a QT 
> based program (as I do) there is a major problem. (It probably is similar 
> with other toolkits.)
> I'm not sure of this but evidence suggest that QT maps the graphic memory 
> (available through DRI) into it's memory space.
> What this means in reality is that with my 128mb graphic card QT apps occupy 
> 300mb of memory(!). With 512mb physical memory I sometimes manage to lock ONE 
> application, but never two.
> My "solution" has been to limit the amount of graphic-memory the x-server is 
> allowed to use by adding this line to the XF86Config-4 in the Section 
> "Device":
> VideoRam   32768
> thus limiting it to 32mb memory, which is quite enough for me.
> Another solution is to remove DRI, but I use it so it can't be removed.
> ---
> That there is a difference if you build with POSIX shm vs SysV shm I didn't 
> know. I guess there are still other problems with POSIX shm that keep you 
> from using that ?
> Regards,
> Robert

More information about the Linux-audio-user mailing list