Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Gnome 2.32.1-r2 thinks only 2 speakers in 5.1 setup
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Slippery Jim
Apprentice
Apprentice


Joined: 08 Jan 2005
Posts: 197

PostPosted: Mon Dec 31, 2012 4:31 am    Post subject: [SOLVED] Gnome 2.32.1-r2 thinks only 2 speakers in 5.1 setup Reply with quote

My SB Live! 5.1 finally gave up the ghost, so I had to pull it, and now I'm using a USB 5.1 sound card instead.

The problem I'm having now is that everything I send to it gets downmixed to stereo, unless I explicitly tell my programs that there are 6 speakers.

The following produces correct output:

Code:

speaker-test -c6 -Dsurround51 -twav


( ?? except that it recites "Rear Center" for the LFE channel).

In VLC, in addition to selecting the correct audio output device, I also had to go into the advanced preferences and set the audio output channels to "Surround 5.1". Now VLC works.

But totem doesn't seem to have the second option. Nothing under Preferences->Audio->"Audio output type" has any effect.

Is there a way I can tell ALSA to make "surround51" the default ALSA profile for this card, so I don't have to explicitly tell every program to use it?

The card is a Zalman RSSC V2. From lsusb: "ID 0d8c:0102 C-Media Electronics, Inc. CM106 Like Sound Device"

(Oh yeah, Happy New Year.)


Last edited by Slippery Jim on Sun Feb 24, 2013 1:24 am; edited 1 time in total
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Mon Dec 31, 2012 8:35 am    Post subject: Re: Gnome 2.32.1-r2 thinks I only have two speakers in 5.1 s Reply with quote

Slippery Jim wrote:
gets downmixed to stereo

It's probably just taking the 2 stereo channels and outputting them to the stereo speakers.

Quote:
Is there a way I can tell ALSA to make "surround51" the default ALSA profile for this card, so I don't have to explicitly tell every program to use it?

Yes - google it. Redefine pcm.!default in ~/.asoundrc

If you're wanting to upmix music, then see my ~/.asoundrc for the best method.
_________________
Improve your font rendering and ALSA sound
Back to top
View user's profile Send private message
Slippery Jim
Apprentice
Apprentice


Joined: 08 Jan 2005
Posts: 197

PostPosted: Mon Dec 31, 2012 9:23 am    Post subject: Re: Gnome 2.32.1-r2 thinks I only have two speakers in 5.1 s Reply with quote

PaulBredbury wrote:
Slippery Jim wrote:
gets downmixed to stereo

It's probably just taking the 2 stereo channels and outputting them to the stereo speakers.


I fed it a six channel source, and all the channels are audible on the front two speakers, with nothing on the other speakers. That's what I mean by "downmixing".

Quote:

Quote:
Is there a way I can tell ALSA to make "surround51" the default ALSA profile for this card, so I don't have to explicitly tell every program to use it?

Yes - google it. Redefine pcm.!default in ~/.asoundrc


I've been having a surprisingly difficult time getting any useful hits on this from google. Lots of stuff to set the card and device, but I couldn't find any syntax examples for setting the profile. If you could post an example definition, it would really help.
Quote:

If you're wanting to upmix music, then see my ~/.asoundrc for the best method.

I'll check it out. thanks. I never appreciated how awesome the emu10k1 hardware mixing was until it was gone.


Last edited by Slippery Jim on Sun Feb 24, 2013 4:28 am; edited 1 time in total
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Mon Dec 31, 2012 9:39 am    Post subject: Re: Gnome 2.32.1-r2 thinks I only have two speakers in 5.1 s Reply with quote

Slippery Jim wrote:
I've been having a surprisingly difficult time getting any useful hits on this from google.

Oh come on. Search terms: alsa pcm redefine default "surround51"

I've added an example to my config, linked in my sig.
_________________
Improve your font rendering and ALSA sound
Back to top
View user's profile Send private message
Slippery Jim
Apprentice
Apprentice


Joined: 08 Jan 2005
Posts: 197

PostPosted: Mon Dec 31, 2012 9:47 am    Post subject: Reply with quote

okay, I tried:

Code:

pcm.!default surround51:Device


This makes surround51 the default device, as far as speaker-test is concerned, but gnome still completely ignores this, and does it's own thing. Any idea how to tell gnome what to do?
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Mon Dec 31, 2012 10:39 am    Post subject: Reply with quote

Be more specific. What are do doing, what app is running. Are you running pulseaudio?
Back to top
View user's profile Send private message
Slippery Jim
Apprentice
Apprentice


Joined: 08 Jan 2005
Posts: 197

PostPosted: Mon Dec 31, 2012 10:58 am    Post subject: Reply with quote

Stock stable gentoo, gnome desktop profile, with no sound servers running. Just bare ALSA.

I'm testing with totem (which I guess is really gstreamer under the hood), speaker-test and vlc. Mouseover audio previews behave like totem, so I guess that's also gstreamer.

Redefining the default pcm device was a red herring, but it did show that Gnome is not targeting the default speaker profile; if it had been, then it should have fixed the problem.

So it looks like Gnome thinks that the card is only stereo capable (for whatever reason) and therefore automatically downmixes any multichannel stream I play via gstreamer.

I suspect that the USB audio device is misreporting its capabilities in some manner. I find it odd that I had to reconfigure VLC by hand to tell it how many output channels I have, even after I told it to target the surround51 profile. Before I did that, VLC was also downmixing. Here's the output of aplay -L:

EDIT: I just noticed that there is no profile named "default" for this device, but there is one named "sysdefault". Perhaps this is the problem?

Code:
james@Rainsong ~ $ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
sysdefault:CARD=Device
    USB Sound Device, USB Audio
    Default Audio Device
front:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    Front speakers
surround40:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
Back to top
View user's profile Send private message
Slippery Jim
Apprentice
Apprentice


Joined: 08 Jan 2005
Posts: 197

PostPosted: Sun Feb 24, 2013 1:14 am    Post subject: Reply with quote

I made some progress on this. Turns out it isn't necessary to remap the default audio device in order to get gnome (gstreamer really) to use a specific audio device.

In the gconf editor, under system->gstreamer->0.10->default, there are a bunch of keys related to audio and video sources and sinks. The relevant ones for audio output are:
Code:

audiosink
chataudiosink
musicaudiosink

I first tried changing their values from autoaudiosink to surround51, but gstreamer was still downmixing to stereo.
Next, I tried plughw, and Bingo! Now I was getting discrete channels out of each speaker, but they were all swapped around in the wrong places! (Windows order: (0,1),(4,5),(2,3)).
So I took what I learned from PaulBredbury above (Thanks for helping, Paul!), and wrote a swap entry in my .asoundrc file:
Code:

# ONLY NECESSARY IF YOUR CHANNELS ARE IN WINDOWS-ORDER!
pcm.swap51 {
   type route
   slave.pcm "plughw:CARD=Device"
   slave.channels 6
   ttable.0.0 1
   ttable.1.1 1
   ttable.2.4 1
   ttable.3.5 1
   ttable.4.2 1
   ttable.5.3 1
}

Finally, I set the three sink keys to this new swap51 device, and now gstreamer plays proper discrete 5.1 surround sound out my speakers when I click or hover on a 6 channel sample.

NOTES:

speaker-test plays discrete windows-order channels out of both hw and plughw, and it plays correct-order channels out of swap51 and surround51. This implies that, for this hardware, hw really is a multichannel device, and not stereo or something (proof that gstreamer is downmixing to stereo before it gets to the device).

aplay and speaker-test have no problems playing correct discrete sounds out of the correct speakers with the surround51 device. I think gstreamer has issues with audio devices that can't convert samples to the correct formats. gstreamer appears to fall back to stereo in software if the device can't handle what gstreamer feeds it. I deduce this from the fact that gstreamer downmixes hw and surround51, but not plughw or swap51. So whatever is different with plughw vs. hw, this difference makes gstreamer happy.

There is a GUI tool, gstreamer-properties, which allows you to set default audio and video sources and sinks for gstreamer, but it only affects audiosink and audiosrc gconf keys. If you want gstreamer to play correctly, you have to set the musicaudiosink key. I don't know what programs use the straight audiosink. This program is not in the foot menu anywhere (I think it used to be), so you have to go find it in the file manager, or use a terminal to get it.

Also, you could probably use gconftool-2 instead of gconf-editor, but I didn't try it.

So, here's the takeaway: you can set gstreamer to use any sound device you want, just by setting the musicaudiosink key in gconf-editor to point to your favourite ALSA device. You don't need to do any custom .asoundrc stuff, unless you have weird hardware like I do.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
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