[alsa-devel] Still unhappy with removal of DXS controls
[Sorry if this is a duplicate -- I was too stupid to subscribe the first time and my mail hasn't been moderated yet, apparently.]
Me again...
Referring to the issue I described on 2010-03-28 [http://www.spinics.net/lists/alsa-devel/msg32731.html], the situation hasn't changed since then.
In short, I *really* need to lower the DXS volumes in order to play sound properly. If I don't do it, I get massive distortion.
It's not a matter of the output stage, but of the input stage. Lowering PCM or Master doesn't help anything, but using softvol in mplayer does (I need to get down to 20%, so I effectively hear 14-bit audio, nice...).
Back in March, Clemens told me to use hwmixvolume. It's nice, I can now access what I could previously access in alsamixer. But when I close the audio stream and start a new one, the volume is reset to 100% -- blowing my ears with loud and distorted sound.
So my solution for now is: stick with Linux 2.6.30...
Please, even if the solution with the DXS controls in alsamixer didn't comply with the ALSA policies, *it did work*! The current one *does not*. Maybe make the maximum (or default?) DXS volume available as a mixer control or as a module option or something -- whatever you consider the best solution. But the current state is just not acceptable.
Thanks
Sören
2010/7/6 Soeren D. Schulze soeren.d.schulze@gmx.de
[Sorry if this is a duplicate -- I was too stupid to subscribe the first time and my mail hasn't been moderated yet, apparently.]
Me again...
Referring to the issue I described on 2010-03-28 [http://www.spinics.net/lists/alsa-devel/msg32731.html], the situation hasn't changed since then.
In short, I *really* need to lower the DXS volumes in order to play sound properly. If I don't do it, I get massive distortion.
It's not a matter of the output stage, but of the input stage. Lowering PCM or Master doesn't help anything, but using softvol in mplayer does (I need to get down to 20%, so I effectively hear 14-bit audio, nice...).
In theory , DSP can also provide gain in addition to atten, so the maximum volume may not be 0dB. you may need to calibrate the dB scale of this control and set the default value to 0dB to prevent distortion due to clipping.
I don't think mplayer know how to change these IFACE_PCM volume control since only less than 10 sound cards support this hardware feature and only three drivers have implemented this control
Sören
Soeren D. Schulze wrote:
Please, even if the solution with the DXS controls in alsamixer didn't comply with the ALSA policies, *it did work*! The current one *does not*. Maybe make the maximum (or default?) DXS volume available as a mixer control or as a module option or something -- whatever you consider the best solution.
Please try this patch:
--- a/sound/pci/via82xx.c +++ b/sound/pci/via82xx.c @@ -85,6 +85,7 @@ static int joystick; static int ac97_clock = 48000; static char *ac97_quirk; static int dxs_support; +static int dxs_init_volume = 31; static int nodelay;
module_param(index, int, 0444); @@ -103,6 +104,8 @@ module_param(ac97_quirk, charp, 0444); MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware."); module_param(dxs_support, int, 0444); MODULE_PARM_DESC(dxs_support, "Support for DXS channels (0 = auto, 1 = enable, 2 = disable, 3 = 48k only, 4 = no VRA, 5 = enable any sample rate)"); +module_param(dxs_init_volume, int, 0644); +MODULE_PARM_DESC(dxs_init_volume, "initial DXS volume (0-31)"); module_param(nodelay, int, 0444); MODULE_PARM_DESC(nodelay, "Disable 500ms init delay");
@@ -1245,8 +1248,10 @@ static int snd_via8233_playback_open(struct snd_pcm_substream *substream) return err; stream = viadev->reg_offset / 0x10; if (chip->dxs_controls[stream]) { - chip->playback_volume[stream][0] = 0; + chip->playback_volume[stream][0] = + VIA_DXS_MAX_VOLUME - (dxs_init_volume & 31); - chip->playback_volume[stream][1] = 0; + chip->playback_volume[stream][1] = + VIA_DXS_MAX_VOLUME - (dxs_init_volume & 31); chip->dxs_controls[stream]->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE; snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE |
On 06.07.2010 12:37, Clemens Ladisch wrote:
Soeren D. Schulze wrote:
Please, even if the solution with the DXS controls in alsamixer didn't comply with the ALSA policies, *it did work*! The current one *does not*. Maybe make the maximum (or default?) DXS volume available as a mixer control or as a module option or something -- whatever you consider the best solution.
Please try this patch:
--- a/sound/pci/via82xx.c +++ b/sound/pci/via82xx.c @@ -85,6 +85,7 @@ static int joystick; static int ac97_clock = 48000; static char *ac97_quirk; static int dxs_support; +static int dxs_init_volume = 31; static int nodelay;
module_param(index, int, 0444); @@ -103,6 +104,8 @@ module_param(ac97_quirk, charp, 0444); MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware."); module_param(dxs_support, int, 0444); MODULE_PARM_DESC(dxs_support, "Support for DXS channels (0 = auto, 1 = enable, 2 = disable, 3 = 48k only, 4 = no VRA, 5 = enable any sample rate)"); +module_param(dxs_init_volume, int, 0644); +MODULE_PARM_DESC(dxs_init_volume, "initial DXS volume (0-31)"); module_param(nodelay, int, 0444); MODULE_PARM_DESC(nodelay, "Disable 500ms init delay");
@@ -1245,8 +1248,10 @@ static int snd_via8233_playback_open(struct snd_pcm_substream *substream) return err; stream = viadev->reg_offset / 0x10; if (chip->dxs_controls[stream]) {
chip->playback_volume[stream][0] = 0;
chip->playback_volume[stream][0] =
VIA_DXS_MAX_VOLUME - (dxs_init_volume & 31);
chip->playback_volume[stream][1] = 0;
chip->playback_volume[stream][1] =
chip->dxs_controls[stream]->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE; snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE |VIA_DXS_MAX_VOLUME - (dxs_init_volume & 31);
Thanks a lot, it works just fine.
A short test (using only the ears) shows that 24 might be a good value, perhaps even a bit lower.
Is there a chance to get this upstream so I can update the wiki?
Sören
Soeren D. Schulze wrote:
Is there a chance to get this upstream?
Yes; would you be OK with this tag? Tested-by: Soeren D. Schulze soeren.d.schulze@gmx.de
Regards, Clemens
On 07.07.2010 15:01, Clemens Ladisch wrote:
Soeren D. Schulze wrote:
Is there a chance to get this upstream?
Yes; would you be OK with this tag? Tested-by: Soeren D. Schulze soeren.d.schulze@gmx.de
Yes; I didn't test it that extensively, but it seems to fix the problem.
BTW, the value 24 is still too high if several streams are played at the same time.
Sören
2010/7/7 Soeren D. Schulze soeren.d.schulze@gmx.de
On 07.07.2010 15:01, Clemens Ladisch wrote:
Soeren D. Schulze wrote:
Is there a chance to get this upstream?
Yes; would you be OK with this tag? Tested-by: Soeren D. Schulze soeren.d.schulze@gmx.de
Yes; I didn't test it that extensively, but it seems to fix the problem.
BTW, the value 24 is still too high if several streams are played at the same time.
Sören
It depend on how DSP mix several voices together ( up to our voices in this case) it DSP just add the amplitide of two voices , it may need some kind of atten to prevent clipping
participants (3)
-
Clemens Ladisch
-
Raymond Yau
-
Soeren D. Schulze