View previous topic :: View next topic |
Author |
Message |
kbzium Tux's lil' helper
Joined: 31 Jul 2012 Posts: 146
|
Posted: Wed Oct 10, 2012 6:11 pm Post subject: Switching between 2 snd cards? |
|
|
Hi there,
I've got new Sennheisers 280 pro - for a gift. Until today I was using 5.1 speakers with my audigy 2 zs. The problem is audigy 2 zs doesn't have dual line out (both speakers and headphones) nor front panel so I must do it by switching cables what is troublesome. So i turned on my second, integrated card and it works fine - both of them. The thing is that i must switch between them in every audio program - how to make a shortcut or something to change default sound card?
The other thing is - how to turn off 5.1 emulation on one of this cards?
Thanks! |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Wed Oct 10, 2012 6:41 pm Post subject: Re: Switching between 2 snd cards? |
|
|
kbzium wrote: | switch between them |
Here's my script. |
|
Back to top |
|
|
aCOSwt Bodhisattva
Joined: 19 Oct 2007 Posts: 2537 Location: Hilbert space
|
Posted: Wed Oct 10, 2012 6:52 pm Post subject: Re: Switching between 2 snd cards? |
|
|
PaulBredbury wrote: | kbzium wrote: | switch between them |
Here's my script. |
Quote: | Bad request. The link you followed is incorrect or outdated. |
_________________
|
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Wed Oct 10, 2012 7:09 pm Post subject: |
|
|
The URL works fine for me. |
|
Back to top |
|
|
aCOSwt Bodhisattva
Joined: 19 Oct 2007 Posts: 2537 Location: Hilbert space
|
Posted: Wed Oct 10, 2012 7:37 pm Post subject: |
|
|
PaulBredbury wrote: | The URL works fine for me. |
Must be because you are logged in brebs !
I can't tell why but the link you posted is said incorrect or outdated unless being logged in. _________________
|
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Wed Oct 10, 2012 8:33 pm Post subject: |
|
|
OK, so I have:
~/bin/speakers-headphones:
Code: | #!/bin/bash
cp ~/.asoundrc{-headphones,}
sed -i -e "s:sndpcm surround51:sndpcm default:" ~/bin/darkplaces
sed -i -e "s:snd_channels 6:snd_channels 2:" ~/.darkplaces/id1/autoexec.cfg
sed -i -e 's:^\(pcm=\).*:\1headphones:' ~/.config/audacious/config
sed -i -e 's:^\(af=\).*::' -e 's:^\(ao=\).*:\1alsa\:device=headphones:' ~/.mplayer/config
sed -i -e "s:=upmix_20to51_resample:=headphones:" ~/.cmus/rc |
~bin/speakers-surround:
Code: | #!/bin/bash
cp ~/.asoundrc{-surround,}
sed -i -e "s:sndpcm default:sndpcm surround51:" ~/bin/darkplaces
sed -i -e "s:snd_channels 2:snd_channels 6:" ~/.darkplaces/id1/autoexec.cfg
sed -i -e 's:^\(pcm=\).*:\1upmix_20to51_resample:' ~/.config/audacious/config
sed -i -e 's:^\(af=\).*:\1volume=10\.0\:0:' -e 's:^\(ao=\).*:\1alsa\:device=movie:' ~/.mplayer/config
sed -i -e "s:=headphones:=upmix_20to51_resample:" ~/.cmus/rc |
_________________ Improve your font rendering and ALSA sound |
|
Back to top |
|
|
kbzium Tux's lil' helper
Joined: 31 Jul 2012 Posts: 146
|
Posted: Thu Oct 11, 2012 5:42 am Post subject: |
|
|
I'm not so good at writing scripts in bash (actually never did one). So all I have to do is put it in /bin or whereever else and run it? I don't have to change anything else in alfa.conf or something? I haven't tried just to run it because I'm worrying I'll make my sound gone if I forget about something |
|
Back to top |
|
|
kbzium Tux's lil' helper
Joined: 31 Jul 2012 Posts: 146
|
Posted: Thu Oct 11, 2012 6:08 pm Post subject: |
|
|
So i seems that I need to change it for every software I want to use my headphones with... is there any way just to switch whole thing? |
|
Back to top |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Fri Oct 12, 2012 2:30 am Post subject: |
|
|
You could use PulseAudio for that. |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Fri Oct 12, 2012 2:56 am Post subject: |
|
|
Ant P. wrote: | You could use PulseAudio for that. |
Are you sure about that? I've not heard of pulseaudio *telling* e.g. mplayer, how many speakers are to be outputted to.
Pulseaudio (and ALSA) could upmix stereo to 5.1, but that's greatly inferior to e.g. playing a 5.1-encoded movie in 5.1. _________________ Improve your font rendering and ALSA sound |
|
Back to top |
|
|
HolgerB n00b
Joined: 07 Sep 2011 Posts: 49
|
Posted: Fri Oct 12, 2012 10:13 am Post subject: |
|
|
When running pulseaudio, you can either use pavucontrol to change what "sink" is used by which app or run pacmd to change things via CLI.
Besides the negative effects (CPU load, sound delays, etc) runs pretty stable nowadays. Many people swear on pure ALSA or OSS but pulseaudio definitely has some benefits.
Edit:
To be more specific:
Use "pacmd list-sinks" to find out your available sinks.
Then use "pacmd set-default-sink <your-sink-here>"
This should pretty much do it....
You might also wanna have a look here:
http://ubuntuforums.org/showthread.php?t=1370383
and here:
https://wiki.archlinux.org/index.php/PulseAudio/Examples |
|
Back to top |
|
|
kbzium Tux's lil' helper
Joined: 31 Jul 2012 Posts: 146
|
Posted: Fri Oct 12, 2012 12:14 pm Post subject: |
|
|
I think I'll give it a try. But how to turn 5.1 emulation off in alsa anyways? |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Fri Oct 12, 2012 12:56 pm Post subject: |
|
|
kbzium wrote: | I think I'll give it a try. |
You'll still have the issue that I just described!
kbzium wrote: | But how to turn 5.1 emulation off in alsa anyways? |
You need to provide more detail, e.g. in what app? Not a common problem. Maybe this is done by your speaker system - does it have a hardware control panel? |
|
Back to top |
|
|
kbzium Tux's lil' helper
Joined: 31 Jul 2012 Posts: 146
|
Posted: Fri Oct 12, 2012 1:03 pm Post subject: |
|
|
I don't have any hardware system. I want my sound card to provide output only on one plug (headphones) not all of them (so sound is somehow disorted, right?).
The thing is that back on windows I had only 2.1 sound. Here it's 5.1 default and i don't know how to make it 2.1.
I think it's more a system setting because when i launch my gentoo i hear welcoming sound on all of my speakers (when they were all plugged in instead of headphones which am i using now) |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Fri Oct 12, 2012 1:12 pm Post subject: |
|
|
Here's a simple test:
speaker-test -t wav -c 2 -D default
So, do you hear that through 2, 2.1 or 5.1? |
|
Back to top |
|
|
kbzium Tux's lil' helper
Joined: 31 Jul 2012 Posts: 146
|
Posted: Fri Oct 12, 2012 1:40 pm Post subject: |
|
|
Only 2 speakers. -5 too. It's weird because all 6 speakers are playing real sounds (line system ones or mp3s in audacious). Maybe gentoo just splits channels to 5 (actually right and side right would be the same then)? |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Fri Oct 12, 2012 2:44 pm Post subject: |
|
|
"-5"? You're still being vague, and it's not helping.
Useful debugging info:
Code: | wget -O alsa-info.sh http://www.alsa-project.org/alsa-info.sh
bash alsa-info.sh --upload |
Then show us the URL that the script shows at the end. |
|
Back to top |
|
|
atoussaint n00b
Joined: 31 Jul 2012 Posts: 7
|
|
Back to top |
|
|
atoussaint n00b
Joined: 31 Jul 2012 Posts: 7
|
Posted: Fri Oct 12, 2012 7:22 pm Post subject: |
|
|
One thing I figured out is the permission on the devices nodes:
!!ALSA Device nodes
!!-----------------
crw------- 1 root root 116, 3 Oct 12 10:32 /dev/snd/controlC0
crw------- 1 root root 116, 9 Oct 12 10:32 /dev/snd/controlC1
crw------- 1 root root 116, 2 Oct 12 10:32 /dev/snd/hwC0D0
crw------- 1 root root 116, 8 Oct 12 10:32 /dev/snd/hwC1D0
crw------- 1 root root 116, 7 Oct 12 10:32 /dev/snd/pcmC1D0c
crw------- 1 root root 116, 6 Oct 12 10:32 /dev/snd/pcmC1D0p
crw------- 1 root root 116, 5 Oct 12 10:32 /dev/snd/pcmC1D1p
crw------- 1 root root 116, 4 Oct 12 10:32 /dev/snd/pcmC1D2c
crw------- 1 root root 116, 1 Oct 12 10:32 /dev/snd/seq
crw------- 1 root root 116, 33 Oct 12 10:32 /dev/snd/timer
only root and read/write them; would that indicate a problem with udev?
Alain |
|
Back to top |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Fri Oct 12, 2012 11:04 pm Post subject: |
|
|
Yes — those should be 0660 root:audio |
|
Back to top |
|
|
atoussaint n00b
Joined: 31 Jul 2012 Posts: 7
|
Posted: Sat Oct 13, 2012 1:39 am Post subject: |
|
|
Thanks, I fixed the problem. I needed to install the package udev-init-scripts on my system.
Alain |
|
Back to top |
|
|
kbzium Tux's lil' helper
Joined: 31 Jul 2012 Posts: 146
|
Posted: Sat Oct 13, 2012 12:01 pm Post subject: |
|
|
PaulBredbury wrote: | "-5"? You're still being vague, and it's not helping.
Useful debugging info:
Code: | wget -O alsa-info.sh http://www.alsa-project.org/alsa-info.sh
bash alsa-info.sh --upload |
Then show us the URL that the script shows at the end. |
I mean I did -2 first, as you told me to, and then -5. The outcomes were the same.
Here's that file:
http://www.alsa-project.org/db/?f=879829694bfa267f5d9eef962da7b0c0c681196b |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Sat Oct 13, 2012 9:28 pm Post subject: |
|
|
You have bad permissions on /dev/snd/seq.
At a glance, I don't see anything to cause upmixing of stereo to 5.1 |
|
Back to top |
|
|
|