Triode wrote: 
> Thanks - will look at this; I was definately going to change it, perhaps
> we make it an option when the uname includes PREEMPT in it?
> 
> Could you also try with:
> 
> #include <sys/mman.h>
> 
> if (mlockall(MCL_CURRENT | MCL_FUTURE) == -1) {
>       LOG_INFO("unable to lock memory: %s", strerror(errno));
> }
> 
> Edited:
> 
> This will only work as root or if the user is allowed to lock memory. 
> I'm interested if you see any benefit from doing this.  
> 
> Given there are mutexs between the real time thread and non real time
> threads, I think the easiest way to lock memory is just to lock all of
> squeezelite's memory.  I did thinking about only doing this for the
> output thread, but this would need to wait for a page fault in the other
> threads if they held the output mutex.  Hence I think locking everything
> is the only simple way to lock memory - but do you notice any
> difference....?

Yep. I had a similar thought. You probably can't just lift the output
thread up only. The entire chain ( internal threads and externel
tasklets/IRQs etc ) needs to be in tune. Otherwise it gets bumpy (maybe
a reason for the rather high buffer settings I experience).

I actually chrt'ed squeezelite. Setting  chrt to 40 from the outside
would obviously put all threads on the same level with 09b11. That also
lifts the stream thread. Now with my patch  in place I can allign the
stream.c and output.c threads to the same and also other then default
levels.  
Maybe chrt'ing  the stock 09b11 to higher levels is similar then not
applying anything (on preemtible kernels) to it. The whole thing gets
out of balance. 

Another idea: Perhaps on preemtible kernels SCHED_FIFO shouldn't be
automatically applied by SL. Maybe it's better to apply only, if option
"-p <prio>" is given.

What threads would have to be boosted?? I'd guess only the misson
critical threads - those who line up as playback chain -  need to
(should ??) be boosted or  "tuned". 
stream and output and if codec are involved the codecs in between?? I
don't have a clear picture of the entire chain. I guess it's not that
easy to trace.


I'll checkout the memlock patch. 
The memlock can be used by normal users, if it is set  in limits.conf -
see some posts earlier.


------------------------------------------------------------------------
soundcheck's Profile: http://forums.slimdevices.com/member.php?userid=34383
View this thread: http://forums.slimdevices.com/showthread.php?t=97046

_______________________________________________
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to