My favorites | Sign in
Logo
Project hosting will be READ-ONLY Wednesday at 8am PST due to brief network maintenance.
             
New issue | Search
for
| Advanced search | Search tips
Issue 17703: Proper Multi-channel audio support in Linux.
4 people starred this issue and may be notified of changes. Back to list
 
Reported by ajw...@chromium.org, Jul 24, 2009
The alsa implementation currently cannot handle anything other than 2-
channel audio.

Being able to support outputting to a multi-channel capable sound card is a 
nice to have by beta.
Comment 1 by ajw...@chromium.org, Jul 24, 2009
(No comment was entered for this change.)
Labels: video
Comment 2 by evan@chromium.org, Jul 27, 2009
(No comment was entered for this change.)
Labels: -OS-All OS-Linux
Comment 3 by ajw...@chromium.org, Jul 29, 2009
(No comment was entered for this change.)
Labels: -Mstone-LinuxBeta Mstone-X
Comment 4 by scherkus@chromium.org, Aug 14, 2009
(No comment was entered for this change.)
Labels: HTML5
Comment 5 by scherkus@chromium.org, Aug 19, 2009
Did some testing: ALSA works great with multi channel... except our channel mapping
is incorrect.  It looks like a lot of the audio got pumped to the left speaker on my
headphones.

We can either downmix to stereo (lame but easy) or we can swizzle the channels to
ALSA's preferred format (testing = watch some 5.1 movies!!!)
Comment 6 by scherkus@chromium.org, Aug 25, 2009
(No comment was entered for this change.)
Owner: fbarch...@chromium.org
Comment 7 by phthoruth, Aug 25, 2009
folding is the easier change, because it can channel swap for free.
The ALSA channel layout appears to be:
0 - Front Left
1 - Front Right
2 - Rear Left
3 - Rear Right
4 - Center
5 - LFE

Comment 8 by scherkus@chromium.org, Sep 21, 2009
(No comment was entered for this change.)
Labels: -Pri-3 -Mstone-X Pri-1 Mstone-4
Comment 9 by scherkus@chromium.org, Sep 25, 2009
(No comment was entered for this change.)
Labels: -Area-Misc Area-BrowserBackend
Comment 10 by scherkus@chromium.org, Oct 02, 2009
(No comment was entered for this change.)
Labels: -Size-Medium
Comment 11 by ajw...@chromium.org, Oct 05, 2009
(No comment was entered for this change.)
Labels: -Pri-1 Pri-2
Comment 12 by scherkus@chromium.org, Oct 06, 2009
 Issue 23304  has been merged into this issue.
Comment 13 by jon@chromium.org, Oct 13, 2009
Moving this out of mstone-4 and into mstone-5 after talking to the Linux 
team.
Labels: -mstone-4 mstone-5
Comment 14 by ajw...@chromium.org, Oct 14, 2009
(No comment was entered for this change.)
Owner: ajw...@chromium.org
Comment 15 by bugdroid1@chromium.org, Oct 16, 2009
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=29299 

------------------------------------------------------------------------
r29299 | ajwong@chromium.org | 2009-10-16 11:41:56 -0700 (Fri, 16 Oct 2009) | 10 lines
Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/media/audio/linux/alsa_output.cc?r1=29299&r2=29298
   M http://src.chromium.org/viewvc/chrome/trunk/src/media/audio/linux/alsa_output.h?r1=29299&r2=29298
   M http://src.chromium.org/viewvc/chrome/trunk/src/media/audio/linux/alsa_output_unittest.cc?r1=29299&r2=29298
   M http://src.chromium.org/viewvc/chrome/trunk/src/media/audio/linux/alsa_wrapper.cc?r1=29299&r2=29298
   M http://src.chromium.org/viewvc/chrome/trunk/src/media/audio/linux/alsa_wrapper.h?r1=29299&r2=29298
   M http://src.chromium.org/viewvc/chrome/trunk/src/media/audio/linux/audio_manager_linux.cc?r1=29299&r2=29298
   M http://src.chromium.org/viewvc/chrome/trunk/src/media/audio/mac/audio_output_mac.cc?r1=29299&r2=29298
   A http://src.chromium.org/viewvc/chrome/trunk/src/media/base/media_switches.cc
   A http://src.chromium.org/viewvc/chrome/trunk/src/media/base/media_switches.h
   M http://src.chromium.org/viewvc/chrome/trunk/src/media/media.gyp?r1=29299&r2=29298

Move Alsa device opening into the audio thread, and add in support for multi-channel audio.

Moving the device opening into the audio thread will prevent browser hangs for badly behaving alsa implementations (like pulseaudio) that can hang snd_pcm_open if pulseaudiod is wedged, even if SND_PCM_NONBLOCK is requested.

For multi-channel audio, device enumeration has been added to try and find a multi-channel device with a stable channel mapping.  According to http://0pointer.de/blog/projects/guide-to-sound-apis.html, default should only be used with mono and stereo stream because the channel ordering is not defined by Alsa. To get a well-defined channel ordering, one must use one of the surround40, surround51, etc., device names.  However, these device names do not always allow multiple opens, so a fallback scheme is implemented to use default if necessary.

BUG=20945,17703
TEST=listened with built-in soundcard and USB soundcard with various other audio programs running.

Review URL: http://codereview.chromium.org/275022
------------------------------------------------------------------------

Comment 16 by fbarch...@chromium.org, Oct 21, 2009
Confirmed working.  Must run like something like this
./chrome --alsa-device=surround51:1

aplay -L
gives a list of drivers
Status: Fixed
Comment 17 by ajw...@google.com, Oct 21, 2009
If you only have one audio-device on the system, it should auto-detect.

The device string will be different per computer, but should be some variant of

surroundXX

option with a plug: prefix, or a suffix specifying the exact card.
Comment 18 by mal.chromium, Dec 18, 2009
(No comment was entered for this change.)
Labels: -Area-BrowserBackend Area-Internals
Comment 19 by mal.chromium, Dec 18, 2009
(No comment was entered for this change.)
Labels: Internals-Video
Sign in to add a comment