Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 22 Aug 2014, 09:54
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Derivatives
mpdPup - Simplified MPD Music Server/Jukebox - v0.9.3
Moderators: Flash, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 10 of 35 [523 Posts]   Goto page: Previous 1, 2, 3, ..., 8, 9, 10, 11, 12, ..., 33, 34, 35 Next
Author Message
jrling

Joined: 27 Jun 2012
Posts: 47

PostPosted: Fri 11 Jan 2013, 18:27    Post subject: Renice PID Nos.  

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?id=system_configuration


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
Back to top
View user's profile Send private message 
jrling

Joined: 27 Jun 2012
Posts: 47

PostPosted: Sat 12 Jan 2013, 08:13    Post subject:
Subject description: Renice - sync-super & att-sfs
 

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.
Back to top
View user's profile Send private message 
Dynobot

Joined: 05 Dec 2012
Posts: 44

PostPosted: Sat 12 Jan 2013, 15:20    Post subject:  

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
Back to top
View user's profile Send private message 
jrling

Joined: 27 Jun 2012
Posts: 47

PostPosted: Sun 13 Jan 2013, 08:18    Post subject:
Subject description: Renice
 

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.
Back to top
View user's profile Send private message 
Dynobot

Joined: 05 Dec 2012
Posts: 44

PostPosted: Sun 13 Jan 2013, 08:25    Post subject:  

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

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Back to top
View user's profile Send private message 
jrling

Joined: 27 Jun 2012
Posts: 47

PostPosted: Sun 13 Jan 2013, 13:25    Post subject:
Subject description: Renice
 

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
Back to top
View user's profile Send private message 
Dynobot

Joined: 05 Dec 2012
Posts: 44

PostPosted: Sun 13 Jan 2013, 15:08    Post subject:  

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!
Back to top
View user's profile Send private message 
jrling

Joined: 27 Jun 2012
Posts: 47

PostPosted: Sun 13 Jan 2013, 16:00    Post subject:  

I think if you feel the numbers in mpdPup are fine, I will leave well alone.
Back to top
View user's profile Send private message 
Dynobot

Joined: 05 Dec 2012
Posts: 44

PostPosted: Sun 13 Jan 2013, 18:15    Post subject:  

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.
Back to top
View user's profile Send private message 
bonalux

Joined: 20 Jun 2012
Posts: 22

PostPosted: Tue 15 Jan 2013, 05:38    Post subject: Problem  

@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" Question Question

Why? Who knows...
Back to top
View user's profile Send private message 
Dynobot

Joined: 05 Dec 2012
Posts: 44

PostPosted: Tue 15 Jan 2013, 07:13    Post subject:  

Make sure the IP address did not change...
Back to top
View user's profile Send private message 
bonalux

Joined: 20 Jun 2012
Posts: 22

PostPosted: Tue 15 Jan 2013, 07:40    Post subject:  

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.
Back to top
View user's profile Send private message 
Dynobot

Joined: 05 Dec 2012
Posts: 44

PostPosted: Tue 15 Jan 2013, 19:32    Post subject:  

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...
Back to top
View user's profile Send private message 
ldolse

Joined: 23 Oct 2009
Posts: 366

PostPosted: Wed 16 Jan 2013, 11:53    Post subject:  

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.
Back to top
View user's profile Send private message 
bonalux

Joined: 20 Jun 2012
Posts: 22

PostPosted: Wed 16 Jan 2013, 20:00    Post subject:  

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.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 10 of 35 [523 Posts]   Goto page: Previous 1, 2, 3, ..., 8, 9, 10, 11, 12, ..., 33, 34, 35 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Puppy Derivatives
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1010s ][ Queries: 13 (0.0103s) ][ GZIP on ]