You are not logged in.

#1 2010-10-02 10:44:34

JeffreyV
Member
Registered: 2010-07-24
Posts: 15

MPlayer + alsa playback problem

Recently I have changed my audio bitrate to 44100 because mpd was using a lot of cpu, I found a fix on their website which I literally copied to my .asoundrc below, this solved the high cpu peaks, but created another problem, when playing videos with mplayer using alsa as audio output, the video seems to stutter at certain times, every few seconds. I've been searching and searching, but I'm unable to find a working fix. I've tried to use oss yesterday, which gave me no sound at all, I have no clue why not (excuse my lack in audio knowledge).

Now I am using oss, and magically I do have sound now. But I'm still wondering why it doesn't work using alsa, is it a general alsa problem, or can it be fixed in a way?

$HOME/.asoundrc

pcm.!default {
  type plug
  slave.pcm {
    type dmix
    ipc_key 1024
    slave {
       pcm "hw:0,0"
       rate 44100
    }
  }
}

Offline

#2 2010-10-02 13:58:39

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: MPlayer + alsa playback problem

What is your CPU usage difference, with mpd, between 44100 and 48k? It *should* be negligible. If not, debug your ALSA setup, for which there are umpteen threads already.

Offline

#3 2010-10-02 18:34:12

JeffreyV
Member
Registered: 2010-07-24
Posts: 15

Re: MPlayer + alsa playback problem

brebs wrote:

What is your CPU usage difference, with mpd, between 44100 and 48k? It *should* be negligible. If not, debug your ALSA setup, for which there are umpteen threads already.

Well, it was about 20%-30% using 48k, and usually 0%-1% using 44100, so I think there is a problem in my alsa

Offline

#4 2010-10-03 10:14:22

Themaister
Member
From: Trondheim, Norway
Registered: 2008-07-21
Posts: 652
Website

Re: MPlayer + alsa playback problem

There will be resampling going on, going from 44.1kHz to 48kHz. If libsamplerate kicks in, you will _definitely_ see increased CPU usage, at least if you have a weaker CPU.
Most likely, your sound card doesn't actually support 44.1kHz if you have an on-board sound card, so dmix will resample to 48kHz anyways.

In this scenario, MPlayer will resample itself from 48kHz -> 44.1kHz and dmix will resample from 44.1kHz -> 48kHz. Which is stupid. I'd consider setting the output rate to 96000 in dmix and see what happens.

Last edited by Themaister (2010-10-03 10:14:39)

Offline

Board footer

Powered by FluxBB