Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Set the priority of a process higher permanently

Featured Replies

On my Orange Pi Zero I run Armbian Buster and the only software running is Shairport. Unfortunately I used to have a crackling noise every 20-40 secund which was solved after entering 


root@orangepizero:~# renice -n -19 -u shairport-sync
110 (user ID) old priority 0, new priority -19
 

So far so good - but after a reboot the prio is again 0. 

 

So I tried to use nice 

nice -19 shairport-sync
 

but after a reboot the prio was again 0

 

How can I set the priority of all process run by the user (-u) “shairport-sync” to -19 when they start?

  • Author

In the meantime have tried many entries, nothing worked. Seems like limits.conf can only set the limit, not set the standard priority when a process starts :(

modify /etc/init.d/shairport-sync, -19 will not be pretty overall. Try changing preemption model in kernel and settings for shairport-sync (latency) if any.

 

  • Author

Many thanks for pointing me to the init.d file. I did read the pages I could find on how to enter commands to it, I tried several ways but still the priority is low. 

 

What I tried:


START_ARGS="--chuid ${USER}" "nice -n -19 shairport-sync"
 

and 


START_ARGS="--chuid ${USER}" "renice -n -19 -u shairport-sync"

 

But still the priority is 0 after reboot :(

  • Author

Thanks for pointing me here, this triggered some research- in /lib/systemd/system I do find the shairport-sync.service file. There I entered the ExecStartPost command

 

[Unit]
Description=Shairport Sync - AirPlay Audio Receiver
After=sound.target
Requires=avahi-daemon.service
After=avahi-daemon.service
Wants=network-online.target
After=network.target network-online.target

[Service]
ExecStart=/usr/local/bin/shairport-sync
User=shairport-sync
Group=shairport-sync
ExecStartPost=renice -n -19 -u shairport-sync

[Install]
WantedBy=multi-user.target
 

But the only effect this had was killing the service completely :( seems like my syntax is wrong. 

 

In https://www.freedesktop.org/software/systemd/man/systemd.exec.html# I found the info that I can use "Nice" - how nice! So the new config is

 

[Unit]
Description=Shairport Sync - AirPlay Audio Receiver
After=sound.target
Requires=avahi-daemon.service
After=avahi-daemon.service
Wants=network-online.target
After=network.target network-online.target

[Service]
ExecStart=/usr/local/bin/shairport-sync
User=shairport-sync
Group=shairport-sync
Nice=-19

[Install]
WantedBy=multi-user.target
 

And yeah, this works! Many many thanks!

 

So to wrap up the issue and the solution: 

Shairport-Service used to have cracks and noise which disappeared by

entering renice -n -19 -u shairport-sync

after start. However, after Reboot, this was lost. So the solution was to go to /lib/systemd/system , edit the existing shairport-sync.service file by adding 

Nice=-19

to the config. Check if this works by rebooting and doing "top".

  • Author

Correct, in the successful config I have used nice. 

 

The reason why I tried renice in the first try was, that I expected the service to be running already. It would have been more like a hack to "command-line" renice after start. setting it properly in the service config is the better way. 

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.