# jackd.service for embedded headless machines with USB sound card or other. # done for iemKit domeplayer # the idea is that other services depending on this will start audio applications # for installations # # (c) GPL, 2016 IEM, Winfried Ritsch # see https://git.iem.at:/cm/iemKit # [Unit] Description=JACKD After=sound.target usb-reset.service multi-user.target Before=stream.service Requires=multi-user.target AllowIsolate=yes [Service] #could not get dbus to work without X11 DISPLAY. so using dbus-run-session now #run as user algo for security reasons, should be nobody in future User=algo Group=audio # If they are declared in /etc/limits.d/audio.conf, they are not needed here LimitRTPRIO=96 LimitRTTIME=infinity LimitMEMLOCK=infinity # Additional tuning if needed on small embedded devices #MemoryMax=512M #CPUSchedulingPolicy=rr #CPUSchedulingPriority=95 #CPUAffinity=1 ; #LimitNPROC=1 #LimitCPU=1024 #ControlGroupAttribute=memory.swappiness 10 # setting parameter in here Environment="DEVICE=hw:0" Environment="NAME=JACKD" Environment="RATE=44100" Environment="NPERIODS=2" Environment="PERIOD=1024" # or read from a file: #EnvironmentFile=-/etc/jack/%i # start service ExecStart= /usr/bin/dbus-run-session /usr/bin/jackd -d alsa --device ${DEVICE} \ --rate ${RATE} --nperiods ${NPERIODS} --period ${PERIOD} ExecStop=/usr/bin/killall /usr/bin/jackd SuccessExitStatus=0 #RemainAfterExit=true [Install] WantedBy=multi-user.target #WantedBy=jack.target RequiredBy=jackd.target