Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Set default sound card
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
ursusca
Apprentice
Apprentice


Joined: 10 Sep 2008
Posts: 284
Location: Toronto ON, CANADA

PostPosted: Mon Mar 15, 2010 9:46 pm    Post subject: [SOLVED] Set default sound card Reply with quote

Hello there!

I have ASUS M4A78-E motherboard. I've disabled Onboard sound card (VIA VT1708S) and installed Audigy sound card (c-media sb 8738 5.1 channel (CMI8738/PCI-6ch-LX)). My system detects now two audio devices.
Code:
$lspci
01:05.1 Audio device: ATI Technologies Inc RS780 Azalia controller
04:05.0 Multimedia audio controller: Creative Labs CA0106 Soundblaster

ATI HDMI (part of the gpu) and my Audigy sound card. ATI HDMI is a dafault sound card now
Code:
cat /proc/asound/cards
 0 [HDMI           ]: HDA-Intel - HDA ATI HDMI
                      HDA ATI HDMI at 0xfbdfc000 irq 19
 1 [CA0106         ]: CA0106 - CA0106
                      Audigy SE [SB0570] at 0xec00 irq 20


I've disabled HDA ATI HDMI in Gnome sound preference. How can I change default sound card on Audigy?

Thanks,
_________________
You deserve free software!


Last edited by ursusca on Tue Mar 23, 2010 7:32 am; edited 1 time in total
Back to top
View user's profile Send private message
ferreirafm
Guru
Guru


Joined: 28 Jul 2005
Posts: 446
Location: Sao Paulo, Brazil

PostPosted: Mon Mar 15, 2010 11:43 pm    Post subject: Reply with quote

Hi ursusca,
emerge alsa-utils and run alsaconf. Its is a simple script which tries to detect the sound cards on your system and writes a suitable configuration file.
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 5270

PostPosted: Mon Mar 15, 2010 11:48 pm    Post subject: Reply with quote

No completely sure, but putting 'defaults.pcm.card 1' in /etc/asound.conf may work.
Back to top
View user's profile Send private message
ferreirafm
Guru
Guru


Joined: 28 Jul 2005
Posts: 446
Location: Sao Paulo, Brazil

PostPosted: Tue Mar 16, 2010 12:02 am    Post subject: Reply with quote

ursusca,
I suppose you have compiled your sound drivers built-in. End also disabled your on-board sound card in the BIO. If yes, alsaconf should work in order. That's what I did.
ferreirafm
Back to top
View user's profile Send private message
ursusca
Apprentice
Apprentice


Joined: 10 Sep 2008
Posts: 284
Location: Toronto ON, CANADA

PostPosted: Tue Mar 16, 2010 8:28 pm    Post subject: Reply with quote

Hello Guys,

Thank you both for attention to my question.

ferreirafm wrote:
Hi ursusca,
emerge alsa-utils and run alsaconf. Its is a simple script which tries to detect the sound cards on your system and writes a suitable configuration file.


I did and it didn't help :)

VoidMage wrote:
No completely sure, but putting 'defaults.pcm.card 1' in /etc/asound.conf may work.


There isn't /etc/asound.conf file in my box.
Code:
ls -la /etc | grep asound
-rw-r--r--  1 root root  12626 2010-03-15 21:16 asound.state

Should I create it?
_________________
You deserve free software!
Back to top
View user's profile Send private message
ferreirafm
Guru
Guru


Joined: 28 Jul 2005
Posts: 446
Location: Sao Paulo, Brazil

PostPosted: Wed Mar 17, 2010 10:36 am    Post subject: Reply with quote

ursusca.
ursusca wrote:
Should I create it?

I think it isn't gonna help much. The ausasound.state file just stores the final setup/config of mixer - things like volume of CD, microphone and so on.
Did test your sound card already? I mean, in another computer. Double check it.
Back to top
View user's profile Send private message
Rexilion
Veteran
Veteran


Joined: 17 Mar 2009
Posts: 1044

PostPosted: Wed Mar 17, 2010 11:55 am    Post subject: Reply with quote

ferreirafm wrote:
ursusca.
ursusca wrote:
Should I create it?

I think it isn't gonna help much. The ausasound.state file just stores the final setup/config of mixer - things like volume of CD, microphone and so on.
Did test your sound card already? I mean, in another computer. Double check it.


Can you post the output of

Code:
lspci -v


please?

From that, I can see which module is connected to which card. Then you can create a kernel parameter that will change the behaviour. You can chose two options:
- move the second card to the first position and the first card to the second position (the card that is found first is the default card)
- disable the first card

Up to you which one you want :wink:
Back to top
View user's profile Send private message
ursusca
Apprentice
Apprentice


Joined: 10 Sep 2008
Posts: 284
Location: Toronto ON, CANADA

PostPosted: Wed Mar 17, 2010 5:26 pm    Post subject: Reply with quote

Rexilion wrote:

Can you post the output of

Code:
lspci -v


please?

...


Hello,

sure :)

Code:
01:05.1 Audio device: ATI Technologies Inc RS780 Azalia controller
   Subsystem: ATI Technologies Inc RS780 Azalia controller
   Flags: bus master, fast devsel, latency 0, IRQ 19
   Memory at fbdfc000 (32-bit, non-prefetchable) [size=16K]
   Capabilities: [50] Power Management version 3
   Capabilities: [a0] MSI: Enable- Count=1/1 Maskable- 64bit+
   Kernel driver in use: HDA Intel
   Kernel modules: snd-hda-intel

04:05.0 Multimedia audio controller: Creative Labs CA0106 Soundblaster
   Subsystem: Creative Labs SB0570 [SB Audigy SE]
   Flags: bus master, medium devsel, latency 64, IRQ 20
   I/O ports at ec00 [size=32]
   Capabilities: [dc] Power Management version 2
   Kernel driver in use: CA0106
   Kernel modules: snd-ca0106


Thanks,
_________________
You deserve free software!
Back to top
View user's profile Send private message
Rexilion
Veteran
Veteran


Joined: 17 Mar 2009
Posts: 1044

PostPosted: Wed Mar 17, 2010 6:02 pm    Post subject: Reply with quote

Open grub.conf and try this:

append the following to the kernel line:

Code:
snd-ca0106.index=0 snd-hda-intel.index=1


Does it work? This switches around the cards.
Back to top
View user's profile Send private message
ursusca
Apprentice
Apprentice


Joined: 10 Sep 2008
Posts: 284
Location: Toronto ON, CANADA

PostPosted: Wed Mar 17, 2010 8:32 pm    Post subject: Reply with quote

Rexilion wrote:
Open grub.conf and try this:

append the following to the kernel line:

Code:
snd-ca0106.index=0 snd-hda-intel.index=1


Does it work? This switches around the cards.


Yes. It does! :D Thank you! Are there other ways to set default sound card?
_________________
You deserve free software!
Back to top
View user's profile Send private message
jcTux
Apprentice
Apprentice


Joined: 29 Dec 2009
Posts: 276
Location: Tours, France

PostPosted: Wed Mar 17, 2010 10:01 pm    Post subject: Reply with quote

ursusca wrote:

Are there other ways to set default sound card?


Yes by using pulseaudio, even if most people do not like it.
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 5270

PostPosted: Wed Mar 17, 2010 10:55 pm    Post subject: Reply with quote

Actually, by using kernel parameters, you haven't changed the default alsa card settings,
just changed the order kernel enumerates them, so '0' is the one you want.

I must stress, that my previous post was just a guess, but reading a bit of alsa-lib docs,
that seems to be the relevant setting.
Back to top
View user's profile Send private message
furanku
l33t
l33t


Joined: 08 May 2003
Posts: 874
Location: Hamburg, Germany

PostPosted: Thu Mar 18, 2010 9:03 am    Post subject: Reply with quote

ursusca wrote:
Are there other ways to set default sound card?

Some sound servers and applications allow it to set a default device on an userland/application level. But even then it is reasonable to bring the soundcards in the desired order on the kernel level: This may save you some configuration as most applications will use the first sound device offerd by the kernel as default.

Sorting the sound devices on the kernel level is basically what you already did with the kernel command line you wrote into the grub configuration. This works, but it's quite inelegant. The kernel commandline should be used for more basic things which have to be specified at boot time (e.g. things whithout your system does not boot at all). Parameters given to less elementary kernel modules, like sound drivers, are better given in the module configuration file. Defining them there you can easily load and unload these drivers in running system and they still get the right options to keep them in order. Hey, we're on Linux, not on Windows, so you don't need to reboot to reorder your sound devices ;)

The module configuration changed from baselayout version 1 to version 2, so could you please give the output of
Code:
# emerge -p baselayout
Back to top
View user's profile Send private message
ursusca
Apprentice
Apprentice


Joined: 10 Sep 2008
Posts: 284
Location: Toronto ON, CANADA

PostPosted: Thu Mar 18, 2010 7:13 pm    Post subject: Reply with quote

Hello!

Thank all of you!
furanku wrote:
..
The module configuration changed from baselayout version 1 to version 2, so could you please give the output of
Code:
# emerge -p baselayout


Code:
# emerge -p baselayout

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] sys-apps/baselayout-1.12.13



jcTux wrote:
Yes by using pulseaudio, even if most people do not like it.


I like PA and I use it.
_________________
You deserve free software!
Back to top
View user's profile Send private message
geonix
n00b
n00b


Joined: 07 Jul 2005
Posts: 40
Location: Minsk

PostPosted: Thu Mar 18, 2010 9:36 pm    Post subject: Reply with quote

hi,
there is an utility called asoundconf http://cs.potsdam.edu/cgi-bin/man/man2html?asoundconf+1
it's easilly changes your soundcard order.I used it co change the default card to the external usb card i connected.
Ebuild could be found in my overlay http://bt-overlay.googlecode.com/svn/trunk/media-sound/asoundconf/
_________________
Higher ,greater, further
2.6.37-gentoo-r2 x86_64 Intel(R) Core(TM)2 Duo CPU T8300 @ 2.40GHz GenuineIntel GNU/Linux
Dell inspiron 1525
Back to top
View user's profile Send private message
furanku
l33t
l33t


Joined: 08 May 2003
Posts: 874
Location: Hamburg, Germany

PostPosted: Thu Mar 18, 2010 10:14 pm    Post subject: Reply with quote

OK, I'm using baselayout version 2 so if I remember correctly, add these two lines
Code:
alias snd-card-0 snd-ca0106
options snd-ca0106 index=0
alias snd-card-1 snd-hda-intel
options snd-hda-intel index=1
options snd cards_limit=2

to /etc/modules.d/alsa and then run
Code:
# update-modules


After that you can remove the corresponding entries from the grub configuration. With the next boot the moules should get loaded in the right order. Remember that this only works if you build your sound drivers as loadable modules (which is more flexible anway). If you build them statically into the kernel, stick with the method definig the order in the grub kernel options line (as you do now).
Back to top
View user's profile Send private message
ursusca
Apprentice
Apprentice


Joined: 10 Sep 2008
Posts: 284
Location: Toronto ON, CANADA

PostPosted: Fri Mar 19, 2010 8:14 pm    Post subject: Reply with quote

furanku wrote:
OK, I'm using baselayout version 2 so if I remember correctly, add these two lines
Code:
alias snd-card-0 snd-ca0106
options snd-ca0106 index=0
alias snd-card-1 snd-hda-intel
options snd-hda-intel index=1
options snd cards_limit=2

to /etc/modules.d/alsa and then run
Code:
# update-modules


After that you can remove the corresponding entries from the grub configuration. With the next boot the moules should get loaded in the right order. Remember that this only works if you build your sound drivers as loadable modules (which is more flexible anway). If you build them statically into the kernel, stick with the method definig the order in the grub kernel options line (as you do now).


Hello,

There isn't /etc/modules.d/alsa file in my system
Code:
 # find / -name 'alsa'
/usr/share/alsa
/usr/share/sounds/alsa
/usr/src/linux-2.6.31-gentoo-r10/Documentation/sound/alsa
/usr/include/alsa
/var/lib/alsa
/var/tmp/portage/media-plugins/gst-plugins-cdparanoia-0.10.25/work/gst-plugins-base-0.10.25/ext/alsa
/etc/alsa

And there isn't /etc/modules.d/ directory either
Code:
# ls -la /etc | grep modules
-rw-r--r--  1 root root    698 2010-03-15 17:20 ggz.modules
drwxr-xr-x  2 root root   4096 2010-03-16 23:13 modules.autoload.d

:)
You probably are talking about /etc/modprobe.d/alsa.conf file
Code:
# cat alsa.conf

# Alsa kernel modules' configuration file.

# ALSA portion
# OSS/Free portion

##
## IMPORTANT:
## You need to customise this section for your specific sound card(s)
## and then run `update-modules' command.
## Read alsa-driver's INSTALL file in /usr/share/doc for more info.
##
##  ALSA portion
## alias snd-card-0 snd-interwave
## alias snd-card-1 snd-ens1371
##  OSS/Free portion
## alias sound-slot-0 snd-card-0
## alias sound-slot-1 snd-card-1
##

# OSS/Free portion - card #1
##  OSS/Free portion - card #2
## alias sound-service-1-0 snd-mixer-oss
## alias sound-service-1-3 snd-pcm-oss
## alias sound-service-1-12 snd-pcm-oss

alias /dev/mixer snd-mixer-oss
alias /dev/dsp snd-pcm-oss
alias /dev/midi snd-seq-oss

# Set this to the correct number of cards.

# --- BEGIN: Generated by ALSACONF, do not edit. ---
# --- ALSACONF version 1.0.21 ---
alias snd-card-0 snd-ca0106
alias sound-slot-0 snd-ca0106
# --- END: Generated by ALSACONF, do not edit. ---



This file was generated by alsaconf utility
_________________
You deserve free software!
Back to top
View user's profile Send private message
ursusca
Apprentice
Apprentice


Joined: 10 Sep 2008
Posts: 284
Location: Toronto ON, CANADA

PostPosted: Fri Mar 19, 2010 8:22 pm    Post subject: Reply with quote

geonix wrote:
...
Ebuild could be found in my overlay http://bt-overlay.googlecode.com/svn/trunk/media-sound/asoundconf/


Hi,

Thank you but your link is not working ...
_________________
You deserve free software!
Back to top
View user's profile Send private message
geonix
n00b
n00b


Joined: 07 Jul 2005
Posts: 40
Location: Minsk

PostPosted: Fri Mar 19, 2010 8:43 pm    Post subject: Reply with quote

ursusca wrote:
geonix wrote:
...
Ebuild could be found in my overlay http://bt-overlay.googlecode.com/svn/trunk/media-sound/asoundconf/


Hi,

Thank you but your link is not working ...


hm, just opened it ok;)
it's link to the directory which contains ebuild files.it could not be used directly.
You need to copy this directory to your local overlay.
Another way around is to download my overlay using layman .use command:
layman -o http://bt-overlay.googlecode.com/svn/trunk/layman.xml -f -a bt-overlay
and then install the application from download overlay
_________________
Higher ,greater, further
2.6.37-gentoo-r2 x86_64 Intel(R) Core(TM)2 Duo CPU T8300 @ 2.40GHz GenuineIntel GNU/Linux
Dell inspiron 1525
Back to top
View user's profile Send private message
furanku
l33t
l33t


Joined: 08 May 2003
Posts: 874
Location: Hamburg, Germany

PostPosted: Sun Mar 21, 2010 6:41 pm    Post subject: Reply with quote

OK, as I said, I migrated to baselayout version 2 some time ago, so I'm not sure about newer developments in baslayout version 1. I would guess that /etc/modprobe.d/alsa.conf is the correct file and would give it a try, as in the worst case your sound would be messed up again, and you can easily revert the changes -- but maybe someone with a running baselayout version 1 system should confirm the changes suggested by me.
Back to top
View user's profile Send private message
ursusca
Apprentice
Apprentice


Joined: 10 Sep 2008
Posts: 284
Location: Toronto ON, CANADA

PostPosted: Mon Mar 22, 2010 9:05 pm    Post subject: Reply with quote

Hello!

A big thanks to all of you!!!

I've added this lines to my /etc/modprobe.d/alsa.conf file
Code:
options snd-ca0106 index=0
alias snd-card-1 snd-hda-intel
options snd-hda-intel index=1
options snd cards_limit=2

Code:
# cat /etc/modprobe.d/alsa.conf
# Alsa kernel modules' configuration file.

# ALSA portion
# OSS/Free portion

##
## IMPORTANT:
## You need to customise this section for your specific sound card(s)
## and then run `update-modules' command.
## Read alsa-driver's INSTALL file in /usr/share/doc for more info.
##
##  ALSA portion
## alias snd-card-0 snd-interwave
## alias snd-card-1 snd-ens1371
##  OSS/Free portion
## alias sound-slot-0 snd-card-0
## alias sound-slot-1 snd-card-1
##

# OSS/Free portion - card #1
##  OSS/Free portion - card #2
## alias sound-service-1-0 snd-mixer-oss
## alias sound-service-1-3 snd-pcm-oss
## alias sound-service-1-12 snd-pcm-oss

alias /dev/mixer snd-mixer-oss
alias /dev/dsp snd-pcm-oss
alias /dev/midi snd-seq-oss

# Set this to the correct number of cards.

# --- BEGIN: Generated by ALSACONF, do not edit. ---
# --- ALSACONF version 1.0.21 ---
alias snd-card-0 snd-ca0106
alias sound-slot-0 snd-ca0106
# --- END: Generated by ALSACONF, do not edit. ---
#set default sound card
options snd-ca0106 index=0
alias snd-card-1 snd-hda-intel
options snd-hda-intel index=1
options snd cards_limit=2


furanku wrote:
OK, as I said, I migrated to baselayout version 2 some time ago, so I'm not sure about newer developments in baslayout version 1. I would guess that /etc/modprobe.d/alsa.conf is the correct file and would give it a try, as in the worst case your sound would be messed up again, and you can easily revert the changes -- but maybe someone with a running baselayout version 1 system should confirm the changes suggested by me.


Can you give me an example of baselayout 2?
_________________
You deserve free software!
Back to top
View user's profile Send private message
furanku
l33t
l33t


Joined: 08 May 2003
Posts: 874
Location: Hamburg, Germany

PostPosted: Mon Mar 22, 2010 10:04 pm    Post subject: Reply with quote

I have the corresponding lines in baselayout version 2 in /etc/conf.d/modules in a different syntax (sound cards for my setup)
Code:
modules_2_6="${modules_2_6} snd_intel8x0"
module_snd_intel8x0_args_2_6="index=0"

modules_2_6="${modules_2_6} snd_cmipci"
module_snd_cmipci_args_2_6="mpu_port=0x330 fm_port=0x388 index=1"

modules_2_6="${modules_2_6} cx88_alsa"
module_cx88_alsa_args_2_6="index=2"
Back to top
View user's profile Send private message
ursusca
Apprentice
Apprentice


Joined: 10 Sep 2008
Posts: 284
Location: Toronto ON, CANADA

PostPosted: Tue Mar 23, 2010 7:31 am    Post subject: Reply with quote

furanku wrote:
I have the corresponding lines in baselayout version 2 in /etc/conf.d/modules in a different syntax (sound cards for my setup)
Code:
modules_2_6="${modules_2_6} snd_intel8x0"
module_snd_intel8x0_args_2_6="index=0"

modules_2_6="${modules_2_6} snd_cmipci"
module_snd_cmipci_args_2_6="mpu_port=0x330 fm_port=0x388 index=1"

modules_2_6="${modules_2_6} cx88_alsa"
module_cx88_alsa_args_2_6="index=2"


Thanks! :)
_________________
You deserve free software!
Back to top
View user's profile Send private message
despui
n00b
n00b


Joined: 05 Apr 2010
Posts: 1
Location: Malaysia

PostPosted: Tue Apr 06, 2010 4:57 am    Post subject: Reply with quote

I have found that for the unlucky people like me that is having Adobe-Flash that don't have sound in there own web browser to also to look at this carefully.

Thank you all, each and everyone that have posted there own example for the way to solved this sound card issue. With this post, I'm sure would have hunted the internet for (if lucky) a few more days trying to solved my sound problem with Adobe-Flash not having sound in my web browser.
Back to top
View user's profile Send private message
ursusca
Apprentice
Apprentice


Joined: 10 Sep 2008
Posts: 284
Location: Toronto ON, CANADA

PostPosted: Sat Apr 17, 2010 6:00 pm    Post subject: Reply with quote

despui wrote:
I have found that for the unlucky people like me that is having Adobe-Flash that don't have sound in there own web browser to also to look at this carefully.

Thank you all, each and everyone that have posted there own example for the way to solved this sound card issue. With this post, I'm sure would have hunted the internet for (if lucky) a few more days trying to solved my sound problem with Adobe-Flash not having sound in my web browser.


Hi

My suggestion is to try to uninstall everything related to OSS.
_________________
You deserve free software!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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