On 08/02/2013 03:34 PM, Arun Raghavan wrote:
> On Fri, 2013-08-02 at 15:19 +0200, David Henningsson wrote:
>> Some HD-audio codecs (at least ALC269VB and ALC283) become quite noisy on
>> high Mic Boost levels. So e g, if there is a "Mic Boost" and a "Capture"
>> control, both ranging from 0 dB to +30 dB, you get better quality if
>> "Mic Boost" is 0 dB and "Capture" is +30 dB, than the other way around.
>>
>> By changing the order in the configuration files, this patch makes us prefer
>> leaving "Mic Boost" low and "Capture" high if the user selects a medium gain.
>>
>> (This is based on limited experience, and there is no guarantee that there 
>> are
>> no sound cards that work the other way around, and therefore this patch could
>> potentially regress quality on those machines. Hopefully those are fewer, so
>> this is what we should default to.)
> [...]
>> diff --git a/src/modules/alsa/mixer/paths/analog-input-headphone-mic.conf 
>> b/src/modules/alsa/mixer/paths/analog-input-headphone-mic.conf
>> index 688b8ac..3a19e01 100644
>> --- a/src/modules/alsa/mixer/paths/analog-input-headphone-mic.conf
>> +++ b/src/modules/alsa/mixer/paths/analog-input-headphone-mic.conf
>> @@ -27,21 +27,21 @@ description-key = analog-input-microphone
>>  required-any = any
>>  state.plugged = unknown
>>  
>> -[Element Headphone Mic Boost]
>> -required-any = any
>> -switch = select
>> +[Element Capture]
>> +switch = mute
>>  volume = merge
>>  override-map.1 = all
>>  override-map.2 = all-left,all-right
>>  
>> -[Element Headphone Mic]
>> +[Element Headphone Mic Boost]
> 
> If we're doing this, might as well prefer Headphone Mic over Headphone
> Mic Boost?

We could, but I'd rather have some sort of evidence/indication that this
will actually make a difference first. For starters, it's unusual to
have both "Headphone Mic" and "Headphone Mic Boost" on the same sound card.

Also, we're moving this around because we have empirical experience that
hardware behaves this way, not because it is logical for hardware to do
so. Hence I'd refrain from extending the same logic to other controls.

Btw, the reason I'm moving "Capture" rather than the Mic Boosts is that
I remember sometimes boosts are labelled "xx Mic" instead "xx Mic
Boost", even though they are boosts and could potentially work the same
way (become noisy at high levels).

>>  required-any = any
>> -switch = mute
>> +switch = select
>>  volume = merge
>>  override-map.1 = all
>>  override-map.2 = all-left,all-right
>>  
>> -[Element Capture]
>> +[Element Headphone Mic]
>> +required-any = any
>>  switch = mute
>>  volume = merge
>>  override-map.1 = all
> [...]
>> diff --git 
>> a/src/modules/alsa/mixer/paths/analog-input-internal-mic-always.conf 
>> b/src/modules/alsa/mixer/paths/analog-input-internal-mic-always.conf
>> index cd08531..e9c288e 100644
>> --- a/src/modules/alsa/mixer/paths/analog-input-internal-mic-always.conf
>> +++ b/src/modules/alsa/mixer/paths/analog-input-internal-mic-always.conf
>> @@ -39,6 +39,12 @@ state.unplugged = unknown
>>  state.plugged = no
>>  state.unplugged = unknown
>>  
>> +[Element Capture]
>> +switch = mute
>> +volume = merge
>> +override-map.1 = all
>> +override-map.2 = all-left,all-right
>> +
>>  [Element Internal Mic Boost]
>>  switch = select
>>  volume = merge
>> @@ -63,7 +69,6 @@ name = input-boost-on
>>  [Option Int Mic Boost:off]
>>  name = input-boost-off
> 
> Again, maybe Boost should be after both Internal Mic?
> 
>> -
>>  [Element Internal Mic]
>>  switch = mute
>>  volume = merge
>> @@ -76,12 +81,6 @@ volume = merge
>>  override-map.1 = all
>>  override-map.2 = all-left,all-right
>>  
>> -[Element Capture]
>> -switch = mute
>> -volume = merge
>> -override-map.1 = all
>> -override-map.2 = all-left,all-right
>> -
>>  [Element Input Source]
>>  enumeration = select
>>  
>> diff --git a/src/modules/alsa/mixer/paths/analog-input-internal-mic.conf 
>> b/src/modules/alsa/mixer/paths/analog-input-internal-mic.conf
>> index ae3e9a8..5424a1b 100644
>> --- a/src/modules/alsa/mixer/paths/analog-input-internal-mic.conf
>> +++ b/src/modules/alsa/mixer/paths/analog-input-internal-mic.conf
>> @@ -44,6 +44,12 @@ state.plugged = unknown
>>  state.unplugged = unknown
>>  required-any = any
>>  
>> +[Element Capture]
>> +switch = mute
>> +volume = merge
>> +override-map.1 = all
>> +override-map.2 = all-left,all-right
>> +
>>  [Element Internal Mic Boost]
>>  required-any = any
>>  switch = select
>> @@ -70,7 +76,6 @@ name = input-boost-on
>>  [Option Int Mic Boost:off]
>>  name = input-boost-off
> 
> Same comment here.
>  
> Rest looks good to me.

Ok, can I push this one as it is then? There's nothing stopping us from
switching "Headphone Mic" and "Headphone Mic Boost" too, if we want to
do so later.


-- 
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to pulseaudio in Ubuntu.
https://bugs.launchpad.net/bugs/1085402

Title:
  PulseAudio overuses 'Boost' control of microphone input producing bad
  audio quality

Status in “pulseaudio” package in Ubuntu:
  Triaged

Bug description:
  Om my notebook PulseAudio detects 2 ports on embedded sound card:
  1)    analog-input-microphone-internal
  2)    analog-input-microphone

  PulseAudio module "module-switch-on-port-available" chooses as default
  port #2 after external microphone is attached and switches back to
  port #1 after external mike removal.

  This behavior seems right.

  However, if I record sound with auto selected port, audio quality is
  very poor. There is loud noise in background. But if I switch to
  "wrong" port audio quality becomes great. E.g. I have to manually
  select "analog-input-microphone-internal" port when I attach external
  mike and vice versa.

  Example of record:
  http://self-perfection.homeip.net/files/2012/external_ru.flac (652 KiB)
  This record is made via headset microphone. During first half of record 
source port analog-input-microphone was selected then i switched to port 
analog-input-microphone-internal.

  ProblemType: Bug
  DistroRelease: Ubuntu 12.10
  Package: pulseaudio 1:2.1-0ubuntu4
  ProcVersionSignature: Ubuntu 3.5.0-18.29-generic 3.5.7
  Uname: Linux 3.5.0-18-generic x86_64
  ApportVersion: 2.6.1-0ubuntu6
  Architecture: amd64
  AudioDevicesInUse:
   USER        PID ACCESS COMMAND
   /dev/snd/controlC0:  self       2150 F.... pulseaudio
                        self       2255 F.... xfce4-volumed
  Date: Sat Dec  1 16:34:31 2012
  InstallationDate: Installed on 2012-07-01 (152 days ago)
  InstallationMedia: Xubuntu 12.04 LTS "Precise Pangolin" - Release amd64 
(20120425)
  MarkForUpload: True
  SourcePackage: pulseaudio
  UpgradeStatus: Upgraded to quantal on 2012-10-21 (40 days ago)
  dmi.bios.date: 04/03/2012
  dmi.bios.vendor: Phoenix Technologies Ltd.
  dmi.bios.version: 06QB
  dmi.board.asset.tag: Base Board Asset Tag
  dmi.board.name: 300E4Z/300E5Z/300E7Z
  dmi.board.vendor: SAMSUNG ELECTRONICS CO., LTD.
  dmi.board.version: FAB1
  dmi.chassis.asset.tag: Asset Tag
  dmi.chassis.type: 9
  dmi.chassis.vendor: SAMSUNG ELECTRONICS CO., LTD.
  dmi.chassis.version: 0.1
  dmi.modalias: 
dmi:bvnPhoenixTechnologiesLtd.:bvr06QB:bd04/03/2012:svnSAMSUNGELECTRONICSCO.,LTD.:pn300E4Z/300E5Z/300E7Z:pvr0.1:rvnSAMSUNGELECTRONICSCO.,LTD.:rn300E4Z/300E5Z/300E7Z:rvrFAB1:cvnSAMSUNGELECTRONICSCO.,LTD.:ct9:cvr0.1:
  dmi.product.name: 300E4Z/300E5Z/300E7Z
  dmi.product.version: 0.1
  dmi.sys.vendor: SAMSUNG ELECTRONICS CO., LTD.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1085402/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to