Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How I got my nforce2 onboard audio to do mixing (with dmix)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
allex87
Apprentice
Apprentice


Joined: 02 Aug 2003
Posts: 154
Location: Ontario, Canada

PostPosted: Sun May 02, 2004 3:03 am    Post subject: How I got my nforce2 onboard audio to do mixing (with dmix) Reply with quote

Purpose:
The purpose of this guide is to get software mixing (with dmix) working with the intel8x0 audio card integrated on nforce2 motherboards. I have a Soltek 75-FRN2-L.

Howto:
First, get alsa set up for your own kernel. There are plenty of guides on how to do so, so I won't explain here.
Note: For kernel 2.4, alsa needs to be emerged separately, while for kernel 2.6+ alsa is included with the kernel. Make sure you select the snd_intel8x0 module while configuring your kernel.

Now, in your home folder, you can add a .asoundrc file that contains settings for ALSA. Use this file:
Code:

pcm.dmixer {
    type dmix
    ipc_key 1024
    slave {
        pcm "hw:0,0"
        period_time 0
        period_size 1024
        buffer_size 8192
   rate 44100
    }

    bindings {
        0 0
        1 1
    }
}

pcm.dsp0 {
    type plug
    slave.pcm "dmixer"
}

pcm.!default {
        type plug
        slave.pcm "dmixer"
}

pcm.default {
   type plug
   slave.pcm "dmixer"
}

ctl.mixer0 {
    type hw
    card 0
}


This should do the trick. Now, all apps should be configured to use ALSA. For example, gaim needs to have in Sound options play with command: aplay %s.

I hope this helps!

References:
I got the .asoundrc working file from
here. Many thanks go to the poster of the file.

~Alex.


Last edited by allex87 on Tue May 04, 2004 7:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
Boris27
Guru
Guru


Joined: 05 Nov 2003
Posts: 562
Location: Almelo, The Netherlands

PostPosted: Tue May 04, 2004 9:01 am    Post subject: Reply with quote

Thank you! Exactly what I needed.
_________________
we are microsoft, lower your firewalls and surrender your pc's. we will add your biological and technological distinctiveness to our own. your culture will adapt and service us. resistance is futile.
Back to top
View user's profile Send private message
dav1d
Tux's lil' helper
Tux's lil' helper


Joined: 31 Dec 2003
Posts: 134

PostPosted: Tue May 04, 2004 5:12 pm    Post subject: Reply with quote

Sorry if I sound dumb, but what does this actually do? I have heard people talking about hardware and software mixing, but don't completely understand.

Does this allow 2 different apps to output sound at once?
Back to top
View user's profile Send private message
allex87
Apprentice
Apprentice


Joined: 02 Aug 2003
Posts: 154
Location: Ontario, Canada

PostPosted: Tue May 04, 2004 7:40 pm    Post subject: Reply with quote

Yes, it's exactly what it does. I'll re-write the guide... I was too excited at the moment, cuz I've been trying since January to get it to work, then I just found the post that I linked to and it worked!
Back to top
View user's profile Send private message
Insanity5902
Veteran
Veteran


Joined: 23 Jan 2004
Posts: 1228
Location: Fort Worth, Texas

PostPosted: Tue May 04, 2004 9:13 pm    Post subject: Reply with quote

I have a nforce and have been using dmix for quite a well, pretty nice setup when the apps use it ...

My file is the exact same as posted above except I don't have the Bindings set ... other then that, they are the same.

A couple of things 1) this works when programs that use alsa are set to use the default device, not the nforce2, if you set it to nforce2 you won't have sound mixing 2) with mplayer you need to set the vo in the /etc/mplayer.conf or at the comand line (-vo) to this alsa1x:default (for 1.0_r4) or alsa9:default (=<mplayer-1.0_pre3). and 3) you can also put this info in /etc/asound.conf to make it system wide :p
_________________
Join the adopt an unanswered post initiative today
Back to top
View user's profile Send private message
tactless
l33t
l33t


Joined: 14 Jul 2002
Posts: 642
Location: Mitzpe Adi, Israel

PostPosted: Tue May 04, 2004 9:31 pm    Post subject: Reply with quote

Works great! Any more info on how this works, beyond the magic asoundrc? Why is it like this? Why is it not the default? What do the actual settings mean?
_________________
Tactless

"If it wasn't for fog, the world would run at a really crappy framerate."

Jabber: tactless@amessage.info
Back to top
View user's profile Send private message
Boris27
Guru
Guru


Joined: 05 Nov 2003
Posts: 562
Location: Almelo, The Netherlands

PostPosted: Wed May 05, 2004 9:40 am    Post subject: Reply with quote

tactless wrote:
Works great! Any more info on how this works, beyond the magic asoundrc? Why is it like this? Why is it not the default? What do the actual settings mean?


I don't know exactly what it does, but I think it creates an extra audio device that fakes HW mixing. Everyone talks to the fake, and the fake mixes it realtime to the sound system. It's the same setup as aRts, but then without the latency.
_________________
we are microsoft, lower your firewalls and surrender your pc's. we will add your biological and technological distinctiveness to our own. your culture will adapt and service us. resistance is futile.
Back to top
View user's profile Send private message
tactless
l33t
l33t


Joined: 14 Jul 2002
Posts: 642
Location: Mitzpe Adi, Israel

PostPosted: Wed May 05, 2004 11:40 am    Post subject: Reply with quote

...and built into ALSA, which is now an integral part of Linux (as opposed to arts, which is an integral part of KDE). Audio mixing should indeed be done at the ALSA level IMO.
_________________
Tactless

"If it wasn't for fog, the world would run at a really crappy framerate."

Jabber: tactless@amessage.info
Back to top
View user's profile Send private message
Boris27
Guru
Guru


Joined: 05 Nov 2003
Posts: 562
Location: Almelo, The Netherlands

PostPosted: Wed May 05, 2004 11:50 am    Post subject: Reply with quote

tactless wrote:
...and built into ALSA, which is now an integral part of Linux (as opposed to arts, which is an integral part of KDE). Audio mixing should indeed be done at the ALSA level IMO.


Jep, sound is a kernel level issue, so the kernel should take care of it. Has a few advantages too.
_________________
we are microsoft, lower your firewalls and surrender your pc's. we will add your biological and technological distinctiveness to our own. your culture will adapt and service us. resistance is futile.
Back to top
View user's profile Send private message
Insanity5902
Veteran
Veteran


Joined: 23 Jan 2004
Posts: 1228
Location: Fort Worth, Texas

PostPosted: Wed May 05, 2004 12:43 pm    Post subject: Reply with quote

tactless wrote:
...and built into ALSA, which is now an integral part of Linux (as opposed to arts, which is an integral part of KDE). Audio mixing should indeed be done at the ALSA level IMO.



actually the dmix fucntionality is included with the alsa-oss ;) ... I am pretty sure about this. And I would personally like the mixing to be down in the hardware :P, but since we can't the drivers themselves is the next best thing.

From my understanding of dmix from when I implented it, programs access it (which it is basically the alsa drivers) and it mixes the sounds and sends them the /dev/dsp, which is why if you start a program that uses oss you can't play any other sounds b/c it access /dev/dsp directly.

So it is pretty similar to arts and esd, except having an external program handle the mixing you are using the drivers. The lower the level you can do the mixing the better it is going to get.

And also, by doing it directly with alsa, you can get a better support for programs.
_________________
Join the adopt an unanswered post initiative today
Back to top
View user's profile Send private message
lokojones
Tux's lil' helper
Tux's lil' helper


Joined: 29 Feb 2004
Posts: 131
Location: Canary Islands, Spain.

PostPosted: Fri May 28, 2004 11:23 am    Post subject: nforce2 native hardware mixing Reply with quote

Ok.. software mixing works great... but doesn't it sound stupid when having a sound device that supports hw mixing??.. the only reason of this is that nvidia hasn't developed drivers that use this feature..

I've seen some posts asking all nforce2 users to send a mail to nvidia asking for this support.. maybe we could help them... linux-nforce-bugs@nvidia.com
_________________
Pure Gentoozo :)
Back to top
View user's profile Send private message
tactless
l33t
l33t


Joined: 14 Jul 2002
Posts: 642
Location: Mitzpe Adi, Israel

PostPosted: Fri May 28, 2004 12:27 pm    Post subject: Reply with quote

Wouldn't it be better to have our own guys working on it? Myself, I use the kernel ALSA driver for my nForceII...
How does hardware mixing (not dmix) work with ALSA, as far as the user is concerned?
_________________
Tactless

"If it wasn't for fog, the world would run at a really crappy framerate."

Jabber: tactless@amessage.info
Back to top
View user's profile Send private message
vonhelmet
l33t
l33t


Joined: 06 Apr 2004
Posts: 770
Location: Somewhere in a school

PostPosted: Fri May 28, 2004 12:37 pm    Post subject: Reply with quote

tactless wrote:
Wouldn't it be better to have our own guys working on it? Myself, I use the kernel ALSA driver for my nForceII...
How does hardware mixing (not dmix) work with ALSA, as far as the user is concerned?


It basically depends on whether the card in question supports hardware mixing.

If it doesn't then you either have to you a sound daemon like arts or something, or you end up with sounds queued up one after the other which sucks.

If it does support hardware mixing, then the whole thing is fairly seamless as far as the user sees it. Sounds all play at once and everything is good, basically.
_________________
My blog
nvtuner software - enhance your AGP Geforce 6800 or 6200!
Back to top
View user's profile Send private message
lokojones
Tux's lil' helper
Tux's lil' helper


Joined: 29 Feb 2004
Posts: 131
Location: Canary Islands, Spain.

PostPosted: Fri May 28, 2004 1:36 pm    Post subject: Reply with quote

If you mean that why we cant develop hw mixing by ourselves.. just because we need some information to do it... information that nvidia doesnt want to give :(
_________________
Pure Gentoozo :)
Back to top
View user's profile Send private message
Volt3r
n00b
n00b


Joined: 30 Jan 2004
Posts: 61
Location: Poland -> Jaworzno

PostPosted: Fri May 28, 2004 2:24 pm    Post subject: Reply with quote

That works !!! :D
Some time ago i was trying to do that by after few hours i give up.
This how-to was exactly what i need.
Thanks allex87 !!!
Back to top
View user's profile Send private message
hanzotutu
Apprentice
Apprentice


Joined: 10 Apr 2003
Posts: 170

PostPosted: Fri May 28, 2004 5:33 pm    Post subject: Reply with quote

Mine doesn't work. I tried to
Code:

aplay /usr/share/sounds/gaim/arrive.wav

while playing a movie. aplay simply stucked there until I exit the mplayer.

I also tried
Code:

aplay -N /usr/share/sounds/gaim/arrive.wav

while mplayer is playing some movie file. What I got is

    hanzo@scimd: pts/6: 5 files 220Kb-> aplay arrive.wav -N
    ALSA lib pcm_hw.c:1057:(snd_pcm_hw_open) open /dev/snd/pcmC0D0p failed: Device or resource busy
    ALSA lib pcm_dmix.c:868:(snd_pcm_dmix_open) unable to open slave
    aplay: main:507: audio open error: Device or resource busy


Any clue how to solve this problem? What have I done wrong? Thanks.[/code]
_________________
Dell D600, P-M 1.4G, 512M DDR, Radeon M9 32M
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks 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