Independent ALSA and linux audio support site

Via8233

From the ALSA wiki

Jump to: navigation, search

Via do not produce sound cards but their motherboard chip sets do provide the interface for an audio chip mounted on the motherboard. See Sound Cards: Introduction for details.

The Via8233 southbridge chip manufactured by VIA Technologies can act as the computer interface to an AC97-compatible audio chip. The options available will depend on the audio chip chosen by the motheroard manufacturer but it should still be possible to drive the system using the Alsa via82xx driver,

Contents

Notes

It seems that the ALSA 0.9 Via8233 driver only works in OSS emulation mode.

Setup

The module name for the Via8233 driver is "snd-via82xx". Visit the modules.conf article to find out how to configure your system to recognize your card.

Configuration

.asoundrc

The .asoundrc file can be used to modify the performance and operation of your card.

Multi-Channel Output

Some Via chips support 6 channel output through the line in, line out, and microphone jacks. Enable 'Mic As Center/LFE' and 'Line-In As Surround' with alsamixer to use this. If you want to play 2 channel sound files over all 6 channels, see this Howto.

MPU-401 MIDI

The "MPU-401 MIDI setup howto" describes how to configure the MPU-401 capabilities of the Via8233 card.

Features

ALSA native device support

alias char-major-116 snd 
alias snd-card-0 snd-card-via8233 

For version 0.9 of the alsa drivers, the name of the modules is changed to snd-via8233:

alias snd-card-0 snd-via8233

OSS/Free setup

alias char-major-14 soundcore 
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 

Trouble shooting with the module name

If you have the following message in your log, you may be a user of alsa-driver-0.9.6 or later :

Can't locate module snd-via8233

Then rename via8233 to via82xx in /etc/modules.conf and check available via module names like this :

thocar@linux:~/d/Labo/alsa-driver-0.9.6> find -name "*via*"
./modules/snd-via82xx.o
./pci/via82xx.c
./pci/via82xx.o
./pci/snd-via82xx.o
./alsa-kernel/pci/via82xx.c

Options in /etc/modules.conf

A quick way to create a complete set of /etc/modules.conf entries is to run the script alsaconf in the alsa-driver/utils/ directory. (The alsaconf script can also be used to play a test sound - read its man page (kept in the same directory) for details.)

There are a few parameters to the snd-via82xx options line that control some of the unique features of the VIA 82xx chips. The features themselves are documented officially in alsa-driver-0.9.x/alsa-kernel/Documentation/ALSA-Configuration.txt

A nice detailed explanation of when you might use each option to fix various noise problems can be found in the ALSA mailing list: http://www.mail-archive.com/[email protected]/msg08159.html

Issues

Poor sound quality

In some circumstances you can observe that sound quality is very poor (whistling, annoying harmonic distortions, especially noticeable in high-frequency area), which at first glance is strange because windows drivers on the same hardware plays nicely. This happens because the sound card contains two PCM devices (called pcm0p and pcm1p under alsa).

The first PCM device exhibits such behaviour (it is intended for four-channel output). If you instruct the applications to use the second PCM device, the distortions disappear. If your application is using the old /dev/dsp interface, instruct it to use /dev/adsp instead. If your application is ALSA-aware, instruct it to use second pcm device (you can set ALSA_PCM_DEVICE to 1 before running the application, if your .asoundrc honours this variable - you can do 'aplay -L 2>.asoundrc' and then edit it a little by hand - remove first and last lines).

.asoundrc to use pcm1p

   pcm.via82xx
   {
       type hw
       card 0
       device 1
   }
   ctl.via82xx
   {
       type hw
       card 0
   }

Too high output volume-settings will heavily distort or equalize your sound. 50% on both Master and PCM output will get you normal sound.

To output to S/PDIF, simply play through the hw PCM device as normal. If no sound comes out (There may be a few seconds' buffering delay), try:

If the playback device indicates a link is present, but makes no sound, check the mixer 'IEC958 Playback AC97-SPSA'. The S/PDIF always outputs at full volume - even muting the master or PCM mixers does not affect the S/PDIF volume. The meanings of the settings for 'IEC958 Playback AC97-SPSA' are

   0. PCM1
   1. PCM2,PCM1 (rear)
   2. Centre and LFE
   3. PCM3,Modem,Dedicated S/PDIF

Most users will want it set to 0 (PCM1). Some of the 82xx chips have a dedicated S/PDIF port, which is (I assume) accessed by setting it to 3 (Dedicated S/PDIF). The default appears to be 3.

Some EPIA (Mini-ITX) motherboards have a jumper to switch the phono port on the back between S/PDIF and Composite Video. Make sure it is in the correct position. If it is in the wrong position, there is a good chance that the playback device will not indicate a link. You can also try the 'ac97_quirk' option if the volume level is very low (probably due to switched master & headphone controls): ac97_quirk - AC'97 workaround for strange hardware (-1 = default)

   -1 = default, don't override
    0 = disable
    1 = use headphone control as master
    2 = swap headphone and master controls
    3 = for AD1985, turn on OMS bit and use headphone

VIA8237 & Realtek ALC658 Codec optical out (Abit KV8Pro): Problem: Sound Mickey Mouse like, too fast, played 44100 Hz probably with 48000 Hz ? .asoundrc solution (Alsa 1.0.8, kernel 2.6.11):

   pcm.via82xx {
       type hw
       card 0
   }

   ctl.via82xx {
       type hw
       card 0
   }

   pcm.!default {
       type plug
       slave.pcm "spdif"
       slave.rate 48000
   }

'slave.rate 48000' did the trick.

How does this work?

Alternative Solution to Poor Sound Quality Problem

The previous contributor suggests using the device /dev/adsp. Using ALSA 0.9.6, I do not seem to have this device. However, I have solved all audio quality problems by telling every application to output sound at a sample rate of 48000 Hz, but this solution take more CPU.

For example:

You can also achieve this without having to tweak all sound applications. Just edit .asoundrc for per-user-settings, or /etc/asound.conf for global settings (Alsa 1.0.9, kernel 2.6.12):

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

   pcm.dmixer {
       type dmix
       ipc_key 1024
       slave {
           pcm "hw:0,1"
           period_time 0
           period_size 1024
           buffer_size 4096
           rate 48000
       }
       bindings {
           0 0
           1 1
       }
   }

   ctl.dmixer {
       type hw
       card 0
   }

This will use (a) your second sound device (pcm "hw:0,1" does this trick - the second device on the first card) and (b) resample everything to 48000Hz (rate 48000 does this trick). It just works nicely on my system (AMD Athlong TBird 1200). top shows \~1.0% CPU usage for aplay. Then don't forget to restart your alsa service (easiest: reboot PC), or else the changes won't have any effect.

The "Poor Sound Quality Problem" solved ...

Hope this trick will help, being REALLY annoyed by these whistling sounds coming out of my speakers each time I try to put my favourite 'Radiohead' song, I started to read the manuals. If you go into 'ALSA 0.9.x Developer documentation' section on ALSA-Project website, you will find a very useful guide on 'Kernel OSS-Emulation' written by Takashi Iwai. Read it, the solution resides in the possibilty to swap devices (technically speaking it inverts the PCM pin assignment toward their devices counterpart) by giving some options to the module (snd-pcm-oss). For me adding the following line to my /etc/modules.conf solved the problem:

   options snd-pcm-oss dsp_map=1 (The 1 corresponds to PCM2)

It just tells the OSS module to assign PCM2 to /dev/dsp device. After having unload/reload all modules, everything should work. Of course this just solves the problem for those applications that use the OSS-Layer Emulation of ALSA drivers ... Any better ideas ?

You can reach me to this adress: [email protected]

Repeating Sounds

This driver seems to have a problem with buffering. It repeats the same sound over and over when I play a WAV file. --A

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

Using 2.6.1 with the alsa-driver 1.0.1 copied into the tree (re: http://alsa.opensrc.org/index.php?page=AlsaBuild2.6)

I've tried all the different combinations of dxs_support settings as well as the dsp_map=1 option given above, tried forcing everything to 48000 too. I always seem to get a of messages similar to (when trying to play anything using [with and w/o esd] mpg123, xmms, alsaplayer):

   request_module: failed /sbin/modprobe -- snd-card-1. error = 256
   ALSA sound/pci/via82xx.c:717: invalid via82xx_cur_ptr, using last valid pointer

   ALSA sound/core/pcm_lib.c:186: Unexpected hw_pointer value [1] (stream = 0, delta: -72, max jitter = 8192): wrong interrupt acknowledge?

   ALSA sound/core/pcm_lib.c:186: Unexpected hw_pointer value [1] (stream = 0, delta: -56, max jitter = 8192): wrong interrupt acknowledge?

   ALSA sound/core/pcm_lib.c:186: Unexpected hw_pointer value [1] (stream = 0, delta: -8184, max jitter = 8192): wrong interrupt acknowledge?

   ALSA sound/core/pcm_lib.c:186: Unexpected hw_pointer value [1] (stream = 0, delta: -488, max jitter = 8192): wrong interrupt acknowledge?

[email protected]

DXS channels

The newer VIA 8233 (but not 8233A) and 8235 chips support 4 DXS channels, which can be used to play at most 4 sounds simultaneously without using software mixing (such as dmix). However, after the DXS support was initially implemented, it was discovered that the sound quality is often poor. Apparently many motherboards have sound quality problems when DXS channels are used with any sample rate except 48000 Hz. Because of this, since ALSA 0.9.7 the DXS channels by default are set to 48000 Hz only mode. But this brings some other problems:

These problems can in many cases be avoided by setting the 'dxs_support' module parameter appropriately. This parameter can take one of the following values:

So, if you have problems with snd-via82xx, you can try to use dxs_support:

If you find a value which works good for your motherboard, please report it to the ALSA mailing list, so that it can be added to the whitelist. Include the output of 'lspci -v' into your report (you can send just the section for the audio controller instead of the full output).

Problems with recording on via8233 rev.60

When you got error like this "arecord: pcm_read:1196: read error: Input/output error" on recording, change in alsamixer controls with name "Input Source Select" to "Input 1".

[2004-04-26] Whitelist

Where do I find it?

Still no sound but everything seems to work fine?

If your driver's starting normally and reports no errors but you still have no sound try to tweak the alsamixer settings.

   alsamixer

(If alsamixer returns an error message try to specify the card number, eg. type alsamixer 1).

On my on-board sound card I had to mute the item "IEC958 Capture Monitor" (second item after Phone) in order to be able to hear anything, whereas the module was working correctly.

Retrieved from "http://alsa.opensrc.org/Via8233"

Category: Sound cards