mpdPup - Simplified MPD Music Server/Jukebox - v0.9.3

For talk and support relating specifically to Puppy derivatives
Post Reply
Message
Author
jrling
Posts: 47
Joined: Wed 27 Jun 2012, 13:51

Renice PID Nos.

#136 Post by jrling »

Dynobot wrote:
ldolse wrote:I'll probably make 0.17 the default in the next release - I initially experienced some hiccups with it, but I'm now thinking these are related to my network and have nothing to do with MPD.

Regarding renice, while I understand what the command is supposed to do in general, I don't really understand these specific examples. While I understand -10 is the nice value, what are 3, 9, 13, and 16? I can't reconcile this use case with any of the documentation on renice. It seems to me a renice script would need to grep through the process list or cat some PID files to determine which processes to renice.
ot sure about MPDroid and similar. If not odds are some other android audio app should be able to play back the stream. Right now you need to set this up manually in mpd.conf, the wizards won't create a streaming output for you.


Hi Idolse

The numbers 3, 9, 13 and 16 represent the actual processes that are being reniced. These are the interrupts that handle the audio threads.

Here is a link to the source, it also has other information concerning tuning Linux for audio.

http://wiki.linuxmusicians.com/doku.php ... figuration
Dynobot - I can understand where Idolse is coming from. Are you sure that every user of mpdPup will find the PID Nos 3,9,13 & 16 running the same processes?

In my case for reference, they are:
PID 3 ksoftirqd/0
PID 9 ksoftirqd/1
PID 13 sync_supers
PID 16 ata_sff

Are those the same for you?

Thanks

jrling
Posts: 47
Joined: Wed 27 Jun 2012, 13:51

#137 Post by jrling »

Doing a bit more research on the four processes that are being reniced to higher priority, I am a bit puzzled why these two are candidates for improvement? They appear to be carrying out hard drive processes that are not 'sound-related' nor relevant to mpdPup which plays 100% from RAM?

PID 13 sync_supers - seems from this explanation actually to be doing something 'we' would not want - namely writing stuff to disk every 5 seconds -
https://lkml.org/lkml/2012/4/11/147

Should we not be trying to remove it from the kernel altogether as seems to be the aim by others?

PID 16 ata_sff - again seems to be HDD related and only there to support old disk interfaces.
This option adds support for ATA controllers with SFF compliant or similar programming interface.

"SFF is the legacy IDE interface that has been around since the dawn of time. Almost all PATA controllers have an SFF interface. Many SATA controllers have an SFF interface when configured into a legacy compatibility mode.

For users with exclusively modern controllers like AHCI, Silicon Image 3124, or Marvell 6440, you may choose to disable this unneeded SFF support."


Surely only relevant if using a HDD at all? Again why promote its activity for SQ by renice -10?

I run mpdPup off a USB thumbstick, but do have an SSD in the PC also. Since applying the renice batch file, have noticed that my SSD activity light does flash every 5 seconds which it never did before.

As always I defer to ldolse and Dynobot being a relative Linux newbie.

Dynobot
Posts: 44
Joined: Wed 05 Dec 2012, 12:04

#138 Post by Dynobot »

Hi concerning the interrupt values to renice....you guys have a point. I should have considered that in my haste.

For the SB-Touch something like this was used, to make sure the correct priorities were being changed. On my machine with a "dual core" the values were correct only...on other peoples machines the values will change.

# Set audio thread priorities
# Get IRQ for RTC
tmp=`cat /proc/interrupts |grep "mxc_rtc"|cut -f2 -d" "|cut -f1 -d":"`
# Get proc # for RTC
rtc=`ps -e|grep IRQ-$tmp|cut -f3 -d" "`
# Get IRQ of SPDIF I/F
tmp=`cat /proc/interrupts |grep "spdif"|cut -f2 -d" "|cut -f1 -d":"`
# Get proc # for SPDIF
spdif=`ps -e|grep IRQ-$tmp|cut -f3 -d" "`

# Get proces number for audio threads
aud1=`ps -e|grep "sirq-hrtimer/0"|cut -f4 -d" "`
aud2=`ps -e|grep "sirq-timer/0"|cut -f5 -d" "`

# Set new priorities
chrt -f -p 93 $aud1 > /dev/null
chrt -f -p 91 $aud2 > /dev/null
chrt -f -p 59 $spdif > /dev/null
chrt -f -p 87 $rtc > /dev/null

jrling
Posts: 47
Joined: Wed 27 Jun 2012, 13:51

#139 Post by jrling »

Hi Dynobot

Firstly, can I thank you for putting forward constructive suggestions for mpdPup tweaks to improve SQ. It would be great if others with positive experience could do the same. I think that there is a great scope for improvement for those prepared to work at it (like me!).

However, I think your recent suggestions have effectively taken your SBTouch mods and tried to apply them to mpdPup, which I think do not translate well or in many cases apply at all to mpdPup. Your latest posting was applying thread priorities to processes that do not seem to exist as processes running at all in mpdPup. I have not found any of them myself in my set-up - see attached file dump of ps -A -l. You will see that I have left PIDs 3 & 9 ksoftirqd reniced to -10 as you suggested, as I guess they are involved in audio output.

I am sure correct renice priorities can be beneficial. What I don't know is which are the audio processes that we want to promote to higher priority and for that matter which could benefit from lowering priority (I see for instance 'kpsmoused' set at -20 which seems weird - especially if one runs headless like me).

It would be helpful if ldolse could point out those processes which are involved in audio to be reniced to higher priority and the opposite - processes that are peripheral (or even redundant) to have lowered priority.

Dynobot
Posts: 44
Joined: Wed 05 Dec 2012, 12:04

#140 Post by Dynobot »

@jrling

The best way to find the IRQ for the audio threads is to use this command

ps -eLo pid,cls,rtprio,pri,nice,cmd | grep -i "irq"

For example if I use it on my desktop a singe core machine I get this
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

System-Product-Name ~ $ ps -eLo pid,cls,rtprio,pri,nice,cmd | grep -i "irq"
3 TS - 19 0 [ksoftirqd/0]
10 TS - 19 0 [ksoftirqd/1]
17751 TS - 19 0 grep --colour=auto -i irq
System-Product-Name ~ $

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

jrling
Posts: 47
Joined: Wed 27 Jun 2012, 13:51

#141 Post by jrling »

Excellent. Those are the only two I renice'd. Good result too.

Please could I trouble you for the correct values for this line from SBGK for PC with 4GB of RAM - rather than plugging in random values!
echo "1000 1024000 512 2048" > /proc/sys/kernel/sem

Many thanks

Dynobot
Posts: 44
Joined: Wed 05 Dec 2012, 12:04

#142 Post by Dynobot »

Hi jrling

Those values are determined by the processes needs. For example Oracle has suggested values for their server. I believe RedBox the movie rental company has values for their machines too.

1000 1024000 512 2048" > /proc/sys/kernel/sem

I dont know too much about the sem other than the values that show up for MPDPup seem to be the normal minimum values for Linux. Also that the 32000 value is the sum of the first and the last max or a fraction of it for example instead of 32000 it might be 16000 or 8000.

For example the current numbers in MPDPup are 250 32000 32 128. Therefore 250*128=32000..this is correct based on everything I have been reading.

The numbers can be increased but should maintain the ratio as described earlier.

Its not exactly derived off of RAM but it can affect the usage of RAM because it tells the kernel how to use RAM to process data etc. Throwing random numbers in there could really mess things up....or it could "SEEM" to improve things.

If you have a machine that uses multiple controls you just don't go in and start pulling on levers and turning handles randomly and watch to see what comes out at the other end. I think this is what the other person was doing. For example jacking your car up with the jack upside down might actually raise the car 'but' it comes with dangers.

Every where I looked uses the ratio I described so if you choose to change the values at least stick to methods used by reputable corporations.

Have fun!

jrling
Posts: 47
Joined: Wed 27 Jun 2012, 13:51

#143 Post by jrling »

I think if you feel the numbers in mpdPup are fine, I will leave well alone.

Dynobot
Posts: 44
Joined: Wed 05 Dec 2012, 12:04

#144 Post by Dynobot »

jrling

If you upsample with MPDPup do me a favor and type top to see what processes are running, then post the info here if you can.

also go to

cd /proc/asound

then find your soundcard and cd into its directory you should be able to do a ls to see whats inside, then do a....while you are playing music.

cat stream0

it should print out info on what sample rate etc is being used.

So two things if you can.
1) top
2)cat stream0

Even if you can't screen copy or cut and paste what I am looking for is 'sox' when you use the top command. And I am looking for the sample rate to be reflected in the data...probably under Altset1 when you use the cat stream0 command.

Thanks in advance.

bonalux
Posts: 22
Joined: Wed 20 Jun 2012, 11:02

Problem

#145 Post by bonalux »

@Idolse: sorry to bother you again, but last evening suddenly mpd stopped working and i was unable to recover the problem, even rebooting didn't solved it. I've tried also to reinstall all on the CF card from scratch and reconfigure it with the wizard, but it seems that for some reason, even if it's written properly in the wizard, it cannot recognize the NAS, i get this message:

# mpd
Failed to stat directory "/mnt/music/Musica": No such file or directory
Failed to load database: Failed to open database file "/mnt/home/mpd/database": No such file or directory
#

It seems that for some reason the system cannot write in the /mnt directory but don't know how to fix it.
I've tried also as another usb installer Linux Live Creator but no luck...

Thank you in advance.

edit: if i try to mount the content in /etc/fstab it says "Can not access a needed shared library" :?: :?:

Why? Who knows...

Dynobot
Posts: 44
Joined: Wed 05 Dec 2012, 12:04

#146 Post by Dynobot »

Make sure the IP address did not change...

bonalux
Posts: 22
Joined: Wed 20 Jun 2012, 11:02

#147 Post by bonalux »

Dynobot wrote:Make sure the IP address did not change...
Thanks for your reply, nas and mpd IP are static, verified them and are ok. Also folders in my nas are visible and ok from other s PC.

Dynobot
Posts: 44
Joined: Wed 05 Dec 2012, 12:04

#148 Post by Dynobot »

Open question.

From what I understand 64bit operating systems are more efficient and able to process more data per CPU cycle or something like that....

Is it possible or even worth the effort to build a 64bit version of MPDPup?

Even though MPD itself is not 64bit there is a 64bit version of alsa [which actually does the handling of data]....

I also think that going forward it might be a good idea that for those like myself who want tweaks to get incorporated into MPDPup to provide a link and data/explaination, source etc to back up or quantify the tweak.

Going forward I will make sure I do just that...

ldolse
Posts: 367
Joined: Fri 23 Oct 2009, 16:33

#149 Post by ldolse »

Hey all, haven't had a chance to catch up on forum for several days, glad to see all the activity.

Regarding processes renicing - the extra info on discovering which processes to renice is perfect - better setting of nice values is something I've wanted to get working properly for a long time.

Giving people access to source code, change records, etc is actually a fairly large priority for me - at the moment my plan is to use Fossil, which is what Puppy uses upstream. I've created a separate repository to maintain my fork but still need to merge my current tree into the repository to make it a proper fork - right now the plan is to do that in conjunction with the release I base on a 3.x kernel. Before I commence on that project I plan to get one more release with minor fixes/tweaks out based on the current kernel.

I'm hoping that moving to a change control system may encourage more direct participation in terms of contributions, but we'll have to wait and see. (edit - I think I misread when I made this response - leaving for posterity - anyway agree with Dynobot about providing references to tweaks)

64 bit would be a huge project, unless I see some convincing data that it definitely makes a big difference I can't imagine going to the effort of trying to do it. There are two big issues trying to do it - the first is upstream support - This doesn't exist in Puppy's official build systems to the best of my knowledge. The second and in some ways more challenging is that it would require the maintenance of two separate releases - one for 32bit only platforms such as Alix, and another for modern platforms supporting 64bit.


@bonalux - based on those errors something happened between mpdPup and your fileserver - maybe your fileserver IP changed, or you changed your password? Try re-running the wizard and re-configuring the network share.

bonalux
Posts: 22
Joined: Wed 20 Jun 2012, 11:02

#150 Post by bonalux »

ldolse wrote: @bonalux - based on those errors something happened between mpdPup and your fileserver - maybe your fileserver IP changed, or you changed your password? Try re-running the wizard and re-configuring the network share.
Hi Idolse, my mpd server on Alix board stopped working suddenly, if i try to run the wizard, it cannot recognise the server folder, even if nothing has changed (when stopped it was playing music an no other pc's where connected to the nas). I can still reach mpd server by ethernet but no way to see tha fileserver. To see if something changed, i've temporarily replaced the Alix with my previous Samsung Q1 and it worked perfectly without touching the configuration and the previous installation on a usb stick...i'm really puzzled.

From what i can see (but i'm a noob...) appears that for some reason my new installation on the CF of the Alix cannot mount in the music folder my nas, can it be some permission that has to be fixed?

Thanx.

ldolse
Posts: 367
Joined: Fri 23 Oct 2009, 16:33

#151 Post by ldolse »

I'm not sure exactly what you mean by this statement:
bonalux wrote:if i try to run the wizard, it cannot recognise the server folder
Specific descriptions of exactly what you're seeing help immensely.

Can you ping your fileserver from the command line?


If you can't figure it out at all you could try starting from scratch by deleting your savefile from another system - it's the .2fs file on the flash device. This will put things back in a virgin state and you can start over.

Dynobot
Posts: 44
Joined: Wed 05 Dec 2012, 12:04

#152 Post by Dynobot »

@Bonalux

Sounds like a hardware issue.

If MPDPup works fine from another computer 'untouched' but does not on another then it should not be the software.

run mpdpup in the machine that is having the problem, then from another machine check the router to see if the machine actually has network connection and an IP address. Confirm that IP address in the client too.

BTW, are you using any tweaks?

bonalux
Posts: 22
Joined: Wed 20 Jun 2012, 11:02

#153 Post by bonalux »

ldolse wrote:I'm not sure exactly what you mean by this statement:
bonalux wrote:if i try to run the wizard, it cannot recognise the server folder
Specific descriptions of exactly what you're seeing help immensely.

Can you ping your fileserver from the command line?
I wasn't clear, when i run the wizard, the first step asks for IP, share name and folder, i fill the fields and go ahead, i leave blank password and user fields because there is not a pwd and OK, then after some passages it asks to verify if it can mount the shared folder, i say yes but it cannot find it (unable to mount the smb share). Parameters checked trice and the same parameters are working with the other installation (that is on a different usb key and pc).

This evening when home i try to ping the nas to see what happens. i don't think it's a hardware problem because i can acces the alix for configuration etc... so the net it's ok.

Thanx a lot to all.

bonalux
Posts: 22
Joined: Wed 20 Jun 2012, 11:02

#154 Post by bonalux »

Don't ask me why but today i've tried reinstalling all and now it's working again :roll:
Only difference from last effort was that after every mod at config (first auto wizard, changing mpd version, unmuting waveio in alsa and doing usbnrpack mod) i've rebooted and waited a little before continuing (the first reboot i've waited till the database rebuild was done).

Don't have the time and patience to retry again and see if it works because of this procedure or not :oops: sorry.

Thanks to all for the support.

clar2391
Posts: 6
Joined: Sun 30 Sep 2012, 17:30

MPD Version

#155 Post by clar2391 »

Is there a way (command line or other) to tell what version of MPD I'm currently running? When I go back to mpdwizard it always defaults to 0.16 and I want to be sure I'm using 0.17.

Post Reply