Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CpuSet Feature While Using Upmpdcli
#11
(11-Oct-2020, 05:25 PM)agent_kith Wrote:
(09-Oct-2020, 06:22 PM)PeteCallaghan Wrote: There seemed to be multiple mpd processes, so a loop was needed to catch them all:
 
Code:
 
pids=$(pgrep mpd)
for pid in $pids
do
chrt -r -p 99 $pid
cset proc --move  --threads --toset=user --force --pid=$pid
done
In theory you don't have to do this, just find the main PID, and the --threads option will move all threads to the CPUSet.

But, that's really dependent on how MPD works.. e.g. if MPD fork a thread on playback, there is always a chance this script will not work.. i.e. MPD starts, and the script moves the threads to the CPU Set, and when you play, MPD fork another thread, this is not trapped by the script as it happens after the fact..

There's prob a way to fix this, but I havn't investigate deeply enough yet... The current script, while brutally simple, actually yield quite a good audio improvement.. But I've mostly tested this in LMS and Squeezelite..

Please continue to explore this and let me know your progress, I'll incorporate your work into the next release too. Thumbs Up

Some progress. I now have a crude but reliable process for applying the script after a reboot. 

I add a line to crontab that waits for 10 minutes after a reboot and then applies the script:
 
Code:
#crontab-e
@reboot sleep 600; sh [path to script file]/mpdpriority.sh

I have not experimented with shorter sleep times, as this seems pretty reliable.

I'll research how to follow up your point about forked threads, to see if I can find any and see if they are allocated to the correct CPU set
[-] The following 1 user Likes PeteCallaghan's post:
  • agent_kith
Reply
#12
I made an error in my script. The pgrep was returning both mpd and upmpdcli processes because it was matching 'mpd' in both process names. 

This version matches exactly 'mpd' and only finds one pid, using the '-x' option in pgrep
Code:
pids=$(pgrep -x mpd)
for pid in $pids
do
chrt -r -p 99 $pid
cset proc --move  --threads --toset=user --force --pid=$pid
done

I am running upmpdcli as the music server, which uses mpd as the player. 

Using cpuset I have successfully got both mpd and upmpdcli running in the user cpuset, and mpd running with RT priority, which sounds pretty good. 

However, I suspect that it would be beneficial to run mpd alone in the user cpuset, with upmpdcli in the system cpuset. 

However I can't figure out how to achieve this. Any suggestions? 

I could de-select upmpdcli as the music server and use mpd instead, but then I would need to lanch upmpdcli outside snakeoil. What would be the best way to do this?
Reply
#13
(14-Nov-2020, 07:20 PM)PeteCallaghan Wrote: I am running upmpdcli as the music server, which uses mpd as the player. 

Using cpuset I have successfully got both mpd and upmpdcli running in the user cpuset, and mpd running with RT priority, which sounds pretty good. 

However, I suspect that it would be beneficial to run mpd alone in the user cpuset, with upmpdcli in the system cpuset. 

However I can't figure out how to achieve this. Any suggestions? 

I could de-select upmpdcli as the music server and use mpd instead, but then I would need to lanch upmpdcli outside snakeoil. What would be the best way to do this?

Is it possible to configure SO so that mpd is the music server and upmpdcli is the music client?

I've tried setting mpd as server but upmpdcli is not available to configure as music client
Reply


Bookmarks

Possibly Related Threads…
Thread Author Replies Views Last Post
  upmpdcli not playing to usb audio protongx 0 35 30-Aug-2021, 09:37 AM
Last Post: protongx
  [SOLVEDupmpdcli not working on fresh install of 20.04/1.2.0 Snoopy8 5 205 12-Aug-2021, 06:49 AM
Last Post: agent_kith
  upmpdcli hasn't worked since 1.1.7 mkysimes 4 522 16-Feb-2021, 05:16 AM
Last Post: mkysimes
  cpuset and mpd resampler (Libsamplerate) issue ravenman 3 450 16-Nov-2020, 08:38 AM
Last Post: agent_kith
  upmpdcli not working after update Snoopy8 9 1,130 07-Aug-2020, 08:47 AM
Last Post: agent_kith



Users browsing this thread: 1 Guest(s)
[-]
Sponsor

[-]
Latest Threads
Ongoing status updates with new UI for G...
Last Post: agent_kith
Today 04:11 PM
» Replies: 21
» Views: 691
Snakeoil Firmware - 1.2.0 (Gear Isolatio...
Last Post: Bromf
Today 03:58 PM
» Replies: 15
» Views: 767
JRiver 28
Last Post: Primare11
Yesterday 12:48 AM
» Replies: 8
» Views: 43
Spotify Client
Last Post: agent_kith
21-Sep-2021 08:34 PM
» Replies: 42
» Views: 9388
intel nuc wifi drivers
Last Post: agent_kith
21-Sep-2021 04:13 PM
» Replies: 8
» Views: 72

[-]
SnakeoilOS Mission Statement

Our mission is to create a free to use computer OS that is easy to install, intuitive to operate and play music that will connect and engage with you emotionally.

SnakeoilOS gives you the freedom to spend more time on listening, enjoying and exploring music. Wasting time on computers is now a thing of the past! Everything is constantly evolving/improving. Please check back often for updates.

If you like this project, do show your support with a small token donation. All donations collected will be used to run this website, and for purchasing new equipment for the project.


[-]
Random Quotes
TSC on Atom CPU and downscaling CPU...
agent_kith's profile agent_kith
I think that is a gnuplot input file. It can show your CPU latency as a time history plot. But yeah this is something I hope to add into snakepit on day. Alo...

>