INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Thread priorities not working in headless mode  (Read 2739 times)

JHaycox

  • Recent member
  • *
  • Posts: 6
Thread priorities not working in headless mode
« on: February 13, 2018, 06:55:51 pm »

I installed Media Center on a Raspberry Pi 3 B running the latest distribution of Raspbian (as of a week or so ago).  I followed the "new" installation guide, thought not straight through since I initially picked up old directions.  Media Center version is 23.0.102.  When I run Media Center manually thread priorities look OK.  But when I start it as a service thread priorities are not working.

Starting via the VNC viewer start menu gives:

pi@raspberrypi:~ $ ps -T -eo user,pid,tid,class,rtprio,ni,pri,comm | grep mediacenter23
pi        3412  3412 TS       -   0  19 mediacenter23
pi        3412  7193 RR      46   -  86 mediacenter23
pi        3412  7194 RR      46   -  86 mediacenter23
pi        3412  7203 RR      50   -  90 mediacenter23
pi        3412  7205 RR      50   -  90 mediacenter23
pi        3412  7207 RR      50   -  90 mediacenter23
pi        3412  7211 RR      50   -  90 mediacenter23

Stopping the manually initiated task and starting system service shows:

pi@raspberrypi:~ $ sudo systemctl  start jriver.service
pi@raspberrypi:~ $ ps -T -eo user,pid,tid,class,rtprio,ni,pri,comm | grep mediacenter23
pi        7357  7357 TS       -   0  19 mediacenter23
pi        7357  7560 TS       -   0  19 mediacenter23
pi        7357  7572 TS       -   0  19 mediacenter23
pi        7357  7576 TS       -   0  19 mediacenter23
pi        7357  7580 TS       -   0  19 mediacenter23
pi        7357  7584 TS       -   0  19 mediacenter23
pi        7357  7586 TS       -   0  19 mediacenter23
pi        7357  7588 TS       -   0  19 mediacenter23
pi        7357  7996 TS       -   0  19 mediacenter23
pi        7357  7998 TS       -   0  19 mediacenter23
pi        7357  8000 TS       -   0  19 mediacenter23
pi        7357  8004 TS       -   0  19 mediacenter23
pi        7357  8008 TS       -   0  19 mediacenter23

The same thing happens when the service is started at bootup.

I tried some of the ideas in the installation guide posts (changing @audio to pi in limits.conf, etc.) but nothing helped.
Logged

JHaycox

  • Recent member
  • *
  • Posts: 6
Re: Thread priorities not working in headless mode
« Reply #1 on: February 16, 2018, 05:28:27 pm »

I am new to forum based support and I apologize if I did something wrong that accounts for zero replies.  Please let me know if there is a better way to present issues next time.

I found a solution that seems to fix the problem:

Add the following line in the [Service] section of jriver.service:

 LimitRTPRIO=100

To test I entered the following commands:

sudo systemctl daemon-reload
sudo systemctl  stop jriver.service
sudo systemctl  start jriver.service

Thread priorities were working at this point and after reboot.

To clarify the context of this fix see the following topic:

https://yabb.jriver.com/interact/index.php/topic,111505.0.html

Scroll to the section "Running Without a Monitor".  My suggestion applies to the "new" method that runs MediaCenter as a service.

Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5234
  • "Linux Merit Badge" Recipient
Re: Thread priorities not working in headless mode
« Reply #2 on: February 16, 2018, 08:13:35 pm »

I am new to forum based support and I apologize if I did something wrong that accounts for zero replies.  Please let me know if there is a better way to present issues next time.

I found a solution that seems to fix the problem:

Add the following line in the [Service] section of jriver.service:

 LimitRTPRIO=100

To test I entered the following commands:

sudo systemctl daemon-reload
sudo systemctl  stop jriver.service
sudo systemctl  start jriver.service

Thread priorities were working at this point and after reboot.

To clarify the context of this fix see the following topic:

https://yabb.jriver.com/interact/index.php/topic,111505.0.html

Scroll to the section "Running Without a Monitor".  My suggestion applies to the "new" method that runs MediaCenter as a service.

You didn't do anything wrong, the linux section of the forum is just a little "slower" than some of the other parts  ;)

I can confirm your fix works, and thank you for figuring it out.  I am the author of the systemd services and had been paddling around trying to figure out a robust solution to this problem, and this looks like a good fix.  I'll add it to the services after a little more testing.
Logged
Pages: [1]   Go Up