![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
|
Outdated Tutorials & Tips Outdated Tutorials & Tips |
|
|
Thread Tools | Display Modes |
|
|
#1 | |||
|
Way Too Much Ubuntu
![]() Join Date: Jan 2006
Location: Bristol, UK
Beans: 268
Ubuntu 9.10 Karmic Koala
|
HOWTO: Surround sound in pulseaudio
Update 05/11/09: Attention everyone. This guide is now OUTDATED and no longer necessary. Configuring surround sound is now ridiculously easy in Ubuntu 9.10 (Karmic) - just go into the hardware tab in sound preferences, click the device to configure, then select a surround sound profile from the drop down box. There is NO NEED to use this guide at all any more!
Note: This guide has undergone a major revision. It does not suggest editing system-wide configuration files any more, and HAL based auto-detection should still work even if you do it the "hard way". Hi everyone. I have an m-audio revolution 7.1 sound card and after struggling for a while to get surround sound, I thought that now I've succeeded it would be a good idea to post my experiences here. If you somehow mess up your sound following this guide, don't worry, if you followed my commands you will have taken backups. To restore these, skip to the end of the guide. This guide assumes you actually have surround sound speakers First things first: PULSEAUDIO DEFAULTS TO ONLY TWO CHANNELS! The above is important to note before you go messing up your asoundrc or anything like that. It is probably VERY EASY to get surround sound working just by changing one config option. First copy the system config files to your home directory, we want to change these settings on a per user basis. If you have already modified the config files in ~/.pulse, you don't need to do this, it will erase your modified user settings. Code:
cp /etc/pulse/daemon.conf /etc/pulse/default.pa -t ~/.pulse/ If you have one of the following combinations of speakers, you are in luck, you can do it the easy way. If you have some other combination, skip to the next section. 2.0, 4.0, 5.0, 5.1, 7.1 Simply open a terminal and do: Code:
gedit ~/.pulse/daemon.conf Code:
; default-sample-format = s16le ; default-sample-rate = 44100 ; default-sample-channels = 2 Now restart pulseaudio (easiest way is to restart ubuntu) and bingo, surround sound should be perfectly working. If you have a surround sound setup not listed here, you need to do it the hard way. Sorry! The Hard Way You will need to use this method if you have one of the following speaker configurations: 2.1, 4.1, 6.0 Or pretty much anything else that isn't listed in the easy method above. WARNING: This method is a bit hackish and more likely to cause problems than the officially sanctioned "easy way". Why is it harder? Pulseaudio has a somewhat weird way for users to define what channels they want. There are essentially two ways of doing it as far as I can gather. The easy way is the method outlined further above, where pulseaudio allocates the number of channels you tell it to, but in a set order. The order goes: FL, FR, RL, RR, CEN, LFE, SL, SR So if you have a subwoofer and four speakers you're really in a bit of trouble here, because if you tell pulseaudio to use 6 channels, you get low frequency subwoofer sound, but surround sound movies send sound to a centre speaker that doesn't exist, and you don't get any voice on the front speakers. But if you tell pulseaudio that you have four channels, the subwoofer gets no sound. In this case you must define what channels to use manually. Open a terminal and type: Code:
gedit ~/.pulse/default.pa Code:
### Load audio drivers statically (it's probably better to not load ### these drivers manually, but instead use module-hal-detect -- ### see below -- for doing this automatically) #load-module module-alsa-sink #load-module module-alsa-source device=hw:1,0 .endif Code:
### Load audio drivers statically (it's probably better to not load ### these drivers manually, but instead use module-hal-detect -- ### see below -- for doing this automatically) ### Manual config for configuring surround sound. Comment out line below to revert to defaults. load-module module-alsa-sink device_id=0 channels=5 channel_map=front-left,front-right,rear-left,rear-right,lfe #load-module module-alsa-source device=hw:1,0 .endif You can configure your own system by replacing my configuration line with the following template. It's important to note here that the order of these channels makes a difference. If you find that some channels are reversed, eg centre/sub is swapped with rear right/left, then you can simply change the order they are allocated to swap them back round again. Most sound cards will want these channels allocated in the usual way. Code:
load-module module-alsa-sink device_id=X channels=X channel_map=x,x,x,x,x,x,x Quote:
For reasons why this is a problem, see this link, quoted below: Quote:
NOTE: If you have a subwoofer, it's almost certainly more desirable to load it as "lfe", NOT "subwoofer". "Lfe" means low frequency effects. This may seem counterintuitive, but as far as I can tell, the subwoofer channel is almost always labelled "lfe". When you have finished, save and exit the file. You will need to restart pulseaudio for the changes to take effect. The easiest way to do this is to restart ubuntu. Finished! When you boot up, you should have surround sound on all the channels you specified, and output channels for which there is no corresponding output device should be automagically upmixed into the other speakers. Try it out with a surround sound movie or music track. If this works, well done, you've done it. Alternatively, if you have added the pulseaudio device in your asoundrc, you can use the command: Code:
speaker-test -c #channels If you don't get surround sound, first check the channels aren't actually muted. Open a terminal and type Code:
alsamixer ![]() You may need to try shared or independent surround, and make sure surround is unmuted. (If anyone has more information about this, I'll include it here). NOTE: If you have swapped channels (eg centre/sub is swapped with rear right/left) then it's pretty easy to swap these back. This is a common problem with ICH4 and ICH5 cards, and the solution is explained on page 2 of this thread. If you have no sound, or it's all gone horribly wrong somehow, don't panic! Open a terminal and type the following: Code:
cp /etc/pulse/default.pa ~/.pulse/default.pa && cp /etc/pulse/daemon.conf ~./pulse/daemon.conf I hope this guide was helpful! If you have problems, please post in this thread and include the contents of ~/.asoundrc, ~/.pulse/daemon.conf and ~/.pulse/default.pa. Also useful would be the result of: Code:
aplay -L && aplay -l Code:
pulseaudio -k && pulseaudio -vv Sam
__________________
- Howto: Safely change the system hostname - Howto:Install projectM on Ubuntu Hardy for awesome music visualizations - Howto: Install microdc2, the command line direct connect client - Howto: Surround sound in pulseaudio Last edited by sammydee; November 5th, 2009 at 12:09 PM.. |
|||
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|