# Realtek ac97 and Ubuntu



## Ginosko (May 11, 2004)

Hey, im just trying to get my sound working right, it works fine sometimes it just has the generic linux drivers and i would like to get the official ones. Any experience with this?
Thanks


----------



## tsunam (Sep 14, 2003)

ac97 is the generic audio codec developed by intel (ie..it all uses the same driver because it all does the same thing. note: its not actually a "codec" in the conventional sense of the meaning, in this case its the signals being encoded,decoded and the to and from analog to digital. *stops for commercial break* This lesson brought to you by the letter A  )...the only thing I found on Realtek's site is a software suite for linux..which although a nice "we're for the os community" is entirely pointless.

In otherwords, just stick with the alsa driver you are using currently.


----------



## Ginosko (May 11, 2004)

ok, the linux drivers are working well except i get this error alot

Sound server informational message:
Error while initializing the sound driver:
device: default can't be opened for playback (Device or resource busy)
The sound server will continue, using the null output device.

and its quite annoying. anyone know a cure?


----------



## tsunam (Sep 14, 2003)

basically what is happening, is that the realtek ac97 card you have doesn't have hardware mixing...so only one device can use the sound card at a time. if something else trys to use it..then you will get the error message.

you need to create a .asoundrc in your user's account (/home/Ginosko/ for example) and put the following in:


```
pcm.ossmix {
    type dmix
    ipc_key 1024
    slave {
        pcm "hw:0,0"
        period_time 0
        period_size 1024
        buffer_size 4096        # buffer size < 6653, but pow(x, 2)
        rate 44100              # we want to play CDs only
    }

    bindings {
        0 0
                1 1
        }
}

# Everything shall be dmixed, so redefine "default":
pcm.!default {
    type plug
    slave.pcm "ossmix"
}

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

ctl.mixer0 {
    type hw
    card 0
}
```
That should more or less take care of the issue (hopefully). Basically it takes all the input's and does software mixing on them, so they all combine to one device and use only that one.


----------



## Ginosko (May 11, 2004)

sorry for the long delays in replys. so i just insert that as a text file into the forementioned spot and it should help? Or is there anything special i need to do?


----------



## tsunam (Sep 14, 2003)

yep just create the .asoundrc file with your favorite text editor. You'll probably want to restart anything that makes use of sound, including the x server (can be done with a reboot, or not). You then should start having software mixing so that all sounds go through that nice little .asoundrc file before connecting to the pcm device. Generally, if you use gnome or kde this shouldn't be neccessary since they have their own soundserver (read software mixer) that should do it for you.


----------

