# Via AC'97 / Alsa (help!)

## numerodix

I've seen several threads about installing alsa but none of them have been helpful to me so far. I am trying to setup up my sound card on a Zepto 3001 laptop with a built-in sound card. The driver used in WinXP is called 'Via AC'97 Audio Controller'. I've followed the 'Gentoo Linux Desktop Configuration Guide' and so far no luck. The basic question is which module am I to load for my card? I've tried a couple of them, including ac97, es1371, via82c686 etc but none seem to give any response.

Any help much appreciated!

----------

## fidler

Try intel8x0

----------

## numerodix

No, that didn't help. I currently have the following compiled as modules: ac97_codec, es1370, es1371, i810_audio. Modprobing each one gives an error containing "init_module: No such device".

----------

## fidler

Looks like you are using the oss modules ... you should use the alsa modules if you have alsa installed.  The alsa module should be snd-xxxx instead of the modules you listed.

There is a good tutorial about what to do to install alsa at: 

http://www.gentoo.org/doc/desktop.html#doc_chap3

As for the module to try the intel8x0 card, to install it without sound-state configuration add

```

snd-intel8x0

```

to /etc/modules.autoload

when compiling the kernel make sure to disable all sound-cards, only enabling sound-support into the kernel.

Every time one compiles a new kernel you need to reboot that kernel and then emerge alsa-driver

If you still wish to look at what your card should be you should type

emerge pcitools

lspci

This should show what type of hardware is actually installed...

For me this is:

00:1f.5 Multimedia audio controller: Intel Corp. 82801CA/CAM AC'97 Audio (rev 02)

To use your card you may have to enable acpi support (in the Kernel). I think I had to do that ...

Also a good reference for laptops is www.linux-laptop.net

----------

## wudmx

i think you mean to emerge pciutils ... there is no package called pcitools... 

wudmx

----------

## numerodix

To start with identifying the card, "emerge pcitools" isn't found by emerge for some reason. I ran "emerge rsync" just before that command. 

Yes I did follow that guide.

This procedure you outlined... I was under the impression that any driver would have to be enabled in the kernel to be used later on (?), hence I recompiled every time I changed or added a driver (using the commands listen in the install guide). So your procedure is valid for all cards or just the intel one?

(Sorry about the stupid questions, I'm still new to linux.)

Yes I have seen that laptop site before but I don't see my manufacturer listed as it is not of the mainstream ones.

----------

## wudmx

didnt you read my post? :-)

you have to emerge pciuitils not pcitools... 

wudmx

----------

## numerodix

Yes, sorry, I took a long time posting that time, didn't see yours  :Smile: 

I did run lspci, the output:

00:07.5 Multimedia audio controller: VIA Techologies, Inc. VT82C686 AC97 Audio Controller (rev 50)

Ok, I had a look at the alsa-project.org site now that I have the specific data and following the instructions there (http://www.alsa-project.org/alsa-doc/doc-php/template.php3?company=VIA&card=&chip=via82c686a&module=via686), I'll post an update once I have the kernel updated.

----------

## numerodix

Ok I recompiled the kernel with the snd-via686 driver as a module, only that one, the sound support but no oss support, then I added it to /etc/modules.autoload and it failed to load. I cannot modprobe it either (module not found). I added it to /etc/modules.d/alsa as the install guide instructs, whereupon "update-modules".

Ps. I've also noticed in a couple of places the instruction to run "modinfo soundcore" but that gives "modinfo: soundcore: no module by that name found"

Pss. Turning on ACPI is a bad idea apparently, it crashed my system and I had to boot from the install cd.

----------

## numerodix

Ok, some progress finally perhaps... I looked in the /lib/modules/*/kernel/drivers/sound dir and typed in the name of the via module without the extension, the modinfo had an entry. So I added "via82cxxx_audio" in /etc/modules.autoload and for the first time ever no error at boot time. At this time the kernel was recompiled to include oss support.

So continuing with the desktop guide, the "amixer" command still gives an error but it looks like I might finally have a driver loaded. What do I do next?

----------

## numerodix

Ok, some progress finally perhaps... I looked in the /lib/modules/*/kernel/drivers/sound dir and typed in the name of the via module without the extension, the modinfo had an entry. So I added "via82cxxx_audio" in /etc/modules.autoload and for the first time ever no error at boot time. At this time the kernel was recompiled to include oss support.

So continuing with the desktop guide, the "amixer" command still gives an error but it looks like I might finally have a driver loaded. What do I do next?

----------

## fidler

I had the same problem.

You need to adjust your settings and then type the following command:

alsactl store -f /etc/asound.state

and it should work fine.

----------

## numerodix

Sorry, what settings exactly?

----------

## fidler

Type in 

alsamixer

Then adjust your audio settings, or follow the guide and use

amixer set Master 100 unmute

amixser set PCM 100 unmute

Then type

alsactl store -f /etc/asound.state

----------

## numerodix

Ok, I finally got it working now, looks like I misunderstood the instructions at first. I compiled the kernel with sound support only, no sound modules. Then I emerged alsa-driver and alsa-utils. That worked fine. Then I unmuted the channels and added alsasound to the boot runlevel. And here comes the problem. Whenever I try to run /etc/init.d/alsasound start, whether from the console or at boot, it first starts alsa, then it freezes trying to load the sound module snd-via686.

However I can get the sound working by unmuting the channels again, it seems to work once I do that. I did what you suggested, adjusting the settings and saving them to /etc/asound.state but that didn't help.

Any suggestions?

----------

## fidler

 *numerodix wrote:*   

> Ok, I finally got it working now, looks like I misunderstood the instructions at first. I compiled the kernel with sound support only, no sound modules. Then I emerged alsa-driver and alsa-utils. That worked fine. Then I unmuted the channels and added alsasound to the boot runlevel. And here comes the problem. Whenever I try to run /etc/init.d/alsasound start, whether from the console or at boot, it first starts alsa, then it freezes trying to load the sound module snd-via686.
> 
> However I can get the sound working by unmuting the channels again, it seems to work once I do that. I did what you suggested, adjusting the settings and saving them to /etc/asound.state but that didn't help.
> 
> Any suggestions?

 

Did you compile only the sound *directly* into the kernel, or did you make it a module?

I would suggest compiling directly into the kernel.  Otherwise it might not load the module before it tries to load snd-via, and perhaps give the error that you are seeing.  

Otherwise you can add the following to your modules.autoload:

sound

soundcore

(I think...)

and make sure that instead of adding the alsasound to the boot level, add it to the default level, so that it loads the modules before running the alsasound script.

Tell me if that works.

----------

## numerodix

No, I compiled directly into the kernel. The thing is also that at first it just gave me an error saying all channels were muted or similar, on the very first boot. Then I tried unmuting them for the first time and ever since I've had the problem.

I tried your suggestion, but it turns out that both the sound and soundcore modules fail to load and again the system freezes once it reaches the via driver.

One other thing I noticed is that running "sound" gives an error, command not found. Same goes for "soundcore". So I did an updatedb and tried to locate soundcore, found a soundcore.o file in /usr/src/linux/*/drivers/sound/. But a modprobe failed, as did a modinfo on "soundcore".

----------

## fidler

 *numerodix wrote:*   

> No, I compiled directly into the kernel. The thing is also that at first it just gave me an error saying all channels were muted or similar, on the very first boot. Then I tried unmuting them for the first time and ever since I've had the problem.
> 
> I tried your suggestion, but it turns out that both the sound and soundcore modules fail to load and again the system freezes once it reaches the via driver.
> 
> One other thing I noticed is that running "sound" gives an error, command not found. Same goes for "soundcore". So I did an updatedb and tried to locate soundcore, found a soundcore.o file in /usr/src/linux/*/drivers/sound/. But a modprobe failed, as did a modinfo on "soundcore".

 

There shouldn't be sound nor soudcore modules if you compiled directly into the source.

I would remove the snd-via from your modules.autoload file.  The desktop configuration guide doesn't talk about this so I assume that it is not recommended.

If that doesn't work, try finding someone with the same type of sound-card and asking them for their /etc/asound.state file.  

Once I recompile my system for GCC 3.2, I will give you my /etc/asound.state if you want it.... But we don't have the same sound-card so I'm not sure if it is the configuration file that you want/need.  I think you could probably delete the non-essential portions...?

----------

## numerodix

The snd-via driver was not in my modules.autoload file... it's empty.

----------

## linux_girl

 *numerodix wrote:*   

> The snd-via driver was not in my modules.autoload file... it's empty.

 

I have vanilla-sources 2.4.22.

At kernel building time : i have selected

-soundCardSuport as module

-via audio codec as module (via82cxxx_audio)

-procesor type & feature pentium 4

-prompte for incomplet driver...

and ....

i dont remember if via82cxxx_audio codec was auloded firt time i booted.

But i was surprised to see that Ensoniq ES1370 was also builed

The sound was not working.

```
lsmod

Module                  Size  Used by    Tainted: PF

floppy                 52028   0  (autoclean)

nvidia               1626464  11  (autoclean)

8139too                15720   1

mii                     2560   0  [8139too]

nls_iso8859-1           2844   3  (autoclean)

nls_cp437               4348   3  (autoclean)

vfat                   10860   3  (autoclean)

fat                    32696   0  (autoclean) [vfat]

usb-storage            69404   0  (unused)

hid                    15412   0  (unused)

uhci                   25760   0  (unused)

ehci-hcd               17632   0  (unused)

usbcore                63200   1  [usb-storage hid uhci ehci-hcd]

```

```

modprobe via82cxxx_audio

Module                  Size  Used by    Tainted: PF

via82cxxx_audio        21624   0

ac97_codec             13736   0  [via82cxxx_audio]

soundcore               3908   2  [via82cxxx_audio]

floppy                 52028   0  (autoclean)

nvidia               1626464  11  (autoclean)

8139too                15720   1

mii                     2560   0  [8139too]

nls_iso8859-1           2844   3  (autoclean)

nls_cp437               4348   3  (autoclean)

vfat                   10860   3  (autoclean)

fat                    32696   0  (autoclean) [vfat]

usb-storage            69404   0  (unused)

hid                    15412   0  (unused)

uhci                   25760   0  (unused)

ehci-hcd               17632   0  (unused)

usbcore                63200   1  [usb-storage hid uhci ehci-hcd]

```

And since modprobe the sound worked prety fine.

xmms run well using oss pulgin-output.

I tried to play a *.avi file using xine while listenig to xmms playing audio stream.

An error ocured. I closed xmms and reloaded xine. the audio-sound worked fine.

The sound work excepted when 2 audio app are runing at the same time.

I decided to setup ALSA . I have heared a lot about it.

```

modprobe -r via82cxxx_audio;lsmod

Module                  Size  Used by    Tainted: PF

floppy                 52028   0  (autoclean)

nvidia               1626464  11  (autoclean)

8139too                15720   1

mii                     2560   0  [8139too]

nls_iso8859-1           2844   3  (autoclean)

nls_cp437               4348   3  (autoclean)

vfat                   10860   3  (autoclean)

fat                    32696   0  (autoclean) [vfat]

usb-storage            69404   0  (unused)

hid                    15412   0  (unused)

uhci                   25760   0  (unused)

ehci-hcd               17632   0  (unused)

usbcore                63200   1  [usb-storage hid uhci ehci-hcd]

```

every sound related audio was unloaded !

So i folowed the  gentoo-ALSA guide

At the writing time the folowing had been merged:

media-sound/alsa-driver-0.9.6  +oss

media-libs/alsa-lib-0.9.6

media-sound/alsa-utils-0.9.6-r1

And finaly :

```

/etc/init.d/alsasound start

   Loading ALSA drivers...

   Loading: snd-seq-oss

   Loading: snd-pcm-oss

   Loading: snd-mixer-oss

   Loading: snd-via82xx

   Loading: snd-seq-oss

   Running card-dependant scripts

   Restoring Mixer Levels

   every things goes OK

```

```

lsmod

Module                  Size  Used by    Tainted: PF

snd-pcm-oss            39588   0  (unused)

snd-mixer-oss          13752   0  [snd-pcm-oss]

snd-via82xx            13216   0  (autoclean)

snd-pcm                63264   0  (autoclean) [snd-pcm-oss snd-via82xx]

snd-ac97-codec         41560   0  (autoclean) [snd-via82xx]

snd-mpu401-uart         3472   0  (autoclean) [snd-via82xx]

snd-rawmidi            13920   0  (autoclean) [snd-mpu401-uart]

snd-page-alloc          6740   0  (autoclean) [snd-via82xx snd-pcm]

snd-seq-oss            29472   0  (unused)

snd-seq-midi-event      3584   0  [snd-seq-oss]

snd-seq                37968   2  [snd-seq-oss snd-seq-midi-event]

snd-timer              14852   0  [snd-pcm snd-seq]

snd-seq-device          4336   0  [snd-rawmidi snd-seq-oss snd-seq]

snd                    31652   0  [snd-pcm-oss snd-mixer-oss snd-via82xx snd-pcm snd-ac97-codec snd-mpu401-uart snd-rawmidi snd-seq-oss snd-seq-midi-event snd-seq snd-timer snd-seq-device]

soundcore               3908   6  [snd]

floppy                 52028   0  (autoclean)

nvidia               1626464  11  (autoclean)

8139too                15720   1

mii                     2560   0  [8139too]

nls_iso8859-1           2844   3  (autoclean)

nls_cp437               4348   3  (autoclean)

vfat                   10860   3  (autoclean)

fat                    32696   0  (autoclean) [vfat]

usb-storage            69404   0  (unused)

hid                    15412   0  (unused)

uhci                   25760   0  (unused)

ehci-hcd               17632   0  (unused)

usbcore                63200   1  [usb-storage hid uhci ehci-hcd]

```

Now i get one or two audio-app working at the same time but the sound is crackling very mutch! My head is about to blow away. It dangerous for my sanity.

i noticed some things very strange : when closing all app (the ones that use sound output ).

Xine played a divx movie whitout crackling. The sound was perfect ! . All others mp3 and divx was crackling execepted one.

This is very bizare ! After further investigations i noticed that the mp3 audio stream have a 48000 Hz samplerate.

All my mp3 song, all my movie has a 44100Hz samplerate and use mp3 codec.

Conclusion the 48000 hz samplerate in audio stream make my hardware play very well .

To stop crackling sound i have to run xine and play that movie(48000Hz)and pause it.

then i can play "44100hz mp3" using xmms.

if xine stoped the sound is fine til it doesnot reache the next mp3 song in the playlist.

I am wondering if somme ones can help me to make my sound working .

I have tryed to change defauts options in ac97-codec clock but notings worked.

it's about two weeks of  hot sumer hollyday . and i am trying to make the sound work.

--My Hardware spec--

```

scanpci

pci bus 0x0000 cardnum 0x00 function 0x00: vendor 0x1106 device 0x3168

 VIA Technologies, Inc. VT8374 P4X400 Host Controller/AGP Bridge

pci bus 0x0000 cardnum 0x01 function 0x00: vendor 0x1106 device 0xb168

 VIA Technologies, Inc. VT8235 PCI Bridge

pci bus 0x0000 cardnum 0x0b function 0x00: vendor 0x10ec device 0x8139

 Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+

pci bus 0x0000 cardnum 0x10 function 0x00: vendor 0x1106 device 0x3038

 VIA Technologies, Inc. USB

pci bus 0x0000 cardnum 0x10 function 0x01: vendor 0x1106 device 0x3038

 VIA Technologies, Inc. USB

pci bus 0x0000 cardnum 0x10 function 0x02: vendor 0x1106 device 0x3038

 VIA Technologies, Inc. USB

pci bus 0x0000 cardnum 0x10 function 0x03: vendor 0x1106 device 0x3104

 VIA Technologies, Inc. USB 2.0

pci bus 0x0000 cardnum 0x11 function 0x00: vendor 0x1106 device 0x3177

 VIA Technologies, Inc. VT8235 ISA Bridge

pci bus 0x0000 cardnum 0x11 function 0x01: vendor 0x1106 device 0x0571

 VIA Technologies, Inc. VT82C586/B/686A/B PIPC Bus Master IDE

pci bus 0x0000 cardnum 0x11 function 0x05: vendor 0x1106 device 0x3059

 VIA Technologies, Inc. VT8233 AC97 Audio Controller

pci bus 0x0001 cardnum 0x00 function 0x00: vendor 0x10de device 0x0171

 nVidia Corporation NV17 [GeForce4 MX 440]

lspci

00:00.0 Host bridge: VIA Technologies, Inc. VT8374 P4X400 Host Controller/AGP Bridge (rev 03)

00:01.0 PCI bridge: VIA Technologies, Inc. VT8235 PCI Bridge

00:0b.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

00:10.0 USB Controller: VIA Technologies, Inc. USB (rev 80)

00:10.1 USB Controller: VIA Technologies, Inc. USB (rev 80)

00:10.2 USB Controller: VIA Technologies, Inc. USB (rev 80)

00:10.3 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 82)

00:11.0 ISA bridge: VIA Technologies, Inc. VT8235 ISA Bridge

00:11.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE (rev 06)

00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235 AC97 Audio Controller (rev 50)

01:00.0 VGA compatible controller: nVidia Corporation NV17 [GeForce4 MX 440] (rev a3)

```

Please help me

----------

## shakti

i have the same soundcard/mb. module via82xx what i did is install xmms crossfade and this very plugin lets you choose wich samplerate to use. this solved my bad sound problem..  :Smile: 

----------

## linux_girl

 *shakti wrote:*   

> i have the same soundcard/mb. module via82xx what i did is install xmms crossfade and this very plugin lets you choose wich samplerate to use. this solved my bad sound problem.. 

 

but when playing a movie ? the crossfade plugin is useless.

----------

