Skip to contentSkip to conversation

integration of via668 and via8233 drivers

DISCUSSION Takashi Iwai 2 participants 13 messages Sep 4, 2002 – Sep 6, 2002

lore
Share & tools
lore
#0 lore raw

Hi,

right now I committed the changes for VIA chip drivers to cvs.

now via686 and via8233 drivers are merged into a unified driver, via82xx. this supports both VIA686 and VIA8233 south bridges. the supported functions are identical with older drivers. so it's nothing but a merge of two modules into one.

i've tested it shortly on my via686 chip, and confirmed to work. but on via8233 it's not tested much.

if you have via8233 chipset, please test a newer driver.

thanks,

Takashi

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

#1 lore raw

Hello!

Quoted 9 lines

right now I committed the changes for VIA chip drivers to cvs.

now via686 and via8233 drivers are merged into a unified driver, via82xx. this supports both VIA686 and VIA8233 south bridges. the supported functions are identical with older drivers. so it's nothing but a merge of two modules into one.

i've tested it shortly on my via686 chip, and confirmed to work. but on via8233 it's not tested much.

Actually, I have via686, and it used to work with the CVS version a few months ago. I tried it a week ago and it didn't work (it produced wrong sounds). We'll see if your integration fixed it. If it didn't I'll do a binary search.

Right now, I have unresolved symbols with the CVS version:

# depmod -ae
depmod: *** Unresolved symbols in 
/lib/modules/2.4.20-pre5/kernel/sound/pci/snd-via82xx.o
depmod:         snd_mpu401_uart_new_R84d07db1
depmod:         snd_mpu401_uart_interrupt_R4ea4dc60
depmod:         snd_ac97_set_rate_Rae15d98c
depmod:         snd_ac97_mixer_Rb0b86cda

snd-mpu401.o and snd-mpu401-uart.o are not compiled and not installed. The configure options are:

--without-sequencer --with-oss --without-isapnp --with-cards=via82xx

Looks like a configuration problem to me. --with-cards=via82xx should enable the mpu401 and ac97 modules if the symbols from them are used in the driver.

Signature · 9 lines
Regards,
Pavel Roskin



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
#2 lore raw

At Thu, 5 Sep 2002 03:53:00 -0400 (EDT),

Quoted 28 lines · Pavel Roskin

Hello!

Quoted 9 lines

right now I committed the changes for VIA chip drivers to cvs.

now via686 and via8233 drivers are merged into a unified driver, via82xx. this supports both VIA686 and VIA8233 south bridges. the supported functions are identical with older drivers. so it's nothing but a merge of two modules into one.

i've tested it shortly on my via686 chip, and confirmed to work. but on via8233 it's not tested much.

Actually, I have via686, and it used to work with the CVS version a few months ago. I tried it a week ago and it didn't work (it produced wrong sounds). We'll see if your integration fixed it. If it didn't I'll do a binary search.

Right now, I have unresolved symbols with the CVS version:

# depmod -ae
depmod: *** Unresolved symbols in 
/lib/modules/2.4.20-pre5/kernel/sound/pci/snd-via82xx.o
depmod:         snd_mpu401_uart_new_R84d07db1
depmod:         snd_mpu401_uart_interrupt_R4ea4dc60
depmod:         snd_ac97_set_rate_Rae15d98c
depmod:         snd_ac97_mixer_Rb0b86cda
Quoted 8 lines

snd-mpu401.o and snd-mpu401-uart.o are not compiled and not installed. The configure options are:

--without-sequencer --with-oss --without-isapnp --with-cards=via82xx

Looks like a configuration problem to me. --with-cards=via82xx should enable the mpu401 and ac97 modules if the symbols from them are used in the driver.

please rebuild the driver with cvscompile script.
you need to regenerate acinclude.m4 etc.

Takashi

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

#3 lore raw

Hello!

Quoted 2 lines

please rebuild the driver with cvscompile script.
you need to regenerate acinclude.m4 etc.

It was a clean build. The patch (tested) is attached. Unfortunately, the sound is still helicopter-like, but it's another problem. Tested on this device:

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

        Subsystem: Unknown device 5860:11d4
        Flags: medium devsel, IRQ 10
        I/O ports at cc00 [size=256]
        I/O ports at d000 [size=4]
        I/O ports at d400 [size=4]
        Capabilities: [c0] Power Management version 2

====================== cut here ====================
Index: alsa-kernel/core/Makefile
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/core/Makefile,v retrieving revision 1.28

core/Makefile +1 -2
diff -u -r1.28 Makefile
@@ -78,8 +78,7 @@
 obj-$(CONFIG_SND_RME32) += snd-pcm.o snd-timer.o snd.o
 obj-$(CONFIG_SND_RME96) += snd-pcm.o snd-timer.o snd.o
 obj-$(CONFIG_SND_SONICVIBES) += snd-pcm.o snd-timer.o snd.o snd-rawmidi.o snd-hwdep.o
-obj-$(CONFIG_SND_VIA686) += snd-pcm.o snd-timer.o snd.o snd-rawmidi.o
-obj-$(CONFIG_SND_VIA8233) += snd-pcm.o snd-timer.o snd.o
+obj-$(CONFIG_SND_VIA82XX) += snd-pcm.o snd-timer.o snd.o snd-rawmidi.o
 obj-$(CONFIG_SND_ALI5451) += snd.o snd-rawmidi.o snd-timer.o snd-pcm.o
 obj-$(CONFIG_SND_CS46XX) += snd-pcm.o snd-timer.o snd.o snd-rawmidi.o
 obj-$(CONFIG_SND_EMU10K1) += snd-pcm.o snd-timer.o snd.o snd-rawmidi.o snd-hwdep.o

Index: alsa-kernel/core/seq/Makefile
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/core/seq/Makefile,v retrieving revision 1.20

core/seq/Makefile +1 -1
diff -u -r1.20 Makefile
@@ -67,7 +67,7 @@
 obj-$(CONFIG_SND_ICE1712) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o
 obj-$(CONFIG_SND_INTEL8X0) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o
 obj-$(CONFIG_SND_SONICVIBES) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
-obj-$(CONFIG_SND_VIA686) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o
+obj-$(CONFIG_SND_VIA82XX) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o
 obj-$(CONFIG_SND_ALI5451) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o
 obj-$(CONFIG_SND_CS46XX) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o
 obj-$(CONFIG_SND_EMU10K1) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-virmidi.o

Index: alsa-kernel/drivers/mpu401/Makefile
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/drivers/mpu401/Makefile,v retrieving revision 1.9

drivers/mpu401/Makefile +1 -1
diff -u -r1.9 Makefile
@@ -35,7 +35,7 @@
 obj-$(CONFIG_SND_ICE1712) += snd-mpu401-uart.o
 obj-$(CONFIG_SND_INTEL8X0) += snd-mpu401-uart.o
 obj-$(CONFIG_SND_SONICVIBES) += snd-mpu401-uart.o
-obj-$(CONFIG_SND_VIA686) += snd-mpu401-uart.o
+obj-$(CONFIG_SND_VIA82XX) += snd-mpu401-uart.o
 obj-$(CONFIG_SND_ALI5451) += snd-mpu401-uart.o
 obj-$(CONFIG_SND_TRIDENT) += snd-mpu401-uart.o
 obj-$(CONFIG_SND_YMFPCI) += snd-mpu401-uart.o

Index: alsa-kernel/pci/ac97/Makefile
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/ac97/Makefile,v retrieving revision 1.7

pci/ac97/Makefile +1 -2
diff -u -r1.7 Makefile
@@ -17,8 +17,7 @@
 obj-$(CONFIG_SND_ICE1712) += snd-ac97-codec.o
 obj-$(CONFIG_SND_INTEL8X0) += snd-ac97-codec.o
 obj-$(CONFIG_SND_MAESTRO3) += snd-ac97-codec.o
-obj-$(CONFIG_SND_VIA686) += snd-ac97-codec.o
-obj-$(CONFIG_SND_VIA8233) += snd-ac97-codec.o
+obj-$(CONFIG_SND_VIA82XX) += snd-ac97-codec.o
 obj-$(CONFIG_SND_ALI5451) += snd-ac97-codec.o
 obj-$(CONFIG_SND_CS46XX) += snd-ac97-codec.o
 obj-$(CONFIG_SND_EMU10K1) += snd-ac97-codec.o

====================== cut here ====================

Signature · 9 lines
Regards,
Pavel Roskin



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
#4 lore raw

At Thu, 5 Sep 2002 09:33:14 -0400 (EDT),

Quoted 7 lines · Pavel Roskin

Hello!

Quoted 2 lines

please rebuild the driver with cvscompile script.
you need to regenerate acinclude.m4 etc.

It was a clean build. The patch (tested) is attached.

agghh, that's it. thanks.

Quoted 2 lines

Unfortunately, the
sound is still helicopter-like, but it's another problem.

which application?

Takashi

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

#5 lore raw

Hello!

Quoted 4 lines
Quoted 2 lines

Unfortunately, the
sound is still helicopter-like, but it's another problem.

which application?

timidity and xmms. I hear short loud periodic sounds. Setting lower sampling rate in timidity causes longer delays between the pulses.

Linux-2.4.20-pre5, Red Hat 7.3, timidity++-2.11.3-1.

The emu10k1 ALSA driver has been working fine on the same machine. The VIA audio is integrated. The via686 driver worked with the internal audio before I installed SB Live, which must have been some time in March of this year.

Looking at the log of alsa-kernel/pci/via686.c, following entry looks "promising":

----------------------------
revision 1.24
date: 2002/08/13 16:29:18; author: perex; state: Exp; lines: +13 -9 AC97 cold reset only when AC-link is down
----------------------------

I'm away from that computer now, but I'll have a look this evening.

Signature · 9 lines
Regards,
Pavel Roskin



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
#6 lore raw

At Thu, 5 Sep 2002 11:29:02 -0400 (EDT),

Quoted 11 lines · Pavel Roskin

Hello!

Quoted 4 lines
Quoted 2 lines

Unfortunately, the
sound is still helicopter-like, but it's another problem.

which application?

timidity and xmms. I hear short loud periodic sounds. Setting lower sampling rate in timidity causes longer delays between the pulses.

Quoted 6 lines

Linux-2.4.20-pre5, Red Hat 7.3, timidity++-2.11.3-1.

The emu10k1 ALSA driver has been working fine on the same machine. The VIA audio is integrated. The via686 driver worked with the internal audio before I installed SB Live, which must have been some time in March of this year.

hmm, this recalls some posts on l-k ml in the last year. it might be a hardware problem, namely, VIA motherboards. is your motherboard KT266A?

Quoted 9 lines

Looking at the log of alsa-kernel/pci/via686.c, following entry looks "promising":

----------------------------
revision 1.24
date: 2002/08/13 16:29:18; author: perex; state: Exp; lines: +13 -9 AC97 cold reset only when AC-link is down
----------------------------

this should be irrelevant. it changed the code around ac97 codec reset. if it fails, you'll hear nothing.

Takashi

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

#7 lore raw
Quoted 8 lines
Quoted 4 lines

The emu10k1 ALSA driver has been working fine on the same machine. The VIA audio is integrated. The via686 driver worked with the internal audio before I installed SB Live, which must have been some time in March of this year.

hmm, this recalls some posts on l-k ml in the last year. it might be a hardware problem, namely, VIA motherboards. is your motherboard KT266A?

No, it's KT-133.

Quoted 2 lines

this should be irrelevant. it changed the code around ac97 codec reset. if it fails, you'll hear nothing.

Ok, there are not many revisions of the driver, so I hope to locate the breakage quite fast.

Signature · 9 lines
Regards,
Pavel Roskin



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
#8 lore raw

At Thu, 5 Sep 2002 11:49:29 -0400 (EDT),

Quoted 11 lines · Pavel Roskin
Quoted 9 lines
Quoted 5 lines

The emu10k1 ALSA driver has been working fine on the same machine. The VIA audio is integrated. The via686 driver worked with the internal audio before I installed SB Live, which must have been some time in March of this year.

hmm, this recalls some posts on l-k ml in the last year. it might be a hardware problem, namely, VIA motherboards. is your motherboard KT266A?

No, it's KT-133.

does this info help?

http://www.networking.tzo.com/net/software/readmes/techvl019d.htm

Takashi

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

#9 lore raw

Hello!

Quoted 9 lines
Quoted 5 lines
Quoted 3 lines

hmm, this recalls some posts on l-k ml in the last year. it might be a hardware problem, namely, VIA motherboards. is your motherboard KT266A?

No, it's KT-133.

does this info help?

http://www.networking.tzo.com/net/software/readmes/techvl019d.htm

It's a Windows driver that changes some registers of the chipset. It also reloads those registers after the sleep, so they are not saved in the hardware, so there is no way this driver can affect ALSA drivers under Linux kernel. The Linux kernel 2.4.20-pre5 that I'm using has some VIA-specific code, which does something similar to that Windows driver. Anyway, all this is most likely irrelevant.

Binary search shows that the driver from "2002/07/19 17:00 UTC" is fine, but 15 minutes later, at "2002/07/19 17:15 UTC", the driver is already broken.

The diff between those time pints is fairly large, since "Scatter-Gather PCM access" was introduced in between:

revision 1.20
date: 2002/07/19 17:10:53; author: tiwai; state: Exp; lines: +157 -206 added the support of sg buffer pcm

However, I can take the old (17:00) via686 driver and compile it with the new (17:15) source tree, and everything is fine. My interpretation is that it's not the introduction of Scatter-Gather PCM access that broke the driver. It's porting of the via686 driver to Scatter-Gather that caused the problem.

The "helicopter sound" can be reproduced with the "play" test from the oss-test suite. The sound is different if I run the test more than once.

It's interesting that the problem seems to mostly affect some programs but not the others. That's what I tested with the new, broken driver:

timidity -Oe ode2joy.mid                           Bad
timidity -Od -o /dev/dsp ode2joy.mid               Ok
timidity -Ou -o /dev/audio ode2joy.mid             Ok
mpg321 -o esd bwv538.mp3                           Bad
mpg321 -o oss bwv538.mp3                           Ok
mpg321 -o alsa bwv538.mp3                          Ok
aplay cow.wav                                      Bad
sox cow.wav -t ossdsp /dev/dsp                     Ok
cat cow.au >/dev/audio                             Ok
xmms bwv538.mp3  (OSS driver)                      Bad
xmms bwv538.mp3  (eSound driver)                   Bad
timidity -Ou -o - ode2joy.mid | aplay -            Bad
timidity -Ow -o - ode2joy.mid | aplay -            Ok
Signature · 9 lines
Regards,
Pavel Roskin



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
#10 lore raw

At Fri, 6 Sep 2002 03:08:40 -0400 (EDT),

Quoted 14 lines · Pavel Roskin

The diff between those time pints is fairly large, since "Scatter-Gather PCM access" was introduced in between:

revision 1.20
date: 2002/07/19 17:10:53; author: tiwai; state: Exp; lines: +157 -206 added the support of sg buffer pcm

However, I can take the old (17:00) via686 driver and compile it with the new (17:15) source tree, and everything is fine. My interpretation is that it's not the introduction of Scatter-Gather PCM access that broke the driver. It's porting of the via686 driver to Scatter-Gather that caused the problem.

Quoted 6 lines

The "helicopter sound" can be reproduced with the "play" test from the oss-test suite. The sound is different if I run the test more than once.

It's interesting that the problem seems to mostly affect some programs but not the others. That's what I tested with the new, broken driver:

i think esd tries to set too small fragment size. anyway, could you check the output of /proc/asound/card0/pcm0p/sub0/hw_params for each bad case?

Quoted 5 lines
timidity -Oe ode2joy.mid                           Bad
timidity -Od -o /dev/dsp ode2joy.mid               Ok
timidity -Ou -o /dev/audio ode2joy.mid             Ok
mpg321 -o esd bwv538.mp3                           Bad
mpg321 -o oss bwv538.mp3                           Ok
Quoted 8 lines
mpg321 -o alsa bwv538.mp3                          Ok
aplay cow.wav                                      Bad
sox cow.wav -t ossdsp /dev/dsp                     Ok
cat cow.au >/dev/audio                             Ok
xmms bwv538.mp3  (OSS driver)                      Bad
xmms bwv538.mp3  (eSound driver)                   Bad
timidity -Ou -o - ode2joy.mid | aplay -            Bad
timidity -Ow -o - ode2joy.mid | aplay -            Ok

thanks,

Takashi

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

#11 lore raw

Hello!

Quoted 3 lines

i think esd tries to set too small fragment size. anyway, could you check the output of /proc/asound/card0/pcm0p/sub0/hw_params for each bad case?

Yes, it looks like that. If the sound is bad, period_size is 1024 or less. If the sound is good, period_size is 2048 or more.

Quoted 1 line
Quoted 1 line

timidity -Ou -o - ode2joy.mid | aplay - Bad

That's the simplest case because it doesn't involve OSS emulation. -Ou means using Sun AU format. The default sampling rate is 8k. The sound becomes good when the sampling rate is more than 12k. Now let's look at this:

timidity -Ou -o - -s 12k ode2joy.mid | aplay -
bad sound
/proc/asound/card0/pcm0p/sub0/hw_params:

access: MMAP_INTERLEAVED
format: S16_LE
subformat: STD
channels: 1
rate: 12000 (12000/1)
period_size: 1024
buffer_size: 6000
tick_time: 10000

timidity -Ou -o - -s 12.5k ode2joy.mid | aplay -
good sound
/proc/asound/card0/pcm0p/sub0/hw_params:

access: MMAP_INTERLEAVED
format: S16_LE
subformat: STD
channels: 1
rate: 12500 (12500/1)
period_size: 2048
buffer_size: 6250
tick_time: 10000

buffer_size changed insignificantly. period_size jumped from 1024 to 2048. There are no other changes.

Signature · 9 lines
Regards,
Pavel Roskin



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
#12 lore raw

At Fri, 6 Sep 2002 10:03:07 -0400 (EDT),

Quoted 9 lines · Pavel Roskin

Hello!

Quoted 3 lines

i think esd tries to set too small fragment size. anyway, could you check the output of /proc/asound/card0/pcm0p/sub0/hw_params for each bad case?

Yes, it looks like that. If the sound is bad, period_size is 1024 or less. If the sound is good, period_size is 2048 or more.

ok, then please modify ".period_bytes_min = 32" to 2048 (in two positions in via82xx.c).

but 2048 seems too big. possibly there is a hardware latency problem on via chipset?

Takashi

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390