Kodi Community Forum

Full Version: XBMC using PulseAudio or Alsa?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Linux newb here but learning fast. Does anyone know if the current SVN of the XBMC Linux build uses pulseaudio or alsa? I understand now these are 2 distinctly different sound solutions for Linux.

I believe XBMC is using Alsa. If that's true, that will at least help me in my troubleshooting as I try to get more than 2 channels of sound out under Linux.

It's weird, because XBMC seems to give me nice 5.1 sound on certain file types, but others it's getting really confused when routing sound to speakers (sound that should come from the center channel is getting pushed to the LR or even the rear surrounds, etc).

speaker-test -c 2 works great, but -c 6 gives me a buzz only out of the LR main, other channels are silent. I imagine if I can find the right combo for my sound card (mac mini nvidia) in an .asoundrc I can get this working.

But I at least first need to know if I totally can ignore pulseaudio stuff.

Thanks,

BD
9.04 and SVN (future 9.10) are using ALSA!
Thanks, at least I know what to mess with now.

What's confusing me is this thread:

http://ubuntuforums.org/showthread.php?t=795525

Which has you messing with pulse conf to get the alsamixer to show all the channels you need. Right now when I run alsamixer I just see master and pcm channels, no surround channels, center, etc. But what confuses me is, why would changing a pulse daemon.conf cause Alsamixer to open up more channels? Are the two intertwined anyway as far as config goes?
Here's a copy of my /etc/asound.conf:

Code:
pcm.nforce-hw {
    type hw
    card 0
}
pcm.!default {
    type plug
    slave.pcm "nforce"
}
pcm.nforce {
    type dmix
    ipc_key 1234
    slave {
        pcm "hw:0,1"
        period_time 0
        period_size 1024
        buffer_size 4096
        rate 48000
        channels 6
    }
}
ctl.nforce-hw {
    type hw
    card 0
}

And my current ~/.asoundrc:

Code:
# for 5.1 speakers
pcm.ch51dup {
         slave.pcm surround51
         slave.channels 6
         type route
         ttable.0.0 1
         ttable.1.1 1
         ttable.0.2 1
         ttable.1.3 1
         ttable.0.4 0.5
         ttable.1.4 0.5
         ttable.0.5 0.5
         ttable.1.5 0.5
}

# for 4.1 speakers
pcm.ch41dup {
         type route
         slave.pcm surround41
         slave.channels 5
         ttable.0.0 1
         ttable.1.1 1
         ttable.0.2 1
         ttable.1.3 1
         ttable.0.4 0.5
         ttable.1.4 0.5
}
BDPNA Wrote:Thanks, at least I know what to mess with now.

What's confusing me is this thread:

http://ubuntuforums.org/showthread.php?t=795525

Which has you messing with pulse conf to get the alsamixer to show all the channels you need. Right now when I run alsamixer I just see master and pcm channels, no surround channels, center, etc. But what confuses me is, why would changing a pulse daemon.conf cause Alsamixer to open up more channels? Are the two intertwined anyway as far as config goes?

Everything is much less confusing if you remove pulseaudio altogether Smile
csbook Wrote:Everything is much less confusing if you remove pulseaudio altogether Smile

definitely true Wink
Will that potentially break my sound in xbmc? I'm just afraid I guess.

If I wanted to remove it, what all should I remove thru package manager? Everything that says pulse? Sure is a lot there. Sorry for the dumb questions.

Even if I remove it though, I have a feeling alsa will still only be channel, right?
erhnam Wrote:9.04 and SVN (future 9.10) are using ALSA!

corection, XBMC uses alsa if pulseaudio isn't availble. So both are supported
You're not the only user with sound issues and the mac mini. I'm sure there is an asound out there for you, or maybe better support with a newer version of ALSA.

You should try the alsa upgrade script: http://ubuntuforums.org/showthread.php?p=6589810

User written for updating alsa before upstream gets updated.

And definitely remove pulseaudio, it has no purpose in HTPC (In my opinion.)
Code:
apt-get remove pulseaudio
asoundconf reset-default-card
asoundconf list
asoundconf set-default-card CARD
Replace "CARD" with the card that is listed with asoundconf list.
Topfs2 Wrote:corection, XBMC uses alsa if pulseaudio isn't availble. So both are supported

But pulseaudio sucks, so don't waste your time.
althekiller Wrote:But pulseaudio sucks, so don't waste your time.

Depends on your point of view Wink PAPlayer benefits greatly from pulse over alsa, but if we are trying to get any form of passthrough then pulse is a nogo.
And nav sounds play 2hrs (1s, but the exaggeration is warranted) late.
Haha, blame to SDL not pulseaudio. They keep the buffer filled even if nothing is played, so when something is played, it needs to first pass the zeroed data. And pulse audio has a gigantic buffer so it takes a while (1s or so seems about right).

The gigantic buffer is actually why PAPlayer benefits, since then it can pause longer. Also less sensitive to disturbance on crossfades.
Thanks for the advice here. I totally removed pulseaudio for now in the hopes I can get this mac mini working. The only side effect of removing pulseaudio seems to be the loss of system sounds in XBMC but that's no big deal.

Running a speaker-test -c 6 still only gives me sound through front left and front right speakers. No sound for center or surrounds or LFE.

XBMC compensates for the most part though somehow -- Most audio formats seem to be remapping to proper speakers inside XBMC except for a few which are throwing main speakers through the rear surrounds.

Unfortunately I must still be mixing that magical ingredient in asoundrc or asound.conf to get this working.

Ultimately speaker-test -c 6 is supposed to work for all speakers if I have alsa set up correctly, I assume?
BDPNA Wrote:Running a speaker-test -c 6 still only gives me sound through front left and front right speakers. No sound for center or surrounds or LFE.

To check all speakers You could use this command
Code:
speaker-test -Dplug:surround51 -c6
Pages: 1 2