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
  [SOLVEDCPUset not working in Ubuntu 22.04 Snoopy8 17 2,287 12-Dec-2023, 07:02 PM
Last Post: uglymusic
  upmpdcli mpd and LMS -- set up help! pathetic 13 1,988 23-Nov-2023, 06:32 PM
Last Post: patricia1066
  Problems installing Upmpdcli koko6969koki 3 658 10-Mar-2023, 06:37 AM
Last Post: Snoopy8
  [SOLVEDupmpdcli unable to start Snoopy8 4 803 12-Dec-2022, 01:42 PM
Last Post: Snoopy8
  Pi4 fresh install no upmpdcli mkysimes 2 636 30-Sep-2022, 09:31 AM
Last Post: mkysimes



Users browsing this thread:
1 Guest(s)

[-]
Our Sponsors

[-]
Welcome
You have to register before you can post on our site.

Username/Email:


Password:





[-]
Latest Threads
Announcing Snakeoil Measurements 1.3.0
Last Post: kees1000
13-Apr-2024 11:54 PM
» Replies: 95
» Views: 4672
LMS rebranded to Lyrion Media Server
Last Post: Bromf
07-Apr-2024 01:59 PM
» Replies: 4
» Views: 94
ZimaBoard 2x NIC, 2x SATA, 2x USB, 1x PC...
Last Post: agent_kith
26-Mar-2024 12:04 PM
» Replies: 13
» Views: 682
LMS Upgrade ?
Last Post: uglymusic
15-Mar-2024 09:14 PM
» Replies: 7
» Views: 186
Squeezebox shutdown
Last Post: TripleX
13-Mar-2024 07:34 AM
» Replies: 4
» Views: 97
MP3 Not Playing
Last Post: Coacharnold
10-Mar-2024 10:25 AM
» Replies: 3
» Views: 73
Fail to install myMPD
Last Post: hkphantomgtr
03-Mar-2024 08:45 PM
» Replies: 9
» Views: 237
Intel HFI Driver Can "Save Tons Of CPU C...
Last Post: hkphantomgtr
28-Feb-2024 09:15 PM
» Replies: 0
» Views: 62
More Problems with Squeezelite in 1.3
Last Post: Coacharnold
17-Feb-2024 09:47 PM
» Replies: 2
» Views: 84
Snakeoil Music server & Snakeoil its own...
Last Post: Snoopy8
17-Feb-2024 11:20 AM
» Replies: 8
» Views: 410

[-]
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.


Powered By MyBB, © 2002-2024. Theme © Melroy van den Berg.