# How to get via8233/ALSA working?

## Niek

Hello,

I try to get my onboard via8233 soundcard working with ALSA. I merged alsa-driver, alsa-lib, alsa-utils, alsa-tools and alsa-oss.

My /etc/modules.d/alsa looks like this:

```
alias char-major-116 snd

alias char-major-14 soundcore

alias snd-card-0 snd-via8233

alias sound-slot-0 snd-card-0

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
```

And this is my /etc/modules.d/aliases

```
alias snd-card-1 snd-via8233

alias snd-card-2 snd-via8233

alias snd-card-3 snd-via8233

alias snd-card-4 snd-via8233

alias snd-card-5 snd-via8233

alias snd-card-6 snd-via8233

alias snd-card-7 snd-via8233
```

I added alsasound to the boot-runlevel with 'rc-update add alsasound boot'. My kernel have sound support (CONFIG_SOUND=y), but no other sound modules. When I reboot I see no errors, and it seems that ALSA is running OK.

But when I try to play a file, I get this error:

```
tussen root # aplay /usr/kde/3/share/sounds/pop.wav 

Playing WAVE '/usr/kde/3/share/sounds/pop.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono

ALSA lib pcm_hw.c:411:(snd_pcm_hw_drain) SNDRV_PCM_IOCTL_DRAIN failed: Input/output error
```

Do anyone know how I can solve this problem?

Greetings, Niek.

----------

## FINITE

I am having the same exact problem. I havn't goten eny closer to getting it to work either. Pleas post here if you figured it out. Thanx  :Very Happy: 

----------

## thorne

Using the alsa setup doc under the documentation page of gentoo.org got my card working with alsa, but I wasn't too satisfied with the sound quality and performance drop in video playback.  Of course, that drop in performance could just be an error on my part, or a fluke on my system.

Check it out the The ALSA Configuration Guide.  Make sure you follow it word for word.  It does work.  

All of the docs are here.

----------

## cbrese

I'm having the same problem

```

ALSA lib pcm_hw.c:481:(snd_pcm_hw_drain) SNDRV_PCM_IOCTL_DRAIN failed: Input/output error

```

Did you find a solution?

I'm using a VIA VT8235 SB and the snd-via82xx driver and have followed the Gentoo Alsa Guide.

----------

## Gnufsh

sound support, I think, needs to be a module, not compiled in to the kernel.

----------

## cbrese

That not the problem, but just incase I did an make mrproper and rebuilt my kernel and modules.

Any other ideas?

----------

## boglin

I have the same card, and it will work

```

#env ALSA_CARDS="via82xx" emerge alsa-driver

```

,to install ALSA drivers. Then change all your 'snd-via8232' to 'snd-via82xx' (with the x's not the number of you card).

----------

## AlterEgo

 *boglin wrote:*   

> I have the same card, and it will work
> 
> [code]
> 
> ... Then change all your 'snd-via8232' to 'snd-via82xx' (with the x's not the number of you card).

 

Exactly. 

Re-emerging alsa is most probably not necessary.

Rebooting might be necessary in this case (misconfigured alsa can be really stubborn, I guess because it's loadad  at boot-runlevel).

----------

## cbrese

Still having problems.

I've tried rebooting, reemerging alsa, rebuilding the kernel, etc.

I have alsa working on a couple of other machines and I've never had this problem.

I'm still getting this error

```

ALSA lib pcm_hw.c:481:(snd_pcm_hw_drain) SNDRV_PCM_IOCTL_DRAIN failed: Input/output error

```

When I do a cat /proc/pci, I get this

```

  Bus  0, device  17, function  0:

    ISA bridge: VIA Technologies, Inc. VT8233A ISA Bridge (rev 0).

  Bus  0, device  17, function  1:

    IDE interface: VIA Technologies, Inc. VT82C586B PIPC Bus Master IDE (rev 6).

      IRQ 255.

      Master Capable.  Latency=32.

      I/O at 0xe400 [0xe40f].

  Bus  0, device  17, function  5:

    Multimedia audio controller: VIA Technologies, Inc. VT8233 AC97 Audio Controller (rev 80).

      IRQ 11.

      I/O at 0xe800 [0xe8ff].

```

Here's my /etc/modules.d/alsa

```

# ALSA portion

alias char-major-116 snd

# OSS/Free portion

alias char-major-14 soundcore

##

## IMPORTANT:

## You need to customise this section for your specific sound card(s)

## and then run `update-modules' command.

## Read alsa-driver's INSTALL file in /usr/share/doc for more info.

##

##  ALSA portion

alias snd-card-0 snd-via82xx

## alias snd-card-1 snd-ens1371

##  OSS/Free portion

## alias sound-slot-0 snd-card-0

## alias sound-slot-1 snd-card-1

##

# 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.

options snd cards_limit=1

```

----------

## AlterEgo

here's my /etc/modules.d/alsa  (in case there's a difference: I don't notice it; bedtime  :Smile:  ):

alias char-major-116 snd

alias char-major-14 soundcore

alias snd-card-0 snd-via82xx

alias snd-card-1 snd-via82xx

alias snd-card-2 snd-via82xx

alias snd-card-3 snd-via82xx

alias snd-card-4 snd-via82xx

alias snd-card-5 snd-via82xx

alias snd-card-6 snd-via82xx

alias snd-card-7 snd-via82xx

alias snd-card-8 snd-via82xx

alias sound-slot-0 snd-card-0

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

alias /dev/mixer snd-mixer-oss

alias /dev/dsp snd-pcm-oss

alias /dev/midi snd-seq-oss

Hope it's any use.

My /cat/proc/pci is identical.

----------

## cbrese

Some more info...

```

# lsmod

Module                  Size  Used by    Not tainted

snd-via82xx             9196   0

snd-pcm                63904   0  [snd-via82xx]

snd-timer              11944   0  [snd-pcm]

snd-mpu401-uart         3520   0  [snd-via82xx]

snd-rawmidi            14848   0  [snd-mpu401-uart]

snd-seq-device          4348   0  [snd-rawmidi]

snd-ac97-codec         30724   0  [snd-via82xx]

snd                    28748   0  [snd-via82xx snd-pcm snd-timer snd-mpu401-uart snd-rawmidi snd-seq-device snd-ac97-codec]

soundcore               3524   0  [snd]

```

Also I don't have a /dev/dsp and /dev/sound is empty

----------

## cbrese

I still can't get my sound to work.  I've tried upgrading to 0.9.0_rc8 from 0.9.0_rc6 and that dosen't help.  I've also tried replacing via8233.c with the lastest version from the alsa cvs. 

I also tried a knoppix 3.1 cd and it could get the sound working either.

I can't think of anything else to try.

----------

## AlterEgo

Wild guess: think about hardware-related problems: check dmesg for IRQ problems, check your BIOS to double-check the sound card has been enabled, try and assign an interrupt for the soundcard....things like that.

----------

## cbrese

The sound card is enabled in the BIOS, I tried disabling it to see what whould happen, but then the modules wouldn't even load.

Currently I have the BIOS handeling IRQ's automaticaly, I'll try turning it off.

I just built alsa from the most current cvs snapshot, but that didn't help.

I wonder if devfs could be the problem since I don't have a /dev/dsp and /dev/sound/ is empty.  One wierd thing is ls /dev/snd returns this

```

controlC0  pcmC0D0c  pcmC0D0p  pcmC0D1c  pcmC0D1p  timer

```

----------

## cbrese

I still don't have my sound working, but I think the problem is IRQ related.

If I pass acpi=off pci=biosirq on the kernel line in grub I don't get the error message anymore, but I still don't get any sound and there is still no /dev/dsp.

----------

## Isomorph

I had the same problem after i upgraded to gentoo 1.4 from 1.2.

But now I have solved it.

I downgraded to version 0.9.0-r2 for

alsa-driver, alsa-lib and alsa-utils.

Just put 0.9.0-r6 in your /usr/portage/profiles/package.mask

 file like this

# aplay don't work on via8233

=media-sound/alsa-driver-0.9.0_rc6

=media-libs/alsa-lib-0.9.0_rc6

=media-sound/alsa-utils-0.9.0_rc6

And change ALSA_CARDS="via82xx" to ALSA_CARDS="via8233" for this version. 

and change snd-via82xx to snd-via8233 in /etc/modules.d/alsa

Thats all. I still get some warning when I start alsasound but I got sound.

----------

## mart_man00

im getting a "ALSA lib pcm_hw.c:524:(snd_pcm_hw_drain) SNDRV_PCM_IOCTL_DRAIN failed: Input/output error" error to with my sound blaster live, but i dont know what im doing? how did i get this thing setup?

also, how do you think the new alsa sounds? 

thanks

----------

## erob

hi folks,

i tried everything with alsa, everything that is in this forum.... when I got my VT8233 working I got a scatching noise and my sounds at the same time.

For a Solution, you need to update your kernel... (as I read in a german thread! and it works)

read my post in this thread got futher instructions. 

https://forums.gentoo.org/viewtopic.php?t=56076&highlight=vt8233

got fablolous sound now!

hope you all will too!

erob   :Very Happy:   :Very Happy:   :Very Happy: 

----------

