LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-03-2007, 06:30 PM   #1
TehDooMCat
LQ Newbie
 
Registered: Apr 2007
Posts: 12

Rep: Reputation: 0
ALSA problems on my PC...


I'm relatively new to Linux. I'm using Sabayon, a flavour of Gentoo, atm. It's great - fast and pretty beats Vista and OSX. WINE is running my games reasonably.

I have one problem, related to sound. I have two soundcards in my PC, one is a Creative X-Fi, which Creative haven't released linux drivers for yet, so I'm using the other one; a C-Media CM6501. It's built into my motherboard, on the USB Bus. Odd. Sabayon sees it as a PnP audio device.

It works fine on some apps (beep media player, sauerbraten, etc), but others I have to pipe through EsounD. And EsounD sounds pretty bad when it comes to playing music it stutters a LOT. Especially in Windows stuff - it lags a second behind graphics.

So my question is this: can someone tell me either A) How to force ALSA to only use one card (hw:1), or B) How to setup JACK properly to replace EsounD?

Many thanks.

Also, my first post on linuxquestions *waves*
 
Old 04-03-2007, 07:01 PM   #2
jens
Senior Member
 
Registered: May 2004
Location: Belgium
Distribution: Debian, Slackware, Fedora
Posts: 1,463

Rep: Reputation: 299Reputation: 299Reputation: 299
Alsa/Jack Howto for Gentoo/Sabayon:
http://gentoo-wiki.com/HOWTO_Jack

I personally prefer using just alsa.
Alsa has an excellent mixer called Dmix:
http://gentoo-wiki.com/HOWTO_ALSA_sound_mixer_aka_dmix
 
Old 04-03-2007, 08:09 PM   #3
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
Also see this post on how to specify order of sound cards:
http://www.linuxquestions.org/questi...d.php?t=536290
 
Old 04-03-2007, 09:16 PM   #4
studioj
Member
 
Registered: Oct 2006
Posts: 460

Rep: Reputation: 31
welcome !
yea i think use alsa directly too.
jack is unfortunately still too esoteric for linux at large.
apps have to written specifically to be aware of jack and not all are (few actually are).
 
Old 04-04-2007, 01:39 PM   #5
TehDooMCat
LQ Newbie
 
Registered: Apr 2007
Posts: 12

Original Poster
Rep: Reputation: 0
'kay, thanks guys.

I've just realised something: ALSA might be messing up because the soundcard that works on my comp (the CMedia) doesn't have any drivers of it's own, it's listed as a PnP USB Audio device. Makes sense, since it's on the USB Bus, but what's the name of the driver for generic USB audio devices? I can't find the device in lspci | grep -i audio...

So I'm kind of stuck at the "Installing alsa-driver" step of the HOWTO ALSA/DMix page on the Gentoo Wiki.
 
Old 04-04-2007, 01:55 PM   #6
studioj
Member
 
Registered: Oct 2006
Posts: 460

Rep: Reputation: 31
snd-usb-audio

you should be able t see your device with the command
aplay -l
and also
lsusb

some systems try to prevent usb audio devices from becoming primary soundcard (sound device 0)
so if you want it to be device 0 look in /etc/modprobe.d folder (or whatever it is for gentoo) for a line like
options snd-usb-audio index=0

sometimes it will be specifically set to something other than 0 and can be keeping your card in the background.
 
Old 04-04-2007, 03:32 PM   #7
TehDooMCat
LQ Newbie
 
Registered: Apr 2007
Posts: 12

Original Poster
Rep: Reputation: 0
I found out it was snd-usb-audio earlier. 've got sound in WINE now, through OSS

But I can't get dmix running... when I emerge alsa-drivers (one of the things it said in the wiki to emerge), it spits out a load of errors about it already being in the kernel, which it's not, because I recompiled the alsa support to be modular. (I think)

I get errors in aplay, mpg123/321 etc. like this:
Code:
ALSA lib pcm_dmix.c:864:(snd_pcm_dmix_open) unable to open slave

Last edited by TehDooMCat; 04-04-2007 at 03:37 PM.
 
Old 04-04-2007, 04:19 PM   #8
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
Quote:
Originally Posted by TehDooMCat
But I can't get dmix running... when I emerge alsa-drivers (one of the things it said in the wiki to emerge), it spits out a load of errors about it already being in the kernel, which it's not, because I recompiled the alsa support to be modular. (I think)
You should only enable sound support in kernel. Don't enable oss or alsa at all, not even as mods if you are installing alsa separately.
 
Old 04-04-2007, 04:30 PM   #9
TehDooMCat
LQ Newbie
 
Registered: Apr 2007
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by dive
You should only enable sound support in kernel. Don't enable oss or alsa at all, not even as mods if you are installing alsa separately.
Okay, I've done that, and now have alsa-drivers emerged. No sign of dmix working yet though. I'll keep snooping around and messing with stuff.
 
Old 04-04-2007, 06:00 PM   #10
studioj
Member
 
Registered: Oct 2006
Posts: 460

Rep: Reputation: 31
this is most likely not it since you got it basically working but make sure esd or artsd is not running.
 
Old 04-04-2007, 06:33 PM   #11
TehDooMCat
LQ Newbie
 
Registered: Apr 2007
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by studioj
this is most likely not it since you got it basically working but make sure esd or artsd is not running.
ESD and aRts aren't running. I checked that.

Could it be my .asoundrc file? This is what it looks like:

Code:
pcm.ossmix {
   type dmix
   ipc_key 1024
   slave {
       pcm "hw:0,1"            # make sure this matches the actual device
       #period_time 0          # not necessary since ALSA 1.0pre
       period_size 1024        # Use a power of 2
       buffer_size 4096        # must be a multiple of period_size
       #rate 44100             # not necessary; let alsa-lib handle this
   }
   bindings {
       0 0
       1 1                     # bind only the first 2 channels
   }
}
pcm.duplex
{
   type asym
   playback.pcm "ossmix"
   capture.pcm "dsnoop"
}
# Everything shall be dmixed, so redefine "default":
# Note that this is _not_ a good idea, since dmix doesn't allow mmap access currently
pcm.!default {
   type plug
   slave.pcm "duplex"
}
# OSS via aoss should d(mix)stroyed:
pcm.dsp0 {
   type plug
   slave.pcm "duplex"
}
ctl.ossmix {
   type sw
   card 0
}
Basically copied & pasted from a website with a few changes. But it's still not software mixing properly, OSS still locks the card, and ALSA refuses to play anything in programs like amarok.
 
Old 04-04-2007, 07:17 PM   #12
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Quote:
Originally Posted by TehDooMCat
But I can't get dmix running... when I emerge alsa-drivers (one of the things it said in the wiki to emerge), it spits out a load of errors about it already being in the kernel, which it's not, because I recompiled the alsa support to be modular. (I think)
It does not matter whether ALSA is compiled in or as module, it's still kernel ALSA. ALSA-drivers work outside of kernel. With latest in-kernel ALSA dmix is enabled by default, no special effort is needed to use it.
 
Old 04-05-2007, 10:33 AM   #13
TehDooMCat
LQ Newbie
 
Registered: Apr 2007
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Emerson
It does not matter whether ALSA is compiled in or as module, it's still kernel ALSA. ALSA-drivers work outside of kernel. With latest in-kernel ALSA dmix is enabled by default, no special effort is needed to use it.
Then why didn't it show any signs of working, and why doesn't the alsa-driver method work with dmix for me either?

Come to think of it, Q2 of the year is this month, next month and June, so I may as well wait a few months for Creative to release the X-Fi drivers. Thanks for helping y'all, now I can at least enjoy some games while I wait for Creative to come out with the drivers I don't really mind if I can't listen to music and have game sounds at the same time. One usually drowns out the other anyway.
 
Old 04-05-2007, 11:00 AM   #14
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
ALSA-driver probably was conflicting with kernel ALSA.

http://www.gentoo.org/doc/en/alsa-guide.xml

It probably is better not to have too many sound daemons running, ALSA is just enough. So I'd recommend removing esd, oss and arts USE flags followed by 'emerge -avND world'. Then adjust your sound apps to use "default" device, it is going to be dmix.
 
Old 04-07-2007, 11:11 AM   #15
TehDooMCat
LQ Newbie
 
Registered: Apr 2007
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Emerson
ALSA-driver probably was conflicting with kernel ALSA.

http://www.gentoo.org/doc/en/alsa-guide.xml

It probably is better not to have too many sound daemons running, ALSA is just enough. So I'd recommend removing esd, oss and arts USE flags followed by 'emerge -avND world'. Then adjust your sound apps to use "default" device, it is going to be dmix.
I've done that now. Nearly all the programs that want sound work now, in perfect harmony it was .asoundrc. I changed "hw:0,1" to "hw:1" and it works now. WINE still won't play nice with the other programs though, running it through aoss doesn't help either. I shall keep experimenting with regedit and the "Alsa Driver" key.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
alsa problems mark_alfred Debian 2 02-16-2005 11:24 PM
alsa problems garr0323 Mandriva 1 10-28-2004 05:13 PM
alsa problems draggin Debian 5 05-04-2004 06:23 PM
alsa problems Channi Slackware 3 03-24-2004 08:31 AM
Problems with OSS while trying to avoid problems in ALSA (scratchy sound) GT_Onizuka Linux - General 1 02-05-2004 11:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration