From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: Re: [alsa-cvslog] CVS: BEFORE REVERT [SUCCESS] C-Media CMI9761 -A- type, WORKING MASTER, PCM ON 1. DXS SLIDER! Date: Thu, 17 Feb 2005 20:28:22 +0100 Message-ID: References: <4213BB44.5060702@gmx.de> <4214DD40.3070102@gmx.de> <4214ECAC.8040003@gmx.de> Mime-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: multipart/mixed; boundary="Multipart_Thu_Feb_17_20:28:22_2005-1" In-Reply-To: <4214ECAC.8040003@gmx.de> Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: t.schorpp@gmx.de Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org --Multipart_Thu_Feb_17_20:28:22_2005-1 Content-Type: text/plain; charset=US-ASCII At Thu, 17 Feb 2005 20:12:44 +0100, thomas schorpp wrote: > > > And the Master volume does NOT affect the PCM playback volume? > > does not on any version. just playing a clip with xmms (oss-iface) > volume regulation only with dxs 2 slider. verified. OK, that's good to know. > >>- no output on pcm dac audio (tried workarounds for hours) > > > > > > Err, with 2.6.10, you got no PCM playback output? > > no output, verified with arts and xmms and xine, aplay warns about rate > setting, ecasound with no complain messages. Then which version was the "working" version you mentioned in the original post at all? > >>patch.c cvs rev 1.73 et al: > >>- master vol slider drives real volume for looped through lines. no > >>affect on pcm. > > > > > > So, it has no influence on PCM... Interesting. > > Possibly there is a mysterious register bit switch to turn this on/off > > :) (For example, STAC9750/51 controls the PCM-bypass mode by misusing > > GENERAL_PURPOSE register bit 15.) > > agree. due to hardware like clicking sound on enable/disable the slider, > there should be hardware, good. > > but how to find register and affecting bitsetting? At best from the datasheet. Otherwise, trial-and-error. > >>-alsa pcm volume working on dxs 1 slider. > >>-oss pcm volume working on dxs 2 slider. > > > > > > The assignment of DXS channels are quite casual. > > not understood, got too few background on that. VIA823x has 4 DXS channels for multi-playback (aka hardware mixing). ALSA assigns each channel at each open of PCM stream. Thus, which DXS channel is assigned is simply depending on the order of concurrent opens. That is, DXS = 2 means that another stream still occupies the first PCM stream. > >>btw: you got my 2 mails from tonight? windos driver reports rev 8D for > >>this chip. > > > > > > Hmm? I see a string "REV_50" in the screenshot. > > no. thats the vias rev: > > 0000:00:11.5 Multimedia audio controller: VIA Technologies, Inc. > VT8233/A/8235/8237 AC97 Audio Controller (rev 50) > Subsystem: Unknown device 1849:9761 Yes, that's my expectation, too. Where can I find the string with 8d? > >>pls answer this question: what are those 32bit xxxxxxxx_rev ids? > > > > > > Which value do you mean? > > that: > > #define AC97_ID_AK4540 0x414b4d00 <--- source? chip asked? It's ac97->id, VENDOR_ID1<<16 | VENDOR_ID2 regs as below. > > > > If it's ac97->id, this is just the combination of vendor_id1 (7c) and > > vondor_id2 (7e) registers as (vendor_id1<<16) | (device_id2). > > AFAIK, CM9761 has three different models and each of > > them has different vendor ID2 value: 0x4978, 0x4982 and 0x4983. > > Yours looks like the last one. > > i assume it should be 0x498d for mine then (windos driver screenshot). No. IIRC, the register reads 0x4983. You should check /proc/asound/card0/codec97#0/ac97#0-0+regs. That's why I wonder the value 0x8d. No idea from where it comes in Windows. Well, it's fine to take Master volume back for this model (0x83), if the volume does really something as you described. The PCM volume won't appear anyway because it doesn't work. But, before changing this, please check whether my last patch works. If this is OK, I can fix the above together. Meanwhile, having separated DXS volumes seems inconvenient. The patch below replaces 4 DXS controls to a single bound one. Please give a try. Maybe it would be not bad to rename this control to "PCM" automatically when no PCM volume control exists... Takashi --Multipart_Thu_Feb_17_20:28:22_2005-1 Content-Type: text/plain; charset=US-ASCII Index: alsa-kernel/pci/via82xx.c =================================================================== RCS file: /suse/tiwai/cvs/alsa/alsa-kernel/pci/via82xx.c,v retrieving revision 1.147 diff -u -r1.147 via82xx.c --- alsa-kernel/pci/via82xx.c 28 Jan 2005 19:27:36 -0000 1.147 +++ alsa-kernel/pci/via82xx.c 17 Feb 2005 11:03:53 -0000 @@ -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); } } --Multipart_Thu_Feb_17_20:28:22_2005-1-- ------------------------------------------------------- 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