[LAU] Trying to run jackd from udev

Jeremy Jongepier jeremy at autostatic.com
Sun Mar 31 21:05:17 UTC 2013


On 03/22/2013 11:51 PM, Jeremy Jongepier wrote:
> I'm trying to run jackd from a script that is triggered by udev. But
> when I try to do so jackd complains:
>
> jackd 0.122.0
> ...
> JACK is running in realtime mode, but you are not allowed to use
> realtime scheduling.
> ...
>
> But the user trying to run jackd (pi) is a member of the audio group.
> The udev rule looks like this:
>
> ATTRS{idVendor}=="0218", ATTRS{idProduct}=="0001", ACTION=="change",
> RUN+="/usr/bin/sudo -u pi -s /home/pi/bin/drumpad"
>
> Is this maybe related to using sudo? I'd like to get this working, the
> idea is that whenever I plug in my drumpad the udev rule and thus the
> script gets executed. The script checks if jackd is already started and
> then moves on starting up jalv with the drumkv1 plug-in. The script
> itself works fine, it's just the udev part that got me puzzled.
>
> Thanks!
>
> Jeremy

The script works now except for one thing, the JACK connections do not 
get set up when I boot with the drumpad attached. After having logged in 
I still can't set up the connections because either jack_connect and 
aj-snapshot complain that JACK is not running while it does run and it 
runs as the user I'm logged in with.
This is the script I've fabricated: 
https://raw.github.com/AutoStatic/scripts/rpi/rpi/drumpad
I've attached a JACK log of booting with the drumpad attached. JACK 
starts successfully, so do all clients but the connections are not set 
up. If I then log in and do a jack_lsp -c I get the following back:
pi at jj-rpi ~ $ jack_lsp -c
JACK server not running

Something similar happens when I boot without the drumpad attached and 
attach the drumpad when booted. Then I have to wait a while before I can 
make the connections (hence the sleep 10 command before calling 
aj-snapshot). It'd be nice if I could check somehow if JACK is ready to 
make connections.

Anyone any idea? Thanks in advance.

Jeremy
-------------- next part --------------
jackd 0.122.0
Copyright 2001-2009 Paul Davis, Stephane Letz, Jack O'Quinn, Torben Hohn and others.
jackd comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details

getting driver descriptor from /usr/lib/arm-linux-gnueabihf/jack/jack_oss.so
getting driver descriptor from /usr/lib/arm-linux-gnueabihf/jack/jack_net.so
getting driver descriptor from /usr/lib/arm-linux-gnueabihf/jack/jack_alsa.so
getting driver descriptor from /usr/lib/arm-linux-gnueabihf/jack/jack_dummy.so
JACK compiled with System V SHM support.
server `default' registered
loading driver ..
registered builtin port type 32 bit float mono audio
registered builtin port type 8 bit raw midi
clock source = system clock via clock_gettime
start poll on 3 fd's
new client: alsa_pcm, id = 1 type 1 @ 0x31d718 fd = -1
apparent rate = 48000
creating alsa driver ... hw:Device|hw:Device|128|3|48000|0|0|nomon|swmeter|soft-mode|32bit
configuring for 48000Hz, period = 128 frames (2.7 ms), buffer = 3 periods
ALSA: final selected sample format for capture: 16bit little-endian
ALSA: use 3 periods for capture
ALSA: final selected sample format for playback: 16bit little-endian
ALSA: use 3 periods for playback
new buffer size 128
resizing port buffer segment for type 0, one buffer = 512 bytes
resizing port buffer segment for type 1, one buffer = 512 bytes
registered port system:capture_1, offset = 512
registered port system:playback_1, offset = 0
registered port system:playback_2, offset = 0
++ jack_sort_graph
++ jack_rechain_graph():
-- jack_rechain_graph()
-- jack_sort_graph
registered port alsa_pcm:Midi-Through/midi_capture_1, offset = 512
registered port alsa_pcm:Midi-Through/midi_playback_1, offset = 0
registered port alsa_pcm:MIDI-DRUM/midi_capture_1, offset = 1024
registered port alsa_pcm:MIDI-DRUM/midi_playback_1, offset = 0
464 waiting for signals
server thread back from poll
new client: wait, id = 2 type 2 @ 0xb5336000 fd = 13
start poll on 4 fd's
server thread back from poll
new client wait using 14 for events
start poll on 4 fd's
server thread back from poll
marking client wait with SOCKET error state = Not triggered errors = 0
waking server thread
trying to lock graph to remove 1 problems
we have problem clients (problems = 1
++ Removing failed clients ...
client wait error status 10000000
removing failed client wait state = Not triggered errors = 10000000
removing client "wait"
removing client "wait" from the processing chain
+++ deactivate wait
client alsa_pcm error status 0
++ jack_sort_graph
++ jack_rechain_graph():
-- jack_rechain_graph()
-- jack_sort_graph
-- Removing failed clients ...
after removing clients, problems = 0
start poll on 3 fd's
server thread back from poll
start poll on 3 fd's
server thread back from poll
new client: lsp, id = 3 type 2 @ 0xb5336000 fd = 13
start poll on 4 fd's
server thread back from poll
new client lsp using 14 for events
start poll on 4 fd's
server thread back from poll
marking client lsp with SOCKET error state = Not triggered errors = 0
waking server thread
trying to lock graph to remove 1 problems
we have problem clients (problems = 1
++ Removing failed clients ...
client lsp error status 10000000
removing failed client lsp state = Not triggered errors = 10000000
removing client "lsp"
removing client "lsp" from the processing chain
+++ deactivate lsp
client alsa_pcm error status 0
++ jack_sort_graph
++ jack_rechain_graph():
-- jack_rechain_graph()
-- jack_sort_graph
-- Removing failed clients ...
after removing clients, problems = 0
start poll on 3 fd's
server thread back from poll
start poll on 3 fd's
server thread back from poll
new client: drumkv1, id = 4 type 2 @ 0xb5336000 fd = 13
start poll on 4 fd's
server thread back from poll
new client drumkv1 using 14 for events
start poll on 4 fd's
server thread back from poll
new client: lsp, id = 5 type 2 @ 0xb5335000 fd = 15
start poll on 5 fd's
server thread back from poll
new client lsp using 16 for events
start poll on 5 fd's
server thread back from poll
marking client lsp with SOCKET error state = Not triggered errors = 0
waking server thread
trying to lock graph to remove 1 problems
we have problem clients (problems = 1
++ Removing failed clients ...
client lsp error status 10000000
removing failed client lsp state = Not triggered errors = 10000000
removing client "lsp"
removing client "lsp" from the processing chain
+++ deactivate lsp
client drumkv1 error status 0
client alsa_pcm error status 0
++ jack_sort_graph
++ jack_rechain_graph():
-- jack_rechain_graph()
-- jack_sort_graph
-- Removing failed clients ...
after removing clients, problems = 0
start poll on 4 fd's
server thread back from poll
start poll on 4 fd's
server thread back from poll
registered port drumkv1:in, offset = 0
start poll on 4 fd's
server thread back from poll
registered port drumkv1:in_L, offset = 0
start poll on 4 fd's
server thread back from poll
registered port drumkv1:in_R, offset = 0
start poll on 4 fd's
server thread back from poll
registered port drumkv1:Out_L, offset = 1024
start poll on 4 fd's
server thread back from poll
registered port drumkv1:Out_R, offset = 1536
start poll on 4 fd's
load = 6.0015 max usecs: 320.000, spare = 2346.000
server thread back from poll
new client: lsp, id = 6 type 2 @ 0xb5335000 fd = 15
start poll on 5 fd's
server thread back from poll
new client lsp using 16 for events
start poll on 5 fd's
server thread back from poll
marking client lsp with SOCKET error state = Not triggered errors = 0
waking server thread
trying to lock graph to remove 1 problems
we have problem clients (problems = 1
++ Removing failed clients ...
client lsp error status 10000000
removing failed client lsp state = Not triggered errors = 10000000
removing client "lsp"
removing client "lsp" from the processing chain
+++ deactivate lsp
client alsa_pcm error status 0
client drumkv1 error status 0
++ jack_sort_graph
++ jack_rechain_graph():
+++ client is now drumkv1 active ? 0
-- jack_rechain_graph()
-- jack_sort_graph
-- Removing failed clients ...
after removing clients, problems = 0
start poll on 4 fd's
server thread back from poll
start poll on 4 fd's
load = 7.9145 max usecs: 262.000, spare = 2404.000
server thread back from poll
++ jack_sort_graph
++ jack_rechain_graph():
+++ client is now drumkv1 active ? 1
client drumkv1: start_fd=7, execution_order=0.
client event poll on 14 for drumkv1 starts at 22929772
back from client event poll after 50 usecs
client drumkv1: wait_fd=12, execution_order=1 (last client).
-- jack_rechain_graph()
client event poll on 14 for drumkv1 starts at 22930546
back from client event poll after 54 usecs
client event poll on 14 for drumkv1 starts at 22931601
back from client event poll after 72 usecs
-- jack_sort_graph
lock-driven null cycle
client event poll on 14 for drumkv1 starts at 22932394
back from client event poll after 51 usecs
client event poll on 14 for drumkv1 starts at 22932688
back from client event poll after 40 usecs
lock-driven null cycle
client event poll on 14 for drumkv1 starts at 22935580
back from client event poll after 62 usecs
start poll on 4 fd's
late driver wakeup: nframes to process = 384.
load = 14.5161 max usecs: 563.000, spare = 2103.000
load = 17.6669 max usecs: 555.000, spare = 2111.000
load = 19.2048 max usecs: 553.000, spare = 2113.000
load = 20.0675 max usecs: 558.000, spare = 2108.000
load = 20.5739 max usecs: 562.000, spare = 2104.000
load = 20.8271 max usecs: 562.000, spare = 2104.000
load = 20.4098 max usecs: 533.000, spare = 2133.000
load = 20.6888 max usecs: 559.000, spare = 2107.000
server thread back from poll
new client: jack_bufsize, id = 7 type 2 @ 0xb5335000 fd = 15
start poll on 5 fd's
server thread back from poll
new client jack_bufsize using 16 for events
start poll on 5 fd's
server thread back from poll
configuring for 48000Hz, period = 128 frames (2.7 ms), buffer = 3 periods
ALSA: final selected sample format for capture: 16bit little-endian
ALSA: use 3 periods for capture
ALSA: final selected sample format for playback: 16bit little-endian
ALSA: use 3 periods for playback
new buffer size 128
resizing port buffer segment for type 0, one buffer = 512 bytes
client event poll on 14 for drumkv1 starts at 31822988
back from client event poll after 89 usecs
resizing port buffer segment for type 1, one buffer = 512 bytes
client event poll on 14 for drumkv1 starts at 31824477
back from client event poll after 87 usecs
client event poll on 14 for drumkv1 starts at 31825028
back from client event poll after 65 usecs
start poll on 5 fd's
server thread back from poll
marking client jack_bufsize with SOCKET error state = Not triggered errors = 0
waking server thread
trying to lock graph to remove 1 problems
we have problem clients (problems = 1
++ Removing failed clients ...
client jack_bufsize error status 10000000
removing failed client jack_bufsize state = Not triggered errors = 10000000
removing client "jack_bufsize"
removing client "jack_bufsize" from the processing chain
+++ deactivate jack_bufsize
client alsa_pcm error status 0
client drumkv1 error status 0
++ jack_sort_graph
++ jack_rechain_graph():
+++ client is now drumkv1 active ? 1
client drumkv1: start_fd=7, execution_order=0.
client event poll on 14 for drumkv1 starts at 31835797
back from client event poll after 100 usecs
client drumkv1: wait_fd=12, execution_order=1 (last client).
-- jack_rechain_graph()
client event poll on 14 for drumkv1 starts at 31840368
back from client event poll after 97 usecs
client event poll on 14 for drumkv1 starts at 31840913
back from client event poll after 64 usecs
-- jack_sort_graph
-- Removing failed clients ...
after removing clients, problems = 0
start poll on 4 fd's
server thread back from poll
start poll on 4 fd's
late driver wakeup: nframes to process = 896.
server thread back from poll
new client: aj-snapshot, id = 8 type 2 @ 0xb5cff000 fd = 15
start poll on 5 fd's
server thread back from poll
new client aj-snapshot using 16 for events
start poll on 5 fd's
server thread back from poll
connect alsa_pcm:MIDI-DRUM/midi_capture_1 and drumkv1:in (forward)
lock-driven null cycle
client event poll on 14 for drumkv1 starts at 31952773
back from client event poll after 72 usecs
++ jack_sort_graph
++ jack_rechain_graph():
+++ client is now drumkv1 active ? 1
client drumkv1: start_fd=7, execution_order=0.
client event poll on 14 for drumkv1 starts at 31953810
back from client event poll after 67 usecs
client drumkv1: wait_fd=12, execution_order=1 (last client).
-- jack_rechain_graph()
lock-driven null cycle
client event poll on 14 for drumkv1 starts at 31954844
back from client event poll after 68 usecs
client event poll on 14 for drumkv1 starts at 31955498
back from client event poll after 67 usecs
-- jack_sort_graph
start poll on 5 fd's
server thread back from poll
connect drumkv1:Out_L and system:playback_1 (output)
client event poll on 14 for drumkv1 starts at 31956999
back from client event poll after 72 usecs
lock-driven null cycle
++ jack_sort_graph
++ jack_rechain_graph():
+++ client is now drumkv1 active ? 1
client drumkv1: start_fd=7, execution_order=0.
client event poll on 14 for drumkv1 starts at 31958599
back from client event poll after 70 usecs
client drumkv1: wait_fd=12, execution_order=1 (last client).
-- jack_rechain_graph()
client event poll on 14 for drumkv1 starts at 31959408
back from client event poll after 50 usecs
client event poll on 14 for drumkv1 starts at 31959869
back from client event poll after 61 usecs
-- jack_sort_graph
lock-driven null cycle
start poll on 5 fd's
server thread back from poll
connect drumkv1:Out_R and system:playback_2 (output)
client event poll on 14 for drumkv1 starts at 31961680
back from client event poll after 54 usecs
++ jack_sort_graph
++ jack_rechain_graph():
+++ client is now drumkv1 active ? 1
client drumkv1: start_fd=7, execution_order=0.
lock-driven null cycle
client event poll on 14 for drumkv1 starts at 31963052
back from client event poll after 136 usecs
client drumkv1: wait_fd=12, execution_order=1 (last client).
-- jack_rechain_graph()
client event poll on 14 for drumkv1 starts at 31963857
back from client event poll after 63 usecs
client event poll on 14 for drumkv1 starts at 31964562
back from client event poll after 68 usecs
-- jack_sort_graph
lock-driven null cycle
lock-driven null cycle
lock-driven null cycle
lock-driven null cycle
start poll on 5 fd's
server thread back from poll
marking client aj-snapshot with SOCKET error state = Not triggered errors = 0
waking server thread
trying to lock graph to remove 1 problems
we have problem clients (problems = 1
++ Removing failed clients ...
client alsa_pcm error status 0
client drumkv1 error status 0
client aj-snapshot error status 10000000
removing failed client aj-snapshot state = Not triggered errors = 10000000
removing client "aj-snapshot"
removing client "aj-snapshot" from the processing chain
+++ deactivate aj-snapshot
++ jack_sort_graph
++ jack_rechain_graph():
+++ client is now drumkv1 active ? 1
client drumkv1: start_fd=7, execution_order=0.
lock-driven null cycle
lock-driven null cycle
client event poll on 14 for drumkv1 starts at 31978847
back from client event poll after 63 usecs
client drumkv1: wait_fd=12, execution_order=1 (last client).
-- jack_rechain_graph()
client event poll on 14 for drumkv1 starts at 31979403
back from client event poll after 50 usecs
client event poll on 14 for drumkv1 starts at 31979614
back from client event poll after 39 usecs
-- jack_sort_graph
-- Removing failed clients ...
after removing clients, problems = 0
start poll on 4 fd's
server thread back from poll
start poll on 4 fd's
load = 22.1223 max usecs: 628.000, spare = 2038.000
load = 22.6891 max usecs: 620.000, spare = 2046.000
load = 23.0100 max usecs: 622.000, spare = 2044.000
load = 21.9701 max usecs: 558.000, spare = 2108.000
late driver wakeup: nframes to process = 22528.
late driver wakeup: nframes to process = 3456.
late driver wakeup: nframes to process = 512.
load = 23.5132 max usecs: 668.000, spare = 1998.000
load = 22.3530 max usecs: 565.000, spare = 2101.000
load = 21.7354 max usecs: 563.000, spare = 2103.000
late driver wakeup: nframes to process = 68736.
load = 60.8677 max usecs: 118861.000, spare = 0.000
late driver wakeup: nframes to process = 10368.
late driver wakeup: nframes to process = 1664.
late driver wakeup: nframes to process = 256.
load = 39.6612 max usecs: 492.000, spare = 2174.000
load = 28.9266 max usecs: 485.000, spare = 2181.000
late driver wakeup: nframes to process = 23040.
late driver wakeup: nframes to process = 3584.
late driver wakeup: nframes to process = 512.
late driver wakeup: nframes to process = 22912.
load = 64.4633 max usecs: 40739.000, spare = 0.000
late driver wakeup: nframes to process = 3584.
late driver wakeup: nframes to process = 512.
load = 43.4470 max usecs: 598.000, spare = 2068.000
load = 32.7887 max usecs: 590.000, spare = 2076.000
load = 27.5347 max usecs: 594.000, spare = 2072.000
load = 24.5513 max usecs: 575.000, spare = 2091.000
load = 23.3409 max usecs: 590.000, spare = 2076.000
late driver wakeup: nframes to process = 640.
load = 23.1858 max usecs: 614.000, spare = 2052.000
load = 22.7707 max usecs: 596.000, spare = 2070.000
load = 22.8070 max usecs: 609.000, spare = 2057.000
load = 22.7876 max usecs: 607.000, spare = 2059.000
delay of 12463.000 usecs exceeds estimated spare time of 2059.000; restart ...

client event poll on 14 for drumkv1 starts at 53482961
back from client event poll after 152 usecs
load = 23.9969 max usecs: 672.000, spare = 1994.000
load = 24.4328 max usecs: 663.000, spare = 2003.000
load = 24.1819 max usecs: 638.000, spare = 2028.000
load = 24.2627 max usecs: 649.000, spare = 2017.000
load = 24.9971 max usecs: 686.000, spare = 1980.000
load = 23.8826 max usecs: 607.000, spare = 2059.000
load = 24.5820 max usecs: 674.000, spare = 1992.000
load = 24.8191 max usecs: 668.000, spare = 1998.000
load = 27.6759 max usecs: 814.000, spare = 1852.000
load = 24.5469 max usecs: 571.000, spare = 2095.000
load = 24.6328 max usecs: 659.000, spare = 2007.000
load = 24.4319 max usecs: 646.000, spare = 2020.000
load = 26.6196 max usecs: 768.000, spare = 1898.000
load = 25.3690 max usecs: 643.000, spare = 2023.000
load = 23.9373 max usecs: 600.000, spare = 2066.000
load = 22.8464 max usecs: 580.000, spare = 2086.000
late driver wakeup: nframes to process = 370560.
load = 61.4232 max usecs: 168860.000, spare = 0.000
load = 80.7116 max usecs: 360634.000, spare = 0.000
load = 90.3558 max usecs: 552216.000, spare = 0.000
load = 95.1779 max usecs: 743970.000, spare = 0.000
load = 97.5890 max usecs: 935584.000, spare = 0.000
load = 98.7945 max usecs: 1127630.000, spare = 0.000
load = 99.3972 max usecs: 1355828.000, spare = 0.000
late driver wakeup: nframes to process = 70144.
load = 99.6986 max usecs: 54133.000, spare = 0.000
load = 99.8493 max usecs: 214722.000, spare = 0.000
late driver wakeup: nframes to process = 11008.
late driver wakeup: nframes to process = 1664.
late driver wakeup: nframes to process = 384.
late driver wakeup: nframes to process = 23168.
load = 99.9247 max usecs: 33627.000, spare = 0.000
late driver wakeup: nframes to process = 4352.
late driver wakeup: nframes to process = 768.
load = 64.6472 max usecs: 783.000, spare = 1883.000
load = 43.0701 max usecs: 573.000, spare = 2093.000
load = 31.4750 max usecs: 530.000, spare = 2136.000
load = 25.7338 max usecs: 533.000, spare = 2133.000
late driver wakeup: nframes to process = 45824.
load = 62.8669 max usecs: 52698.000, spare = 0.000
late driver wakeup: nframes to process = 8448.
late driver wakeup: nframes to process = 1664.
late driver wakeup: nframes to process = 256.
load = 42.4237 max usecs: 586.000, spare = 2080.000
load = 30.7392 max usecs: 508.000, spare = 2158.000
load = 24.8595 max usecs: 506.000, spare = 2160.000
load = 22.2760 max usecs: 525.000, spare = 2141.000
load = 21.0217 max usecs: 527.000, spare = 2139.000
load = 21.3886 max usecs: 580.000, spare = 2086.000
load = 20.4842 max usecs: 522.000, spare = 2144.000
load = 20.2009 max usecs: 531.000, spare = 2135.000
load = 18.5025 max usecs: 448.000, spare = 2218.000
late driver wakeup: nframes to process = 46080.
load = 59.2513 max usecs: 94109.000, spare = 0.000
late driver wakeup: nframes to process = 8448.
late driver wakeup: nframes to process = 1664.
late driver wakeup: nframes to process = 256.
load = 39.2843 max usecs: 515.000, spare = 2151.000
load = 29.5071 max usecs: 526.000, spare = 2140.000
load = 24.6373 max usecs: 527.000, spare = 2139.000
load = 22.1836 max usecs: 526.000, spare = 2140.000
load = 20.8067 max usecs: 518.000, spare = 2148.000
load = 20.1746 max usecs: 521.000, spare = 2145.000
load = 20.6274 max usecs: 562.000, spare = 2104.000
load = 19.8786 max usecs: 510.000, spare = 2156.000
load = 19.5042 max usecs: 510.000, spare = 2156.000
late driver wakeup: nframes to process = 45696.
load = 59.7521 max usecs: 136730.000, spare = 0.000
late driver wakeup: nframes to process = 8704.
late driver wakeup: nframes to process = 1664.
late driver wakeup: nframes to process = 256.
load = 40.3974 max usecs: 561.000, spare = 2105.000
load = 30.6826 max usecs: 559.000, spare = 2107.000
load = 25.9002 max usecs: 563.000, spare = 2103.000
load = 23.4527 max usecs: 560.000, spare = 2106.000
late driver wakeup: nframes to process = 256.
load = 22.0414 max usecs: 550.000, spare = 2116.000
load = 21.2420 max usecs: 545.000, spare = 2121.000
load = 20.8048 max usecs: 543.000, spare = 2123.000
load = 21.9365 max usecs: 615.000, spare = 2051.000
load = 22.7275 max usecs: 627.000, spare = 2039.000
late driver wakeup: nframes to process = 896.
late driver wakeup: nframes to process = 256.
load = 22.4478 max usecs: 591.000, spare = 2075.000
load = 23.2081 max usecs: 639.000, spare = 2027.000
load = 23.1007 max usecs: 613.000, spare = 2053.000
load = 29.5173 max usecs: 958.000, spare = 1708.000
load = 26.3678 max usecs: 619.000, spare = 2047.000
load = 23.3865 max usecs: 544.000, spare = 2122.000
load = 23.8838 max usecs: 650.000, spare = 2016.000
load = 22.0694 max usecs: 540.000, spare = 2126.000
load = 21.6499 max usecs: 566.000, spare = 2100.000
load = 21.3651 max usecs: 562.000, spare = 2104.000
load = 21.4102 max usecs: 572.000, spare = 2094.000
load = 21.2640 max usecs: 563.000, spare = 2103.000
load = 21.2284 max usecs: 565.000, spare = 2101.000
load = 21.0418 max usecs: 556.000, spare = 2110.000


More information about the Linux-audio-user mailing list