Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Alsa Defaults to Wrong Soundcard
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
niffs
Apprentice
Apprentice


Joined: 25 Apr 2004
Posts: 212
Location: The Wired

PostPosted: Sun Dec 31, 2006 5:59 am    Post subject: Alsa Defaults to Wrong Soundcard Reply with quote

Well, here's the story. I have two sound cards: An integrated NVidia AC'97 type thing, and a PCI SoundBlaster Live! EMU10k1 based card. I much prefer the EMU10k1 to the AC'97, but for some reason the modules for the AC'97 are always loaded, and it gets set as the default soundcard by alsa. This is undesirable.

There must be a simple way to disable the AC'97 or set the EMU10k1 as the default, no? I could go through and recompile my kernel without support for the AC'97, but I would sort of like to still have support for it, just in case the EMU10k1 gets fried next time I dissect my box, or something. Is there a file (hotplug or modprobe perhaps?) that I could edit to make it prefer the EMU10k1?

Any help is appreciated. Thanks in advance.
_________________
No matter where you are... everyone is always connected.
[ .: my website :. ]
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Sun Dec 31, 2006 6:18 am    Post subject: Reply with quote

niffs wrote:
Is there a file (hotplug or modprobe perhaps?) that I could edit to make it prefer the EMU10k1?
Yes, /etc/modules.d/alsa. There are other ways.
Back to top
View user's profile Send private message
niffs
Apprentice
Apprentice


Joined: 25 Apr 2004
Posts: 212
Location: The Wired

PostPosted: Sun Dec 31, 2006 6:31 am    Post subject: Reply with quote

Well... /etc/modules.d/alsa:
Code:
alias /dev/mixer snd-mixer-oss
alias /dev/dsp snd-pcm-oss
alias /dev/midi snd-seq-oss
alias snd-card-0 snd-emu10k1
alias sound-slot-0 snd-emu10k1


and still...

I get the impression the AC'97 modules are being autoloaded and are taking over...
_________________
No matter where you are... everyone is always connected.
[ .: my website :. ]
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Sun Dec 31, 2006 6:43 am    Post subject: Reply with quote

Post the contents of /etc/modules.autoload.d/kernel-2.6.
Back to top
View user's profile Send private message
niffs
Apprentice
Apprentice


Joined: 25 Apr 2004
Posts: 212
Location: The Wired

PostPosted: Sun Dec 31, 2006 6:50 am    Post subject: Reply with quote

Tis empty. Should emu10k1 modules go in there?

But the problem isn't that the modules aren't being loaded... its just that the ac97 modules load as well, and take over...
_________________
No matter where you are... everyone is always connected.
[ .: my website :. ]
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Sun Dec 31, 2006 7:04 am    Post subject: Reply with quote

niffs wrote:
Tis empty. Should emu10k1 modules go in there?
It might be worth trying.

niffs wrote:
But the problem isn't that the modules aren't being loaded...
I realize that, my interest was in the order in which the modules are loaded.

niffs wrote:
its just that the ac97 modules load as well, and take over...
Take over how?
Back to top
View user's profile Send private message
niffs
Apprentice
Apprentice


Joined: 25 Apr 2004
Posts: 212
Location: The Wired

PostPosted: Sun Dec 31, 2006 7:08 am    Post subject: Reply with quote

Nevermind. I'm being a moron. Solution was creating /etc/asound.conf:
Code:
pcm.!default {
 type hw
 card 1
}
ctl.!default {
 type hw
 card 1
}


I think what was happening was, modules for both cards were loaded, and when alsa found I hadn't specified a default in asound.conf, it just chose card #0, i.e. the AC97. Thanks for the help, and sorry for being stupid :oops:
_________________
No matter where you are... everyone is always connected.
[ .: my website :. ]
Back to top
View user's profile Send private message
djselbeck
n00b
n00b


Joined: 10 Oct 2005
Posts: 32
Location: Germany

PostPosted: Sun Dec 31, 2006 12:16 pm    Post subject: Reply with quote

Hello,

i think you can also make the emu10k1 to card 0 if you edit the /etc/modules.d/alsa and add a new line at the end with this
Code:
options snd-emu10k1 index=0
. If you do this you need to change your /etc/asound.conf to use card 0 instead of card 1. This is the way i make my Delta1010LT default instead of my SB Live.

DJSelbeck
Back to top
View user's profile Send private message
niffs
Apprentice
Apprentice


Joined: 25 Apr 2004
Posts: 212
Location: The Wired

PostPosted: Sun Dec 31, 2006 3:47 pm    Post subject: Reply with quote

Interesting... I'll try this.
_________________
No matter where you are... everyone is always connected.
[ .: my website :. ]
Back to top
View user's profile Send private message
niffs
Apprentice
Apprentice


Joined: 25 Apr 2004
Posts: 212
Location: The Wired

PostPosted: Sun Dec 31, 2006 3:59 pm    Post subject: Reply with quote

Well, I tried it out, but it didn't really do much to help... so I'm just going back to using /etc/asound.conf to set card 1 as default.
_________________
No matter where you are... everyone is always connected.
[ .: my website :. ]
Back to top
View user's profile Send private message
slyyls
Tux's lil' helper
Tux's lil' helper


Joined: 27 Aug 2004
Posts: 89
Location: Ottawa

PostPosted: Fri Jan 05, 2007 6:47 pm    Post subject: Reply with quote

Hey everybody,

Alright, i have a similar problem, so instead of starting a new threat, i'm posting in this one.

My setup:

on-board sound card: via82xx
Quickcam pro 3000: snd-usb-audio

Problem:

The logitech quickcam becomes card0 (default) because it gets loaded first. No sound works because it tries to play to the quickcam which is a mic.

Code:
cat /proc/asound/cards
 0 [U0x46d0x8b0    ]: USB-Audio - USB Device 0x46d:0x8b0
                      USB Device 0x46d:0x8b0 at usb-0000:00:10.0-1, full speed
 1 [V8235          ]: VIA8233 - VIA 8235
                      VIA 8235 with ALC650D at 0xdc00, irq 18


Possible solutions:

Code:
/etc/modules.d/alsa
# OSS/Free portion - card #1
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
# 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.
#option snd-via82xx index=-2

# --- BEGIN: Generated by ALSACONF, do not edit. ---
# --- ALSACONF version 1.0.13 ---
alias snd-card-1 snd-via82xx
alias sound-slot-1 snd-via82xx
alias snd-card-0 snd-usb-audio
alias sound-slot-0 snd-usb-audio
# --- END: Generated by ALSACONF, do not edit. ---


Tried fiddling with index=-2, index=0, ..., does not work.

Next, tried

Code:
 /etc/asound.conf
pcm.!default {
 type hw
 card 1
}
ctl.!default {
 type hw
 card 1
}


when i run mplayer, i get the following error
Code:
alsa-init: playback open error: Permission denied


Any help would be greatly appreciated,

Thanks

Sly
Back to top
View user's profile Send private message
slyyls
Tux's lil' helper
Tux's lil' helper


Joined: 27 Aug 2004
Posts: 89
Location: Ottawa

PostPosted: Fri Jan 05, 2007 6:57 pm    Post subject: Reply with quote

Hey,

Never mind, it was an operator error.

I was fixing this problem at the same time as fixing the Webcam/PVR problem (adding custom rules to udev because sometimes Quickcam was /dev/video0 and PVR was /dev/video1, other times it would be the opposite) and was using ssh. Problem was this ssh user was not in the audio group. I changed users and it seems to work now.

Thanks anyways,

Sly
Back to top
View user's profile Send private message
lramos85
Tux's lil' helper
Tux's lil' helper


Joined: 29 Jun 2004
Posts: 141
Location: Riverside, Ca

PostPosted: Wed Mar 28, 2007 4:38 am    Post subject: Reply with quote

I also have a similar problem with my usb-audio device. The problem is that I can't get any sound playback through my usb-audio device.

This is what I have:

Code:
cat /proc/asound/cards
 0 [Intel          ]: HDA-Intel - HDA Intel
                      HDA Intel at 0xefffc000 irq 50
 1 [Audio          ]: USB-Audio - USB Audio
                      USB Audio at usb-0000:00:1d.7-6.1.4, full speed


This is my alsa configuration file. I think this is where I'm doing things wrong. I manually added the lines for snd-usb-audio because I could not do that with the alsaconf. Is this a Problem?

Code:
# Set this to the correct number of cards.
/etc/modules.d/alsa
# --- BEGIN: Generated by ALSACONF, do not edit. ---
# --- ALSACONF version 1.0.14rc1 ---
alias snd-card-0 snd-hda-intel
alias sound-slot-0 snd-hda-intel
alias snd-card-1 snd-usb-audio
alias sound-slot-1 snd-usb-audio
# --- END: Generated by ALSACONF, do not edit


Code:

 /etc/asound.conf
pcm.!default {
 type hw
 card 1
}
ctl.!default {
 type hw
 card 1
}


this is my device:
Code:
Bus 001 Device 009: ID 0d8c:0006 C-Media Electronics, Inc.


Code:
lsmod | grep -i snd
snd_seq                60800  0
snd_usb_audio          87968  1
snd_usb_lib            20736  1 snd_usb_audio
snd_rawmidi            25600  1 snd_usb_lib
snd_seq_device         11924  2 snd_seq,snd_rawmidi
snd_hwdep              12552  1 snd_usb_audio
snd_hda_intel          20380  1
snd_hda_codec         191232  1 snd_hda_intel
snd_pcm                83976  3 snd_usb_audio,snd_hda_intel,snd_hda_codec
snd_timer              25864  2 snd_seq,snd_pcm
snd                    52656  13 snd_seq,snd_usb_audio,snd_rawmidi,snd_seq_device,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_pcm,snd_timer
soundcore              13216  1 snd
snd_page_alloc         12688  2 snd_hda_intel,snd_pcm


Code:
dmesg | grep -i snd
snd-usb-audio 1-6.1.4:1.0: usb_probe_interface
snd-usb-audio 1-6.1.4:1.0: usb_probe_interface - got id
usbcore: registered new driver snd-usb-audio


It correctly changes my default audio device to snd-usb-audio (from my port replicator) but there is no sound. I get errors about not being able to use that device. Any idea?

Code:
alsa-init: unable to set hw-parameters: Broken pipe

_________________
Registered Linux User #328996
Register Now!
Adpot an unanswered post today!
Back to top
View user's profile Send private message
Dominique_71
Veteran
Veteran


Joined: 17 Aug 2005
Posts: 1879
Location: Switzerland (Romandie)

PostPosted: Wed Mar 28, 2007 3:47 pm    Post subject: Reply with quote

If you read the f. doc, you will find the answer in ALSA-Configuration.txt in both the kernel sources and in alsa-driver doc (at the end of the file). You MUST have an index=x option for each sound card AND a cards_limit=y statement in /etc/modules.d/alsa. Don't forget to run modules_update. To test if it work, move or remove any .asoundrc file. Such a file is normally not needed and in all cases, it is not the place to define the default sound card. If it doesn't work (but it work), it is a bug and must be reported. Simple no?
_________________
"Confirm You are a robot." - the singularity
Back to top
View user's profile Send private message
lramos85
Tux's lil' helper
Tux's lil' helper


Joined: 29 Jun 2004
Posts: 141
Location: Riverside, Ca

PostPosted: Wed Mar 28, 2007 8:22 pm    Post subject: Reply with quote

I read the Documentation and did what you suggested, Although it is more clean now, it still doesn't work.

This is my new Config:

Code:
options snd cards_limit=2
alias snd-card-0 snd-hda-intel
alias snd-card-1 snd-usb-audio
options snd-hda-intel index=1
options snd-usb-audio index=0
alias sound-slot-0 snd-hda-intel
alias sound-slot-1 snd-usb-audio


Again, I'm able to switch to the snd-usb-audio perfectly, but it won't play any sound. I still get the same error:

Code:
alsa-init: unable to set hw-parameters: Broken pipe


I also tried both the software and the kernel alsa with the same results. I have no idea what is wrong, Alsa recognizes the device (its a port replicator audio out plugs from C-Media) and it shows fine on the Mixer and everything. Guess its time for reporting a bug?
_________________
Registered Linux User #328996
Register Now!
Adpot an unanswered post today!
Back to top
View user's profile Send private message
lramos85
Tux's lil' helper
Tux's lil' helper


Joined: 29 Jun 2004
Posts: 141
Location: Riverside, Ca

PostPosted: Wed Mar 28, 2007 8:43 pm    Post subject: Reply with quote

:D Finally I got it to work. Turns out since I'm using a port replicator, and the sound device is inside of it, the snd-usb-audio device is technically connected through a USB Hub. I found out that this caused problems when I searched around the bug trackers and found that I needed to have this option SET in the kernel:

Code:
# CONFIG_USB_EHCI_SPLIT_ISO


After setting that Option to YES, and make && make modules_install everything worked fine, thanks for everything.
_________________
Registered Linux User #328996
Register Now!
Adpot an unanswered post today!
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
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