Re: [LAD] JACK and vanilla 3.19.2 startup issue

2015-06-08 Thread Gerald
Just out of interest: why are you trying to run jack as root?
Gerald

On 06.06.2015 23:08, Tito Latini wrote:
 On Sat, Jun 06, 2015 at 03:35:16PM +0100, Harry van Haaren wrote:
 On Sat, Apr 4, 2015 at 8:13 PM, Adrian Knoth a...@drcomp.erfurt.thur.de
 wrote:

 Not enough information. I recommend starting jackd with strace

 Done - apologies for the delay. Strace output available[1], but the most
 interesting part copied here:

 sched_get_priority_min(SCHED_FIFO)  = 1
 sched_setscheduler(0, SCHED_FIFO, { 1 }) = -1 EPERM (Operation not
 permitted)
 write(2, \nJACK is running in realtime mod..., 87
 JACK is running in realtime mode, but you are not allowed to use realtime
 scheduling.
 ) = 87



 This code tries to call sched_setscheduler() with SCHED_FIFO. My bet is
 that your almost vanilla kernel fails to fulfil this request, but
 strace will tell you for sure.

 By almost vanilla I meant the Arch linux packaged version - I didn't
 change the config myself (and Arch aims to be true to vanilla). A very
 accurace prediction though - indeed sched_setscheduler() is causing a
 return of -1. This is running as root though - so something is wrong here.


 The question is why said call should fail. The only thing that comes to
 my mind are CGROUPS. Maybe your old kernel comes without, the new kernel
 supports them and the configuration is set in a way that disables
 SCHED_FIFO by default.

 Perhaps - I'm not experienced with cgroups or such, if anybody has any test
 ideas for me I'll try them out?
 No tested but perhaps the follow lines in __sched_setscheduler
 (linux-3.19.8/kernel/sched/core.c) are relevant:

 #ifdef CONFIG_RT_GROUP_SCHED
   /*
* Do not allow realtime tasks into groups that have no runtime
* assigned.
*/
   if (rt_bandwidth_enabled()  rt_policy(policy) 
   task_group(p)-rt_bandwidth.rt_runtime == 0 
   !task_group_is_autogroup(task_group(p))) {
   task_rq_unlock(rq, p, flags);
   return -EPERM;
   }
 #endif
 #ifdef CONFIG_SMP
   if (dl_bandwidth_enabled()  dl_policy(policy)) {
   cpumask_t *span = rq-rd-span;

   /*
* Don't allow tasks with an affinity mask smaller than
* the entire root_domain to become SCHED_DEADLINE. We
* will also fail if there's no bandwidth available.
*/
   if (!cpumask_subset(span, p-cpus_allowed) ||
   rq-rd-dl_bw.bw == 0) {
   task_rq_unlock(rq, p, flags);
   return -EPERM;
   }
   }
 #endif


 However I'm using 3.10 compiled without CONFIG_RT_GROUP_SCHED and the
 second `#ifdef' (CONFIG_SMP) is not present in the source code.

 Hypothesis: the second condition fails

   = disable the bandwidth management logic (the default is 95):

  echo -1  /proc/sys/kernel/sched_rt_runtime_us

  More info about sched_rt_runtime_us:

scheduler/sched-rt-group.txt: 2.1 System wide settings
scheduler/sched-deadline.txt: 4.1 System wide settings

 If it continues to fail and your kernel is compiled with
 CONFIG_RT_GROUP_SCHED, you could recompile it without this
 configuration option (if you don't use realtime group scheduling).

 Oh, if it continues to fail, see the other branches with `return -EPERM'
 in __sched_setscheduler.
 ___
 Linux-audio-dev mailing list
 Linux-audio-dev@lists.linuxaudio.org
 http://lists.linuxaudio.org/listinfo/linux-audio-dev

___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] JACK and vanilla 3.19.2 startup issue

2015-06-08 Thread Harry van Haaren
On Mon, Jun 8, 2015 at 10:18 PM, Gerald gerald.mwa...@gmx.de wrote:

 Just out of interest: why are you trying to run jack as root?


$ whoami
root

I am root, a user who likes to run JACK for audio :)

Cheers, -Harry

PS: Yes I'm aware of security concerns etc

-- 

http://www.openavproductions.com
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] JACK and vanilla 3.19.2 startup issue

2015-06-06 Thread Yann Collette
I meet maybe the same problem under fedora: I added myself to the 
pulse-rt group.

This group has priorities defined in /etc/security/limits.d/95-jack.conf

@jackuser - rtprio 95
@jackuser - memlock unlimited

#@audio- rtprio 95
#@audio- memlock unlimited

#@pulse-rt - rtprio 10
#@pulse-rt - nice -20

And because I belong to the jackuser and pulse-rt group, the lower 
rtprio was retained.
If I commented the pulse-rt part of 95-jack.conf everything was back to 
normal.


YC

Le 06/06/2015 16:35, Harry van Haaren a écrit :
On Sat, Apr 4, 2015 at 8:13 PM, Adrian Knoth 
a...@drcomp.erfurt.thur.de mailto:a...@drcomp.erfurt.thur.de wrote:


Not enough information. I recommend starting jackd with strace

Done - apologies for the delay. Strace output available[1], but the 
most interesting part copied here:


sched_get_priority_min(SCHED_FIFO)  = 1
sched_setscheduler(0, SCHED_FIFO, { 1 }) = -1 EPERM (Operation not 
permitted)

write(2, \nJACK is running in realtime mod..., 87
JACK is running in realtime mode, but you are not allowed to use 
realtime scheduling.

) = 87

This code tries to call sched_setscheduler() with SCHED_FIFO. My
bet is
that your almost vanilla kernel fails to fulfil this request, but
strace will tell you for sure.

By almost vanilla I meant the Arch linux packaged version - I didn't 
change the config myself (and Arch aims to be true to vanilla). A very 
accurace prediction though - indeed sched_setscheduler() is causing a 
return of -1. This is running as root though - so something is wrong here.


The question is why said call should fail. The only thing that
comes to
my mind are CGROUPS. Maybe your old kernel comes without, the new
kernel
supports them and the configuration is set in a way that disables
SCHED_FIFO by default.

Perhaps - I'm not experienced with cgroups or such, if anybody has any 
test ideas for me I'll try them out?


Cheers, -Harry

[1] http://openavproductions.com/tmp/straceJackd.txt



___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] JACK and vanilla 3.19.2 startup issue

2015-06-06 Thread David Runge
You can use your own systemd --user service for it (to circumvent all
the weird dbus stuff).
Talked about this at this year's LAC.
http://lac.linuxaudio.org/2015/download/lac2015_arch_slides.pdf

For reference (you can get the package from the AUR, it's called uenv-git):
https://git.sleepmap.de/uenv.git/tree/user/jack@.service
https://git.sleepmap.de/uenv.git/tree/config/fw1


On 06.06.2015 16:35, Harry van Haaren wrote:
 On Sat, Apr 4, 2015 at 8:13 PM, Adrian Knoth
 a...@drcomp.erfurt.thur.de mailto:a...@drcomp.erfurt.thur.de wrote:

 Not enough information. I recommend starting jackd with strace

 Done - apologies for the delay. Strace output available[1], but the
 most interesting part copied here:

 sched_get_priority_min(SCHED_FIFO)  = 1
 sched_setscheduler(0, SCHED_FIFO, { 1 }) = -1 EPERM (Operation not
 permitted)
 write(2, \nJACK is running in realtime mod..., 87
 JACK is running in realtime mode, but you are not allowed to use
 realtime scheduling.
 ) = 87

  

 This code tries to call sched_setscheduler() with SCHED_FIFO. My
 bet is
 that your almost vanilla kernel fails to fulfil this request, but
 strace will tell you for sure.

 By almost vanilla I meant the Arch linux packaged version - I didn't
 change the config myself (and Arch aims to be true to vanilla). A very
 accurace prediction though - indeed sched_setscheduler() is causing a
 return of -1. This is running as root though - so something is wrong here.
  

 The question is why said call should fail. The only thing that
 comes to
 my mind are CGROUPS. Maybe your old kernel comes without, the new
 kernel
 supports them and the configuration is set in a way that disables
 SCHED_FIFO by default.

 Perhaps - I'm not experienced with cgroups or such, if anybody has any
 test ideas for me I'll try them out?

 Cheers, -Harry

 [1] http://openavproductions.com/tmp/straceJackd.txt



 ___
 Linux-audio-dev mailing list
 Linux-audio-dev@lists.linuxaudio.org
 http://lists.linuxaudio.org/listinfo/linux-audio-dev

-- 
David Runge
Köpenicker Straße 163
10997 Berlin
http://www.sleepmap.de



signature.asc
Description: OpenPGP digital signature
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] JACK and vanilla 3.19.2 startup issue

2015-06-06 Thread Tito Latini
On Sat, Jun 06, 2015 at 03:35:16PM +0100, Harry van Haaren wrote:
 On Sat, Apr 4, 2015 at 8:13 PM, Adrian Knoth a...@drcomp.erfurt.thur.de
 wrote:
 
  Not enough information. I recommend starting jackd with strace
 
 Done - apologies for the delay. Strace output available[1], but the most
 interesting part copied here:
 
 sched_get_priority_min(SCHED_FIFO)  = 1
 sched_setscheduler(0, SCHED_FIFO, { 1 }) = -1 EPERM (Operation not
 permitted)
 write(2, \nJACK is running in realtime mod..., 87
 JACK is running in realtime mode, but you are not allowed to use realtime
 scheduling.
 ) = 87
 
 
 
  This code tries to call sched_setscheduler() with SCHED_FIFO. My bet is
  that your almost vanilla kernel fails to fulfil this request, but
  strace will tell you for sure.
 
 By almost vanilla I meant the Arch linux packaged version - I didn't
 change the config myself (and Arch aims to be true to vanilla). A very
 accurace prediction though - indeed sched_setscheduler() is causing a
 return of -1. This is running as root though - so something is wrong here.
 
 
  The question is why said call should fail. The only thing that comes to
  my mind are CGROUPS. Maybe your old kernel comes without, the new kernel
  supports them and the configuration is set in a way that disables
  SCHED_FIFO by default.
 
 Perhaps - I'm not experienced with cgroups or such, if anybody has any test
 ideas for me I'll try them out?

No tested but perhaps the follow lines in __sched_setscheduler
(linux-3.19.8/kernel/sched/core.c) are relevant:

#ifdef CONFIG_RT_GROUP_SCHED
/*
 * Do not allow realtime tasks into groups that have no runtime
 * assigned.
 */
if (rt_bandwidth_enabled()  rt_policy(policy) 
task_group(p)-rt_bandwidth.rt_runtime == 0 
!task_group_is_autogroup(task_group(p))) {
task_rq_unlock(rq, p, flags);
return -EPERM;
}
#endif
#ifdef CONFIG_SMP
if (dl_bandwidth_enabled()  dl_policy(policy)) {
cpumask_t *span = rq-rd-span;

/*
 * Don't allow tasks with an affinity mask smaller than
 * the entire root_domain to become SCHED_DEADLINE. We
 * will also fail if there's no bandwidth available.
 */
if (!cpumask_subset(span, p-cpus_allowed) ||
rq-rd-dl_bw.bw == 0) {
task_rq_unlock(rq, p, flags);
return -EPERM;
}
}
#endif


However I'm using 3.10 compiled without CONFIG_RT_GROUP_SCHED and the
second `#ifdef' (CONFIG_SMP) is not present in the source code.

Hypothesis: the second condition fails

  = disable the bandwidth management logic (the default is 95):

 echo -1  /proc/sys/kernel/sched_rt_runtime_us

 More info about sched_rt_runtime_us:

   scheduler/sched-rt-group.txt: 2.1 System wide settings
   scheduler/sched-deadline.txt: 4.1 System wide settings

If it continues to fail and your kernel is compiled with
CONFIG_RT_GROUP_SCHED, you could recompile it without this
configuration option (if you don't use realtime group scheduling).

Oh, if it continues to fail, see the other branches with `return -EPERM'
in __sched_setscheduler.
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] JACK and vanilla 3.19.2 startup issue

2015-04-04 Thread Adrian Knoth

On 04/04/15 19:08, Harry van Haaren wrote:


Any suggestions as to what's going on? Thanks, -Harry


Not enough information. I recommend starting jackd with strace, so you
get an idea what's actually failing. Also read the code that generates
said message:


https://github.com/jackaudio/jack1/blob/efd4794001db845433a1eff175256fc9a34f4a79/config/os/gnu-linux/sanitycheck.c#L52

The key thing here is system_user_can_rtprio():


https://github.com/jackaudio/jack1/blob/efd4794001db845433a1eff175256fc9a34f4a79/config/os/gnu-linux/systemtest.c#L226

This code tries to call sched_setscheduler() with SCHED_FIFO. My bet is
that your almost vanilla kernel fails to fulfil this request, but
strace will tell you for sure.

The question is why said call should fail. The only thing that comes to
my mind are CGROUPS. Maybe your old kernel comes without, the new kernel
supports them and the configuration is set in a way that disables
SCHED_FIFO by default.

You could of course always diff the two kernel configs and roll your
own (or just recompile vanilla 3.19.x with your 3.18 config). Maybe
there are new config options that interfere or change the defaults.


HTH
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] JACK and vanilla 3.19.2 startup issue

2015-04-04 Thread Cedric Roux

On 04/04/2015 07:08 PM, Harry van Haaren wrote:

Running groups tells me there is no group other than root, so JACK
seems to misinterpret that there is an audio group on the broken
kernel.


not an answer but just to tell you what running groups does, as
written in the man page:
 Print  group memberships for each USERNAME or, if no USERNAME is speci‐
 fied, for the current process (which may differ if the groups  database
 has changed).

So running groups as root reports the groups the user root is in,
not the groups you have on your system.

Try a grep audio /etc/group, it will print something with a probably
of one minus epsilon.
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev