You are not logged in.

#1 2009-03-13 12:10:10

chochem
Member
From: Denmark
Registered: 2008-03-02
Posts: 176
Website

Audio issue(s): MPD crashes, mplayer stutters, /dev/dsp clogs up

I've been monitoring this issue for some two weeks trying to find some sense in this but without much luck. So I'm hoping somebody out there can give me a pointer.

I reinstalled Arch a month or so ago. I did the usual install-ALSA-as-per-wiki-instructions routine and hey presto there's sound. However with some caveats:
- mplayer gets into this annoying stuttering loop whenever paused (and sometimes when apparently the buffer runs out and it can't get new data quick enough, e.g. when media is on a networked drive). Sometimes it also does this with the last half second of sound if I quit playback. Starting a new mplayer instance seems to be the only thing that can cut through this.
- what's worse, MPD will inevitably crash at some point during a session. Not when playing but usually when I clear the playlist, add something new and attempt to get it going again or pause it to play something in mplayer and then attempt to resume MPD playback. This will result in a silent crash where no client program can reach the daemon and I'll have to SIGKILL it. Until this is done, it will maintain some sort of stranglehold on the sound device (e.g. attempting to write directly to /dev/dsp will result in 'device or resource busy')
- In fact, attempts to write directly to /dev/dsp also seem to loop strangely. I know the sound that 'find / > /dev/dsp' usually makes and instead of that it just seems to loop over the first half second of sound.

As I said, I've installed ALSA and made it the default sound output for both MPD and mplayer but not done much configurationa part from that (no asound.conf). The lsmod output corresponds to what the wiki says to expect. ALSA reports the card as ATI IXP and the chip as Realtek ALC655.

Here's my /etc/mpd.conf:

music_directory       "~/music"
playlist_directory    "~/music/playlists"
db_file               "~/.mpd/db"
log_file              "~/.mpd/log"
error_file            "~/.mpd/error"
pid_file              "~/.mpd/mpd.pid"
state_file            "~/.mpd/mpd.state"
user                  "mads"
bind_to_address       "127.0.0.1"
port                  "6600"
connection_timeout   "60"
#max_playlist_length  "16384"
#filesystem_charset   "ISO-8859-1"
#id3v1_encoding       "ISO-8859-1"

audio_output {
    type    "alsa"
    name    "MyAlsa"
}

and ~/.mplayer/config

# Write your default config options here!

ao=alsa
vo=xv

Offline

#2 2009-03-14 22:18:41

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,544

Re: Audio issue(s): MPD crashes, mplayer stutters, /dev/dsp clogs up

I don't know, but if you're sure you set up ALSA right (try doing it again?), try OSS.

Offline

#3 2009-03-19 11:40:59

chochem
Member
From: Denmark
Registered: 2008-03-02
Posts: 176
Website

Re: Audio issue(s): MPD crashes, mplayer stutters, /dev/dsp clogs up

Thanks for the suggestions but there isn't really that much to setting up alsa, is there? Install alsa-lib and alsa-utils, add yourself to the audio group, make sure the modules get loaded on reboot and unmute the channels. As for OSS, that seems to be just opening a whole new can o' worms....

I've tried adding the setup bits in the dmix  wiki article but it doesn't seem to have changed anything. At any rate mixing different sound sources dones't seem to pose a problem. I can have multiple sounds playing at once. Right up until some invisible point where the speakers go plop and the annoyances begin... sad

Offline

#4 2009-03-19 13:56:51

Joshmotron
Member
Registered: 2009-03-04
Posts: 21

Re: Audio issue(s): MPD crashes, mplayer stutters, /dev/dsp clogs up

For me, OSS was nothing more than just installing OSS, and adding 'oss' to daemons in rc.conf, you don't have to add yourself to audio group (I've never had to do this anywhere else before, never heard of doing so until recently, and in fact, MPD yells at me when it starts up about me being in audio group - doesn't harm anything though.)  Didn't have to load any modules or anything else.  My only personal caveat to setting up OSS was making sure to set up the correct default dsp for some programs; for instance, /dev/dsp2 is my default since I use a PCI card and that happens to be its main channel starts, so my ao=oss:/dev/dsp2.  I believed I used ALSA some time ago, but OSS has been my main one for quite some time now, and besides some odd set up things I didn't know about, it runs like a dream.

Offline

#5 2009-03-20 01:26:17

nickedlinux
Member
Registered: 2009-03-20
Posts: 4

Re: Audio issue(s): MPD crashes, mplayer stutters, /dev/dsp clogs up

I've been struggling with this same issue for 6 months now on Ubuntu with mpd and gmpc. Even switched everything over from alsa to pulseaudio to no avail. I have been able to reproduce the crash by repeatedly playing and pausing a song or switching between songs. I get no errors in pulseaudio but it locks up solid and can only be recovered by kill -9 or system restart. I'm running mpd 0.14.2 and gmpc 0.17.0 pulseaudio 0.9.10.

Last edited by nickedlinux (2009-03-20 01:27:07)

Offline

#6 2009-03-20 01:58:07

nickedlinux
Member
Registered: 2009-03-20
Posts: 4

Re: Audio issue(s): MPD crashes, mplayer stutters, /dev/dsp clogs up

I've submitted a bug report w/ mpd here:

http://musicpd.org/mantis/view.php?id=2181

Offline

#7 2009-03-20 06:41:29

chochem
Member
From: Denmark
Registered: 2008-03-02
Posts: 176
Website

Re: Audio issue(s): MPD crashes, mplayer stutters, /dev/dsp clogs up

Thanks for sharing, nickedlinux. I seem to recall however, that just playing and pausing MPD has not been able for to crash it for me, so I'm currently investigating the idea that mplayer might be my culprit:

pacman -Ru mplayer && pacman -S vlc

I'm only on day one of the experiment but so far no crashes.

Offline

#8 2009-03-20 16:56:18

ourina
Member
Registered: 2009-03-20
Posts: 2

Re: Audio issue(s): MPD crashes, mplayer stutters, /dev/dsp clogs up

I am having the exact same problem with mplayer on debian, and I can't seem to find any information on it anywhere.

When mplayer is paused, I am getting the exact same looping audio (it sounds like when a CD player is stuck). When this happens, I can't even get mpg123 to play audio files, it just freezes.

Offline

#9 2009-03-20 16:57:19

ourina
Member
Registered: 2009-03-20
Posts: 2

Re: Audio issue(s): MPD crashes, mplayer stutters, /dev/dsp clogs up

Oh, I should also mention that this doesn't happen if I use "mplayer -ao oss".

Offline

#10 2009-03-28 11:10:51

chochem
Member
From: Denmark
Registered: 2008-03-02
Posts: 176
Website

Re: Audio issue(s): MPD crashes, mplayer stutters, /dev/dsp clogs up

Well, mplayer can be ruled out as it also happens with VLC (set to use ALSA and default sound output). So logically, I guess it has to be a general Sound/ALSA issue. I tried adding more specific dmix info to my mpd.conf ALSA profile:

        options        "dev=dmixer"
        device        "plug:dmix"

but the only difference is that now MPD doesn't crash silently but by going into the same kind of stuttering as mplayer.

Guess my only option now is to try to go with some OSS or PulseAudio scheme neutral

Offline

#11 2009-03-28 19:09:36

nickedlinux
Member
Registered: 2009-03-20
Posts: 4

Re: Audio issue(s): MPD crashes, mplayer stutters, /dev/dsp clogs up

My wife is fed up with this problem and wants the house computer back to MS Windows... as a concession I've created her a little script and launcher:

echo "Killing MPD and Pulseaudio Sound Server..."
echo
pkill -9 mpd
pkill -9 pulseaudio 
sleep 2 
echo "Starting Pulseaudio Sound Server..."
echo
pulseaudio -D -vv
sleep 2
echo "Starting MPD Music Server..." 
echo
mpd
echo
echo
echo "Sound System Repaired - Press Enter to Continue"
read 0

Offline

#12 2009-03-30 20:52:41

chochem
Member
From: Denmark
Registered: 2008-03-02
Posts: 176
Website

Re: Audio issue(s): MPD crashes, mplayer stutters, /dev/dsp clogs up

Can't say I blame her, nickedlinux smile A bit surprised (and miffed) to hear that a non-ALSA based system is affected (if it is indeed the same issue)... Do you use the MPD build for Pulse or just let it capture MPD's ALSA output by plugin?

Offline

#13 2009-04-02 05:35:13

nickedlinux
Member
Registered: 2009-03-20
Posts: 4

Re: Audio issue(s): MPD crashes, mplayer stutters, /dev/dsp clogs up

chochem wrote:

Can't say I blame her, nickedlinux smile A bit surprised (and miffed) to hear that a non-ALSA based system is affected (if it is indeed the same issue)... Do you use the MPD build for Pulse or just let it capture MPD's ALSA output by plugin?

I switched my system from ALSA to Pulseaudio thinking it would fix this issue sad Currently, I have MPD 0.14.2 set up like this:

audio_output {
        type                    "pulse"
        name                    "My Pulse Output"
}

Offline

#14 2009-04-14 22:48:57

chochem
Member
From: Denmark
Registered: 2008-03-02
Posts: 176
Website

Re: Audio issue(s): MPD crashes, mplayer stutters, /dev/dsp clogs up

Just to say that this issue is sorta solved for me, as I did a completely new install - with Pulse tAudio but I'm pretty sure that basic ALSA was working without a hitch before I switched. A lot of things differentiate the oldand new installs but a few things stand out (mostly probably completely irrelevant - leaving it as an exercise to the reader...):
- used the official 2009.02 installer not the RC
- used ext3 instead of ext4
- followed the wiki to the letter, that is using auto-loading modules but explixitly specifying the two mentioned, using modrobe.conf for the pc_speaker module, not unmuting any other channels than Master and PCM, etc.
- used completely new configuration files - not jsut throwing all the old ones at it and then trying to adjust
- got sound working as one of the first jobs after basic install - and made a partimage file beforehand and afterwards.
After PulseAudio install: Installed mplayer-pulse and mpd-pulse from the AUR and confgured them for PA.

Last edited by chochem (2009-04-15 13:26:58)

Offline

#15 2009-06-27 06:32:38

listdata
Member
Registered: 2008-12-23
Posts: 102
Website

Re: Audio issue(s): MPD crashes, mplayer stutters, /dev/dsp clogs up

ourina wrote:

Oh, I should also mention that this doesn't happen if I use "mplayer -ao oss".

Hey, thanks, using "-ao oss" instead of "-ao alsa" (on the client machine) really made the difference. Just as a reference to other people, my symptoms with the -ao alsa flag were (in a network music sharing-with-MPD setup):
* After about 10-15 minutes of receiving a high-bandwidth ("10" ogg quality, which is about ~50 KB (bytes, not bits)) network MPD icecast ogg stream, mplayer would stutter a lot a bit randomly (especially after lots of switching between different tracks)
* If I paused the MPD stream from ncmpcpp, mplayer would go into an infinite loop

Both of the above problems were fixed with the change to oss.

Offline

#16 2009-08-01 17:28:42

mente
Member
Registered: 2009-01-05
Posts: 11

Re: Audio issue(s): MPD crashes, mplayer stutters, /dev/dsp clogs up

Having the same issue with mplayer. Using hw instead of dmix helped for me. But I want dmix back! sad Any ideas how?
Technical details

Last edited by mente (2009-08-01 17:32:09)

Offline

Board footer

Powered by FluxBB