Welcome! Log In Create A New Profile

Advanced

MPD hickups - worth building a realtime kernel?

Posted by Fritz! 
MPD hickups - worth building a realtime kernel?
May 21, 2011 02:51AM
Hi,

as the title says I'm trying to get my Dockstar stable when playing webradio streams. That works fine for hours - then again there are hickups & glitches. CPU is ~20%.

I've tried:
- Debian vs. Emdebian
- MPD vs Mplayer
- Different mpd resamplers

All that might make a small difference (samplers a large one) - but i never got a combination that was able to play a days stream without a glitch.

So my questions are:
- Any suggestion what else to try with reasonable effort?
- Is a realtime kernel an option that makes sense?
- Any good documentation on that? There seem to be a lot of descriptions - would want to take the right approach..

Thanks!
Fritz
Re: MPD hickups - worth building a realtime kernel?
May 21, 2011 07:11AM
I highly doubt that a realtime kernel would make a difference. Playing webradio isn't a really something that requires realtime accuracy, so I don't see how it should help ;)

First of all: What are you using now? Hardware and Kernel version or anything else that could be worth mentioning.
Maybe it's just a matter of using a newer kernel, because of some bugfixes that have been added. Maybe it's a problem with memory management (swap active?) in your case. Anyway, I'd say we need more info.
Re: MPD hickups - worth building a realtime kernel?
May 21, 2011 07:32AM
Hi Ingmar,

thanks for your reply. I agree that webradio isn't really something that requires much. However I'm annoyed & stumped. Giving up & spending money on a radio seems the easiest way, but it would feel like giving up :-)

I missed to mention above that I also build my custom mpd - not much of a difference :-(

Below some informations about my Dockstar - let me know if there's more you'd like to see.

Fritz

#uname -a
Linux test2 2.6.32-5-kirkwood #1 Tue Mar 8 10:56:14 UTC 2011 armv5tel GNU/Linux

# cat /etc/apt/sources.list
deb http://cdn.debian.net/debian squeeze main

# mpd -V
mpd (MPD: Music Player Daemon) 0.16.1 

Copyright (C) 2003-2007 Warren Dukes <warren.dukes@gmail.com>
Copyright (C) 2008-2010 Max Kellermann <max@duempel.org>
This is free software; see the source for copying conditions.  There is NO
warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Supported decoders:

[mad] mp3 mp2
[oggflac] ogg oga
[flac] flac
[sndfile] wav aiff aif au snd paf iff svx sf voc w64 pvf xi htk caf sd2
[audiofile] wav au aiff aif
[faad] aac
[mpcdec] mpc
[wavpack] wv
[ffmpeg] 16sv 3g2 3gp 4xm 8svx aa3 aac ac3 afc aif aifc aiff al alaw amr anim apc ape asf atrac au aud avi avm2 avs bap bfi c93 cak cin cmv cpk daud dct divx dts dv dvd dxa eac3 film flac flc fli fll flx flv g726 gsm gxf iss m1v m2v m2t m2ts m4a m4b m4v mad mj2 mjpeg mjpg mka mkv mlp mm mmf mov mp+ mp1 mp2 mp3 mp4 mpc mpeg mpg mpga mpp mpu mve mvi mxf nc nsv nut nuv oga ogm ogv ogx oma ogg omg psp pva qcp qt r3d ra ram rl2 rm rmvb roq rpl rvc shn smk snd sol son spx str swf tgi tgq tgv thp ts tsp tta xa xvid uv uv2 vb vid vob voc vp6 vmd wav wma wmv wsaud wsvga wv wve

Supported outputs:

shout null fifo alsa ao oss httpd recorder 

Supported encoders:

null vorbis wave flac 

Supported protocols:

file:// http:// mms:// mmsh:// mmst:// mmsu:// gopher:// rtp:// rtsp:// rtmp:// rtmpt:// rtmps://

music_directory         "/var/lib/mpd/music"
playlist_directory              "/var/lib/mpd/playlists"
volume_normalization "yes"
db_file                 "/var/lib/mpd/tag_cache"
log_file                        "/var/log/mpd.log"
pid_file                        "/var/run/mpd/pid"
state_file                      "/var/lib/mpd/state"
user                            "mpd"
bind_to_address                 "any"
follow_outside_symlinks "yes"
follow_inside_symlinks          "yes"
input {
        plugin "curl"
}
audio_output {
        type            "alsa"
        name            "My ALSA Device"
        #audio_output_format             "48000:16:2"
        audio_output_format             "48000:1"
        #samplerate_converter            "Linear Interpolator"
        #samplerate_converter            "Internal"
        #samplerate_converter           "Fastest Sinc Interpolator"
        samplerate_converter           "Best Sinc Interpolator"
        device          "hw:1,0"        # optional
        #format         "44800:16:2"    # optional
        #mixer_device   "default"       # optional
        #mixer_control  "PCM"           # optional
        #mixer_index    "0"             # optional
}
mixer_type                      "hardware"
audio_buffer_size               "4096"
buffer_before_play              "30%"
filesystem_charset              "UTF-8"
id3v1_encoding                  "UTF-8"

# cat /etc/asound.conf .
pcm.!default {
   type plug
   slave.pcm {
     type dmix
     ipc_key 1024
     slave {
        pcm "hw:1,0"
        #rate 44800
     }
   }
 }

top - 12:31:14 up  2:40,  1 user,  load average: 0.03, 0.05, 0.00
Tasks:  49 total,   1 running,  48 sleeping,   0 stopped,   0 zombie
Cpu(s):  7.6%us,  0.7%sy,  0.0%ni, 91.4%id,  0.0%wa,  0.3%hi,  0.0%si,  0.0%st
Mem:    125724k total,    38984k used,    86740k free,        0k buffers
Swap:        0k total,        0k used,        0k free,    20564k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                           
  690 mpd       20   0 57000 7816 2272 S  4.3  6.2   7:37.88 mpd                                                                                
 3178 root      20   0  2552 1160  936 R  0.7  0.9   0:00.20 top                                                                                
 3184 root      20   0  1768  516  440 S  0.3  0.4   0:00.01 ping                                                                               
    1 root      20   0  2020  696  604 S  0.0  0.6   0:01.83 init                                                                               
    2 root      20   0     0    0    0 S  0.0  0.0   0:00.01 kthreadd                                                                           
    3 root      20   0     0    0    0 S  0.0  0.0   0:00.14 ksoftirqd/0                                                                        
    4 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 watchdog/0                                                                         
    5 root      20   0     0    0    0 S  0.0  0.0   0:00.10 events/0                                                                           
    6 root      20   0     0    0    0 S  0.0  0.0   0:00.00 cpuset                                                                             
    7 root      20   0     0    0    0 S  0.0  0.0   0:00.00 khelper                                                                            
    8 root      20   0     0    0    0 S  0.0  0.0   0:00.00 netns                                                                              
    9 root      20   0     0    0    0 S  0.0  0.0   0:00.00 async/mgr



Edited 2 time(s). Last edit at 05/21/2011 07:55AM by Fritz!.
Re: MPD hickups - worth building a realtime kernel?
May 21, 2011 11:37AM
You use a pretty old kernel and according to your top output you don't have any active swap. Those are two points which I'd say should be tested first. Start with adding swap and if that doesn't work try one of the newer kernels available.
Oh and I guess you use some usb dongle for sound, as the dockstar doesn't have any sound device by default.
You did see that there are a lot of people who had problems with these. Maybe there are some hints in other threads around here. ;)
Re: MPD hickups - worth building a realtime kernel?
May 21, 2011 01:44PM
Hi,

don't get me wrong proposal are good - and discussions might bring me to the right solution. Just to understand:

- SWAP - my understanding is that if I don't have swap & run out of memory applications terminate / kernel freezes? Could that really be connected to a 'glitch' which recovers within a second?

- Kernel update - mpd is rather old, so it must have been working with older kernels? Or are there specific fixes someone is aware off?

Your proposal made me thinking - I checked the background services acticve & disables samba + rsync. (Which where never used, but..)

# chkconfig  --list  |grep 5:on
bootlogs                  0:off  1:on   2:on   3:on   4:on   5:on   6:off
mpd                       0:off  1:off  2:on   3:on   4:on   5:on   6:off
ntp                       0:off  1:off  2:on   3:on   4:on   5:on   6:off
rc.local                  0:off  1:off  2:on   3:on   4:on   5:on   6:off
rmnologin                 0:off  1:off  2:on   3:on   4:on   5:on   6:off
ssh                       0:off  1:off  2:on   3:on   4:on   5:on   6:off
stop-bootlogd             0:off  1:off  2:on   3:on   4:on   5:on   6:off

Fritz
Re: MPD hickups - worth building a realtime kernel?
May 21, 2011 03:35PM
Well, stopping the unused services might be a good idea generally, but I don't think that a service that is not accessed at all was giving you problems.

What you probably won't get here is the solution to your problems directly. Why? Because we don't have your exact setup and we don't know all the details. So, it's up to you to do some testing. Run your streaming and meanwhile (key word "screen") watch the other processes and memory status via top. Maybe then you'll see what is eating up the resources, if it indeed is another process.
But setting up swap just to be save would be a good idea anyway. Just my 2 cents.

BTW, you did already have a look at the following thread?
http://forum.doozan.com/read.php?2,2840,page=1
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: