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

For talk and support relating specifically to Puppy derivatives
Post Reply
Message
Author
Dynobot
Posts: 44
Joined: Wed 05 Dec 2012, 12:04

#121 Post by Dynobot »

jrling wrote: I had arrived at the same conclusion.

Having said that, there are one or two of his suggestions that I might try. For instance I run mpdPup headless and no networking for music, so the mouse polling and TCP 'turning off' ones might have some merit. Worth a try anyhow.

Do you credit his ehci suggestions as being worthy?

My Tranquil PC T2E has four USB ports on the rear panel (I have disabled the onboard USB header in the BIOS) and I only use one for my WaveIO USB/S/PDIF converter. So I wondered if I could turn off all but one USB port in Linux?

Finally, you made a sweeping statement (!) - and even though some of the kernel tweaking can be done with proper numbers MPDPup is already at optimal Could I gently question that? I am not suggesting that you are wrong, but I suspect that Puppy Linux kernel on which mpdPup is based is certainly not aimed at audiophiles and unless those settings have been modified before mpdPup release, they might not be optimal. But of course with all the variables of individual hardware set-ups, there is probably no such thing as optimal.

Regards
Hi jrling,

Yes I realized afterwards that the optimal statement was general and not exactly true. I did play with some of the kernel numbers with correct values and found that the stock values sounds best. Hence the statement....but what is best for me might not be for another.

As far as the TCP ....are you suggesting turning off network capabilities? If so then you will not be able to get back into the OS to make any further changes.

With another distro of Linux I used a program called Tree to help me unbind hardware from the OS. After a lot of work I actually did not hear much of a benefit.

What I did hear a nice benefit from is setting affinity for the MPD to run in a CPU by itself.

Also even though the OS does not use swapping, there is a value in the swappiness setting of 60. Poking around the OS I found that even though its pretty light weight it still has some junk inside it, like sound files for sound effects and modules that might be loaded for printing etc.

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

#122 Post by jrling »

Dynobot wrote:
jrling wrote: I had arrived at the same conclusion.

Having said that, there are one or two of his suggestions that I might try. For instance I run mpdPup headless and no networking for music, so the mouse polling and TCP 'turning off' ones might have some merit. Worth a try anyhow.

Do you credit his ehci suggestions as being worthy?

My Tranquil PC T2E has four USB ports on the rear panel (I have disabled the onboard USB header in the BIOS) and I only use one for my WaveIO USB/S/PDIF converter. So I wondered if I could turn off all but one USB port in Linux?

Finally, you made a sweeping statement (!) - and even though some of the kernel tweaking can be done with proper numbers MPDPup is already at optimal Could I gently question that? I am not suggesting that you are wrong, but I suspect that Puppy Linux kernel on which mpdPup is based is certainly not aimed at audiophiles and unless those settings have been modified before mpdPup release, they might not be optimal. But of course with all the variables of individual hardware set-ups, there is probably no such thing as optimal.

Regards
Hi jrling,

Yes I realized afterwards that the optimal statement was general and not exactly true. I did play with some of the kernel numbers with correct values and found that the stock values sounds best. Hence the statement....but what is best for me might not be for another.

Interesting and helpful.


As far as the TCP ....are you suggesting turning off network capabilities? If so then you will not be able to get back into the OS to make any further changes.

Good point. I have been influenced by 'Tony's Player' and John Swenson on AA in assuming networking running whilst playing music is a 'bad thing'! What would be good, but not practical I suspect, is the sort of CMP/CPLAY approach of turning off virtually every process before starting to play and waking them up again on finishing. Do you think that approach is worth thinking about for mpdPup?

With another distro of Linux I used a program called Tree to help me unbind hardware from the OS. After a lot of work I actually did not hear much of a benefit.

You might have saved me a lot of time and heartache

What I did hear a nice benefit from is setting affinity for the MPD to run in a CPU by itself.

I am looking forward to ldolse implementing those packages for us to be able to do that

Also even though the OS does not use swapping, there is a value in the swappiness setting of 60. Poking around the OS I found that even though its pretty light weight it still has some junk inside it, like sound files for sound effects and modules that might be loaded for printing etc.

If I knew more about what I was doing, I would be rooting out those processes that are 'unnecessary' in my dedicated approach (which of course will not suit everyone). Any pointers to their deletion much appreciated


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

#123 Post by ldolse »

The ehci stuff is interesting to me because most people are using USB DACs with Linux, but the same settings may be radically different for a use case like jrling with USB attached storage.

The other kernel parameters are of interest, but I agree with Dynobot that there needs to be some method to the madness around the choice of defaults, and if I add a tweak to mpdPup's UI I'd like to be able to explain to a user the theory as to why it might affect the sound. As the only deep dive discussions I've seen on the settings relate to Oracle/DB2 I'm inclined to leave the defaults for now.

Regarding swappiness, I'm not sure I understand how it could impact the sound at all because it just affects when Linux decides to use the swap file, without a swap file I don't see how it would apply. I do think some of those /proc/sys/vm/dirty numbers may apply in the way you're thinking, since even though the file system is in RAM system memory is separate from filesystem memory and those figures may affect data being swapped between two different memory locations.

Regarding cruft that's still in the iso, as long as the file isn't doing something to actively change the system configuration I don't see how they can affect the sound - it just uses a bit of extra RAM. The sound sample files take up a bit of space, but I think they're fun, and I don't see how they can affect the system performance. Other cruft like printer drivers, etc should all be disabled already, affecting memory a bit but they shouldn't affect performance. I cherry pick more things for removal each release, but it's getting harder to find broad categories of files which make much of a difference in terms of reward vs. effort - please feel free to list out specific areas that are ripe for removal.

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

Problem with alsamixer

#124 Post by bonalux »

Hi Idolse and all, i need some help again I've installed mpdpup on the Alix board, all went well and configured the wizard with no problem, but when trying to unmute my waveio, the unmute command seems to not working and if i try to open alsamixer i'll get the message "cannot open mixer: No such file or directory", have you got a clue? Installed a fresh copy of mpdpup 0.9.3a.

Thank you very much.

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

#125 Post by ldolse »

Hi Bonalux, I still haven't released a proper fix for that, my last attempt was a failure, and while I've taken a new approach that hasn't been wrapped up into a new release. For now you just need to unmute it manually by typing 'alsamixer -c 1' (replace 1 with the number for your card). Then unmute by selecting the channel and hitting 'm'. Escape to exit, save the config by typing 'alsactl -f /etc/asound.state store'. Then reboot from the command line to make it stick.

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

#126 Post by bonalux »

Always very prompt reply, thank you. I was asking because with the previous pc i've never faced this problem, typing alsamixer was enough to launch the mixer and then unmute all.
Regarding the fix, it's really not a problem because it's a one time thing to do and then it works fine and it's only related to waveio so it's a hardware/firmware problem of it, for me it's ok just as it is ;)

Best Regards.

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

Renice script file

#127 Post by jrling »

Over on AudioAsylum Dynobot recommended some simple changes to mpdPup as follows:
========================
I used WinSCP and placed a script inside the /root/my-applications/bin directory called [anything you want].sh

#!/bin/bash
renice -10 3
renice -10 9
renice -10 13
renice -10 16

Add the path to your script inside the rc.local file located in
/root/.etc/rc.d/rc.local

My path is /root/my-applications/bin/mpdstart.sh

I made sure to open up permissions to the my-app..., bin, and the script with

sudo chmod -R 755 my-applications
================================

I have now implemented them and can report a useful increase in SQ. More analogue. Well worth a go.

bark_bark_bark
Posts: 1885
Joined: Tue 05 Jun 2012, 12:17
Location: Wisconsin USA

#128 Post by bark_bark_bark »

what kernel does this have?
....

linuxbear
Posts: 620
Joined: Sat 18 Apr 2009, 20:39
Location: Las Vegas, Nevada, USA

#129 Post by linuxbear »

This is what I have been playing with recently and I have an old laptop I could install to. I am curious if anyone has tried serving audio (specifically FLAC or ogg) to an Android? How well does this work and are larger files like classical music handled well over WiFI?

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

#130 Post by Dynobot »

Is it possible to update MPD to the latest version of MPD-0.17.3.

The version installed is 0.16.8

Also is there any way to update the version manually?

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

#131 Post by jrling »

Hi Dynobot

mpdPup 0.9.3 'mpdwizard' has the option to choose MPD 16 or 17.
I run 17 and I think it is noticeably better.

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

#132 Post by Dynobot »

jrling wrote:Hi Dynobot

mpdPup 0.9.3 'mpdwizard' has the option to choose MPD 16 or 17.
I run 17 and I think it is noticeably better.
Got it...thanks!

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

#133 Post by ldolse »

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.

@bark_bark_bark - the kernel is 2.6.39-4 with the BFS Scheduler

@linuxbear - I don't think you can really stream uncompressed audio to an Android device. MPD can output an OGG or MP3 stream which an Android device should be able to consume. I know the iOS MPD client can consume a stream in this way, not 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.

linuxbear
Posts: 620
Joined: Sat 18 Apr 2009, 20:39
Location: Las Vegas, Nevada, USA

#134 Post by linuxbear »

I would be streaming ogg and flac, but find myself wondering if a long (duration in time) and complex file like a movement from a symphony would be handled well compared to more common compressed music which tend to be a lot shorter?

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

#135 Post by Dynobot »

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

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 ~ $

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

Post Reply