softvol plugin [Fwd: Re: [Alsa-devel] [PATCH V0.1] C-Media CMI9761 -A- type]
Sorry for cross posting, I am replying to 2 different threads 1 is alsa- user and other in alsa-devel!
Please cc to me!
Like Jakob Schurdak, I reinstall alsa from CVS (alsa-driver, alsa-lib, alsa-utils), that already have Takashi patch, but the mixer still have exactly the same behavior.
I have one ASRock P4VT8+ with CMedia CMI9761 (not the same of Jakob) but
same rev. of sound card.
00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller (rev 60)
Applying this patch from Thomas Schorpp, I have a better mixer and don't have mute nothing as before, I just unmute PCM and have sound, Master volume appears but don't have any effect when mute or unmute or change volume.
For me, try to set up a PCM config manually on my own ~/.asoundrc , doesn't change noting ( unless when I forget close "}") :)
thanks and regards,
-------- Forwarded Message --------
Quoted 58 lines
From: thomas schorpp <[email protected]>
Reply-To: [email protected]
To: alsa-devel <[email protected]>
Subject: Re: [Alsa-devel] [PATCH V0.1] C-Media CMI9761 -A- type
Date: Thu, 17 Feb 2005 05:10:08 +0100
created a patch with branch -A- type support by Mainboard for the start.like youve done it before for a mainboard in the code.
and now i want a pcm slider. lets see...
hello,
Sergio Monteiro Basto wrote:
| Hi, | | After search on https://bugtrack.alsa-project.org/ for CMI9761, 1 | issues, resolved ! | with some similarity is one ASRock k7vt4a+ with CMedia CMI9761, I have | one ASRock P4VT8+ with CMedia CMI9761.ive got the follower CMI9761A.
got ascreenshot from cmedia windosdriver app, for "unbeliefers" ;)
| | After play around with alsamixer, | I got sound when unmute PCM and Off (mute) IEC958 Capture Monitor. | | All others controls does change anything include mute or unmute the | Master. | Except VIA DXS (this one can do sound balance, left and right). | VIA DXS 1, VIA DXS 2 and VIA DXS 3 also doesn't do nothing. | | Play around with | options snd-via82xx dxs_support | on file /etc/modprobe.conf | only with "options snd-via82xx dxs_support=2" I see any difference but | for worst, make disappear VIA DXS, VIA DXS 1, VIA DXS 2 and VIA DXS 3 | controls. | | So, can help you testing alsa CVS ? | Now I have to sleep and tomorrow, I am a little busy but, have you some | patch in specific to test this C-MEDIA sound card ? | | Sorry for my weak English, if you don't understand something just ask | me, that I will try explain again. | | thanks, |all verified yet yesterday, negative
thx
tom
Signature · 1 line
Sérgio M.B.
Index: ac97_patch.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/ac97/ac97_patch.c,v retrieving revision 1.74
ac97_patch.c +33 -2
@@ -2035,7 +2035,11 @@int patch_cm9761 (ac97_t *ac97) {unsigned short val; - + +/* CM9761A only on this Mainboard Series for now, due to diverting infos(?) */ +if ( !ac97->pci && ac97->subsystem_vendor !=0x1849 && ac97->subsystem_device !=0x9761 ) + { +/* CM9761 has no Master and PCM volume although the register reacts */ ac97->flags |=AC97_HAS_NO_MASTER_VOL |AC97_HAS_NO_PCM_VOL ;snd_ac97_write_cache (ac97,AC97_MASTER ,0x8000 );
@@ -2085,6 +2089,31 @@ else val =0x321c ;#endif + +/* FIXME: set up GPIO */ +snd_ac97_write_cache (ac97,0x70 ,0x0100 ); +snd_ac97_write_cache (ac97,0x72 ,0x0020 ); + + } +else + { + +/* CM9761A */ + +unsigned short val; + + ac97->build_ops = &patch_cm9761_ops; + +#if 0 +/* enable spdif */ +/* force the SPDIF bit in ext_id - codec doesn't set this bit! */ + ac97->ext_id |=AC97_EI_SPDIF ; +/* to be sure: we overwrite the ext status bits */ +snd_ac97_write_cache (ac97,AC97_EXTENDED_STATUS ,0x05c0 ); +snd_ac97_write_cache (ac97,AC97_CM9761_SPDIF_CTRL ,0x0209 ); + ac97->rates[AC97_RATES_SPDIF ] =SNDRV_PCM_RATE_48000 ;/* 48k only */ +#endif +/* set-up multi channel */ val =snd_ac97_read (ac97,AC97_CM9761_MULTI_CHAN ); val |= (1 <<4 );snd_ac97_write_cache (ac97,AC97_CM9761_MULTI_CHAN , val);
@@ -2092,10 +2121,12 @@/* FIXME: set up GPIO */ snd_ac97_write_cache (ac97,0x70 ,0x0100 );snd_ac97_write_cache (ac97,0x72 ,0x0020 ); - + } +return 0 ; } +/* * VIA VT1616 codec
Re: softvol plugin [Fwd: Re: [PATCH V0.1] C-Media CMI9761A ]
uh-oh :)
i code with too much drink and the users like it, great! :]]
... sergio, this patch is crap, pls pull cvs with attached revisions and tell if your master vol works then.
my does. and so balance.
THEN update to head and apply both patches attached further below from takashi and report (especially if you get pcm sound after unmute of "iec capture" switch.)
y
tom
Quoted 18 lines · Sergio Monteiro Basto
Sorry for cross posting, I am replying to 2 different threads 1 is alsa- user and other in alsa-devel!
Please cc to me!
Like Jakob Schurdak, I reinstall alsa from CVS (alsa-driver, alsa-lib, alsa-utils), that already have Takashi patch, but the mixer still have exactly the same behavior.
I have one ASRock P4VT8+ with CMedia CMI9761 (not the same of Jakob) but
same rev. of sound card.
00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller (rev 60)Applying this patch from Thomas Schorpp, I have a better mixer and don't have mute nothing as before, I just unmute PCM and have sound, Master volume appears but don't have any effect when mute or unmute or change volume.
Quoted 5 lines
For me, try to set up a PCM config manually on my own ~/.asoundrc , doesn't change noting ( unless when I forget close "}") :)
thanks and regards,
Index: ac97_codec.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/ac97/ac97_codec.c,v retrieving revision 1.170
retrieving revision 1.171
ac97_codec.c +2 -1
@@ -120,7 +120,8 @@ { 0x434d4961, 0xffffffff, "CMI9739", patch_cm9739, NULL }, { 0x434d4978, 0xffffffff, "CMI9761", patch_cm9761, NULL }, { 0x434d4982, 0xffffffff, "CMI9761", patch_cm9761, NULL }, -{ 0x434d4983, 0xffffffff, "CMI9761", patch_cm9761, NULL }, +/* { 0x434d4983, 0xffffffff, "CMI9761", patch_cm9761, NULL }, */ +{ 0x434d4983, 0xffffffff, "CMI9761A", patch_cm9761a, NULL }, { 0x43525900, 0xfffffff8, "CS4297", NULL, NULL }, { 0x43525910, 0xfffffff8, "CS4297A", patch_cirrus_spdif, NULL }, { 0x43525920, 0xfffffff8, "CS4298", patch_cirrus_spdif, NULL },
Index: ac97_patch.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/ac97/ac97_patch.c,v retrieving revision 1.72
retrieving revision 1.73
ac97_patch.c +28 -0
@@ -2094,6 +2094,34 @@return 0 ; } +/* CM9761-A is incompatible with CM9761 */ +int patch_cm9761a (ac97_t *ac97) +{ +unsigned short val; + + ac97->build_ops = &patch_cm9761_ops; + +#if 0 +/* enable spdif */ +/* force the SPDIF bit in ext_id - codec doesn't set this bit! */ + ac97->ext_id |=AC97_EI_SPDIF ; +/* to be sure: we overwrite the ext status bits */ +snd_ac97_write_cache (ac97,AC97_EXTENDED_STATUS ,0x05c0 ); +snd_ac97_write_cache (ac97,AC97_CM9761_SPDIF_CTRL ,0x0209 ); + ac97->rates[AC97_RATES_SPDIF ] =SNDRV_PCM_RATE_48000 ;/* 48k only */ +#endif +/* set-up multi channel */ + val =snd_ac97_read (ac97,AC97_CM9761_MULTI_CHAN ); + val |= (1 <<4 ); +snd_ac97_write_cache (ac97,AC97_CM9761_MULTI_CHAN , val); + +/* FIXME: set up GPIO */ +snd_ac97_write_cache (ac97,0x70 ,0x0100 ); +snd_ac97_write_cache (ac97,0x72 ,0x0020 ); + +return 0 ; +} +/* * VIA VT1616 codec
Index: ac97_patch.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/ac97/ac97_patch.h,v retrieving revision 1.17
retrieving revision 1.18
ac97_patch.h +1 -0
@@ -53,6 +53,7 @@int patch_cm9738 (ac97_t * ac97);int patch_cm9739 (ac97_t * ac97);int patch_cm9761 (ac97_t * ac97); +int patch_cm9761a (ac97_t * ac97);int patch_vt1616 (ac97_t * ac97);int patch_it2646 (ac97_t * ac97);int mpatch_si3036 (ac97_t * ac97);
AFTER TESTING THEN UPDATE TO HEAD AND APPLY: ATT 2 PATCHES
pci/ac97/ac97_patch.c +2 -2
@@ -2038,8 +2038,8 @@/* CM9761 has no Master and PCM volume although the register reacts */ ac97->flags |=AC97_HAS_NO_MASTER_VOL |AC97_HAS_NO_PCM_VOL ; -snd_ac97_write_cache (ac97,AC97_MASTER ,0x8000 ); -snd_ac97_write_cache (ac97,AC97_PCM ,0x8000 ); +snd_ac97_write_cache (ac97,AC97_MASTER ,0x8808 ); +snd_ac97_write_cache (ac97,AC97_PCM ,0x8808 ); ac97->spec.dev_flags =0 ;/* 1 = model 82 revision B */ if (ac97->id ==AC97_ID_CM9761_82 ) {
pci/via82xx.c +18 -15
@@ -367,7 +367,7 @@unsigned int mpu_port_saved;#endif -unsigned char playback_volume[4 ][2 ];/* for VIA8233/C/8235; default = 0 */ +unsigned char playback_volume[2 ];/* for VIA8233/C/8235; default = 0 */ unsigned int intr_mask;/* SGD_SHADOW mask to check interrupts */
@@ -942,8 +942,8 @@snd_assert ((rbits & ~0xfffff ) ==0 , return -EINVAL );snd_via82xx_channel_reset (chip, viadev);snd_via82xx_set_table_ptr (chip, viadev); -outb (chip->playback_volume[viadev->reg_offset /0x10 ][0 ],VIADEV_REG (viadev,OFS_PLAYBACK_VOLUME_L )); -outb (chip->playback_volume[viadev->reg_offset /0x10 ][1 ],VIADEV_REG (viadev,OFS_PLAYBACK_VOLUME_R )); +outb (chip->playback_volume[0 ],VIADEV_REG (viadev,OFS_PLAYBACK_VOLUME_L )); +outb (chip->playback_volume[1 ],VIADEV_REG (viadev,OFS_PLAYBACK_VOLUME_R )); outl((runtime->format == SNDRV_PCM_FORMAT_S16_LE ? VIA8233_REG_TYPE_16BIT : 0) | /* format */ (runtime->channels > 1 ? VIA8233_REG_TYPE_STEREO : 0) | /* stereo */ rbits | /* rate */
@@ -1497,29 +1497,33 @@static int snd_via8233_dxs_volume_get (snd_kcontrol_t *kcontrol,snd_ctl_elem_value_t *ucontrol) {via82xx_t *chip =snd_kcontrol_chip (kcontrol); -unsigned int idx =snd_ctl_get_ioff (kcontrol, &ucontrol->id); - ucontrol->value.integer.value[0 ] =VIA_DXS_MAX_VOLUME - chip->playback_volume[idx][0 ]; - ucontrol->value.integer.value[1 ] =VIA_DXS_MAX_VOLUME - chip->playback_volume[idx][1 ]; + ucontrol->value.integer.value[0 ] =VIA_DXS_MAX_VOLUME - chip->playback_volume[0 ]; + ucontrol->value.integer.value[1 ] =VIA_DXS_MAX_VOLUME - chip->playback_volume[1 ];return 0 ; }static int snd_via8233_dxs_volume_put (snd_kcontrol_t *kcontrol,snd_ctl_elem_value_t *ucontrol) {via82xx_t *chip =snd_kcontrol_chip (kcontrol); -unsigned int idx =snd_ctl_get_ioff (kcontrol, &ucontrol->id); -unsigned long port = chip->port +0x10 * idx; +unsigned long port;unsigned char val; -int i, change =0 ; +int i, idx, change =0 ;for (i =0 ; i <2 ; i++) { val = ucontrol->value.integer.value[i];if (val >VIA_DXS_MAX_VOLUME ) val =VIA_DXS_MAX_VOLUME ; val =VIA_DXS_MAX_VOLUME - val; - change |= val != chip->playback_volume[idx][i]; -if (change) { - chip->playback_volume[idx][i] = val; -outb (val, port +VIA_REG_OFS_PLAYBACK_VOLUME_L + i); + change |= val != chip->playback_volume[i]; + chip->playback_volume[i] = val; + } +if (change) { +for (idx =0 ; idx < idx; idx++) { +for (i =0 ; i <2 ; i++) { + port = chip->port +0x10 * idx + +VIA_REG_OFS_PLAYBACK_VOLUME_L + i; +outb (chip->playback_volume[i], port); + } } }return change;
@@ -1528,7 +1532,6 @@static snd_kcontrol_new_t snd_via8233_dxs_volume_control__devinitdata = { .name ="VIA DXS Playback Volume" , .iface =SNDRV_CTL_ELEM_IFACE_MIXER , - .count =4 , .info = snd_via8233_dxs_volume_info, .get = snd_via8233_dxs_volume_get, .put = snd_via8233_dxs_volume_put,
@@ -1942,7 +1945,7 @@for (idx =0 ; idx <4 ; idx++) {unsigned long port = chip->port +0x10 * idx;for (i =0 ; i <2 ; i++) -outb (chip->playback_volume[idx][i], port +VIA_REG_OFS_PLAYBACK_VOLUME_L + i); +outb (chip->playback_volume[i], port +VIA_REG_OFS_PLAYBACK_VOLUME_L + i); } }
Re: C-Media CMI9761A REV
In reply to Sergio Monteiro BastoQuoted 3 lines · Sergio Monteiro Basto
I have one ASRock P4VT8+ with CMedia CMI9761 (not the same of Jakob) but
same rev. of sound card.
00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller (rev 60)
BTW, THATS NOT THE CODEC, only a interface.
this is it:
lspci -v
0000:00:11.5 Multimedia audio controller: VIA Technologies, Inc.
VT8233/A/8235/8237 AC97 Audio Controller (rev 50)
Subsystem: Unknown device 1849:9761 <--------------------
tom
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
Re: C-Media CMI9761A REV
Hello,
Alsa-webmaster please read the end of message and improve your
http://www.alsa-project.org/download.php page !
Well mine is:
lspci -v
00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller (rev 60)
Subsystem: ASRock Incorporation: Unknown device 9739
lspci -n
00:11.5 Class 0401: 1106:3059 (rev 60)
I finished to test last sources of the CVS, I back to first state, no improves, no master again.
For Jakob and alsa-webmaster, a little fast How to compile alsa from CVS:
yum -y install gettext-devel.i386 ( you will need this for cvscompile alsa-utils and you will need autotools )
service alsasound stop (or rmmod all snd-*)
cvs -d:pserver:[email protected]:/cvsroot/alsa login (enter)
cvs -z3 -q -d:pserver:[email protected]:/cvsroot/alsa co alsa-driver cvs -z3 -q -d:pserver:[email protected]:/cvsroot/alsa co alsa-kernel cvs -z3 -q -d:pserver:[email protected]:/cvsroot/alsa co alsa-lib cvs -z3 -q -d:pserver:[email protected]:/cvsroot/alsa co alsa-utils cd alsa-driver
cvscompile (stop when enter in configure, because will compile drives for all cards and we just need for our via82xx)
./configure --with-cards=dummy,via82xx --with-sequencer=yes --with-isapnp=no make
make install
modprobe snd-via82xx
cd ../alsa-lib
cvscompile && make install && ldconfig
cd ../alsa-utils
cvscompile && make install
regards,
Quoted 18 lines · thomas schorpp
Quoted 3 lines · Sergio Monteiro Basto
I have one ASRock P4VT8+ with CMedia CMI9761 (not the same of Jakob) but
same rev. of sound card.
00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller (rev 60)BTW, THATS NOT THE CODEC, only a interface.
this is it:
lspci -v
0000:00:11.5 Multimedia audio controller: VIA Technologies, Inc.
VT8233/A/8235/8237 AC97 Audio Controller (rev 50)Subsystem: Unknown device 1849:9761 <--------------------tom
Signature · 9 lines
Sérgio M.B. ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
Re: Re: C-Media testing
Quoted 9 lines · Sergio Monteiro Basto
Hello,
Alsa-webmaster please read the end of message and improve your
http://www.alsa-project.org/download.php page !Well mine is:
lspci -v
00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller (rev 60)
Subsystem: ASRock Incorporation: Unknown device 9739
thats the CMI9739.
http://www.cmedia.com.tw/product/CMI9739.htm
Quoted 3 lines
I finished to test last sources of the CVS, I back to first state, no improves, no master again.
thx.
Quoted 6 lines
For Jakob and alsa-webmaster, a little fast How to compile alsa from CVS:
yum -y install gettext-devel.i386 ( you will need this for cvscompile alsa-utils and you will need autotools )
Quoted 8 lines
service alsasound stop (or rmmod all snd-*)
cvs -d:pserver:[email protected]:/cvsroot/alsa login (enter)
cvs -z3 -q -d:pserver:[email protected]:/cvsroot/alsa co alsa-driver cvs -z3 -q -d:pserver:[email protected]:/cvsroot/alsa co alsa-kernel cvs -z3 -q -d:pserver:[email protected]:/cvsroot/alsa co alsa-lib cvs -z3 -q -d:pserver:[email protected]:/cvsroot/alsa co alsa-utils
i prefer using the kde cervisia frontend in konqueror, you get a better overview of versions and logs then. its fine.
Quoted 3 lines
cd alsa-driver
cvscompile (stop when enter in configure, because will compile drives for all cards and we just need for our via82xx)
i use only this:
./configure --with-cards=via82xx
Quoted 1 line
make
su
Quoted 2 lines
make install
modprobe snd-via82xx
exit
heres a script for testing automation (edit for your needs):
att.
Quoted 5 lines
cd ../alsa-lib
cvscompile && make install && ldconfig
cd ../alsa-utils
cvscompile && make install
? i dont use the userspace from cvs, only the debian 1.08 distri packages.
tom
Quoted 3 lines
regards,
Re: softvol plugin [Fwd: Re: [Alsa-devel] [PATCH V0.1] C-Media CMI9761A ]
In reply to thomas schorppHello
the patch give a compile error see above :
thanks,
Quoted 14 lines · thomas schorpp
uh-oh :)
THEN update to head and apply both patches attached further below from takashi and report (especially if you get pcm sound after unmute of "iec capture" switch.)
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/ac97/ac97_patch.c,v retrieving revision 1.72
retrieving revision 1.73
diff -u -r1.72 -r1.73
ac97_patch.c line 2102
Quoted 9 lines
ac97_patch.c +6
-0@@ -2094,6 +2094,34 @@return 0 ; } +/* CM9761-A is incompatible with CM9761 */ +int patch_cm9761a (ac97_t *ac97) +{ +unsigned short val; + + ac97->build_ops = &patch_cm9761_ops;
patch_cm9761_ops is not defined in any place , compiler give an error undeclare and use for the first time ....
Signature · 9 lines
Sérgio M.B. ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click