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
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
2010/7/6 Soeren D. Schulze <[email protected]>
Quoted 9 lines
[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.
Quoted 7 lines
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
Quoted 2 lines
Sören
Quoted 5 lines · Soeren D. Schulze
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:
sound/pci/via82xx.c +7 -2
@@ -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 |
Quoted 31 lines · Clemens Ladisch
Quoted 5 lines · Soeren D. Schulze
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:
sound/pci/via82xx.c +3
-0@@ -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 ;
sound/pci/via82xx.c static int snd_via8233_playback_open(struct snd_pcm_substream *substream) · line 1257
Quoted 10 lines
sound/pci/via82xx.c +4
-2if (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 |
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
Clemens Ladisch
Tested-by Soeren D. SchulzeQuoted 1 line · Soeren D. Schulze
Is there a chance to get this upstream?
Yes; would you be OK with this tag?
Regards,
Clemens
Quoted 5 lines · Clemens Ladisch
Quoted 1 line · Soeren D. Schulze
Is there a chance to get this upstream?
Yes; would you be OK with this tag?
Tested-by Soeren D. Schulze <[email protected]>
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 <[email protected]>
Quoted 7 lines · Clemens Ladisch
Quoted 5 lines
Quoted 1 line · Soeren D. Schulze
Is there a chance to get this upstream?
Yes; would you be OK with this tag?
Tested-by Soeren D. Schulze <[email protected]>
Quoted 8 lines
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