pulseaudio should handle additional mixer element name for internal mic

Bug #680810 reported by Rocko
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
pulseaudio (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: pulseaudio

pulseaudio/gnome-volume-manager appears to truncate device names and assume that two devices with the same truncated name are the same, which becomes a problem with the 2.6.37 kernel, as it has changed the naming convention for mic inputs (see https://bugzilla.kernel.org/show_bug.cgi?id=23162).

For instance, I get "Internal Mic", "Mic", and "Internal Mic #1" as the three possible mics in ALSA on my PC, but gnome-volume-manager only gives "Microphone 1" and "Microphone 2", corresponding to the first two microphones. This is a problem on my system because the third microphone is the built-in one.

It looks like pulseaudio is truncating "Internal Mic" to perhaps "Internal" and so it thinks it is the same as "Internal Mic #1".

The workaround is to use alsamixer to choose the correct microphone, which is obviously not ideal.

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: pulseaudio 1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu21.1
Uname: Linux 2.6.37-rc3-autogroup x86_64
NonfreeKernelModules: nvidia
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.23.
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: rocko 30732 F.... pulseaudio
Card0.Amixer.info:
 Card hw:0 'Intel'/'HDA Intel at 0xf6ffc000 irq 43'
   Mixer name : 'SigmaTel STAC9228'
   Components : 'HDA:83847616,1028022e,00100402'
   Controls : 28
   Simple ctrls : 19
Date: Wed Nov 24 14:31:03 2010
InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Alpha amd64 (20100224.1)
ProcEnviron:
 LANG=en_AU.UTF-8
 SHELL=/bin/bash
SourcePackage: pulseaudio
dmi.bios.date: 11/19/2008
dmi.bios.vendor: Dell Inc.
dmi.bios.version: A12
dmi.board.vendor: Dell Inc.
dmi.chassis.type: 8
dmi.chassis.vendor: Dell Inc.
dmi.modalias: dmi:bvnDellInc.:bvrA12:bd11/19/2008:svnDellInc.:pnXPSM1530:pvr:rvnDellInc.:rn:rvr:cvnDellInc.:ct8:cvr:
dmi.product.name: XPS M1530
dmi.sys.vendor: Dell Inc.

Revision history for this message
Rocko (rockorequin) wrote :
Revision history for this message
Daniel T Chen (crimsun) wrote :
Changed in pulseaudio (Ubuntu):
status: New → Incomplete
Revision history for this message
Rocko (rockorequin) wrote :

Attached is the pulseaudio log file. It shows that pulseaudio detects two microphones:

D: alsa-mixer.c: Option Mic (input-microphone-1/Microphone 1) index=1, priority=20
D: alsa-mixer.c: Option Internal Mic (input-microphone-2/Microphone 2) index=0, priority=19
D: alsa-mixer.c: Setting input-microphone-1 (Microphone 1) priority=20
D: alsa-mixer.c: Setting input-microphone-2 (Microphone 2) priority=19

However, the amixer output for input sources shows that there are three microphones.

Simple mixer control 'Input Source',0
  Capabilities: cenum
  Items: 'Internal Mic' 'Mic' 'Internal Mic 1'
  Item0: 'Mic'
Simple mixer control 'Input Source',1
  Capabilities: cenum
  Items: 'Internal Mic' 'Mic' 'Internal Mic 1'
  Item0: 'Mic'
Simple mixer control 'Input Source',2
  Capabilities: cenum
  Items: 'Internal Mic' 'Mic' 'Internal Mic 1'
  Item0: 'Mic'

Changed in pulseaudio (Ubuntu):
status: Incomplete → New
Revision history for this message
David Henningsson (diwic) wrote :

Can you workaround the problem by modifying /usr/share/pulseaudio/alsa-mixer/paths/analog-input.conf.common,
adding this section (reboot or restart pulseaudio to test):

[Option Input Source:Internal Mic 1]
name = input-microphone
priority = 19

Changed in pulseaudio (Ubuntu):
status: New → Incomplete
Revision history for this message
Rocko (rockorequin) wrote :

Super, that works. Adding that section gives me three microphones to choose from: Microphone 3, Microphone 1, Microphone 2 (in that order), and Microphone 1 is "Internal Mic 1". Does pulseaudio just match alsa inputs against entries in its conf files?

Revision history for this message
Daniel T Chen (crimsun) wrote : Re: [Bug 680810] Re: pulseaudio confuses mic inputs with similar names in alsa

Yes, there needs to be an exposed mixer path in pulse config files
that corresponds to entries exposed via alsa-lib to be able to use
them in pulse.

Revision history for this message
Daniel T Chen (crimsun) wrote : Re: pulseaudio confuses mic inputs with similar names in alsa

Here's the patch that I just sent to the pulseaudio-discuss mailing list (Cc'd Lennart and Colin).

Changed in pulseaudio (Ubuntu):
importance: Undecided → Low
status: Incomplete → In Progress
tags: added: patch-forwarded-upstream
summary: - pulseaudio confuses mic inputs with similar names in alsa
+ pulseaudio should handle additional mixer element name for internal mic
Daniel T Chen (crimsun)
Changed in pulseaudio (Ubuntu):
status: In Progress → Fix Committed
tags: added: patch-accepted-upstream
removed: patch-forwarded-upstream
Revision history for this message
Daniel T Chen (crimsun) wrote :
Revision history for this message
Raymond (superquad-vortex2) wrote :

but there are three capture subdevices which allow user to capture from three input sources independently

**** List of CAPTURE Hardware Devices ****
card 0: Intel [HDA Intel], device 0: STAC92xx Analog [STAC92xx Analog]
  Subdevices: 3/3
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2

Simple mixer control 'Input Source',0
  Capabilities: cenum
  Items: 'Internal Mic' 'Mic' 'Internal Mic 1'
  Item0: 'Mic'
Simple mixer control 'Input Source',1
  Capabilities: cenum
  Items: 'Internal Mic' 'Mic' 'Internal Mic 1'
  Item0: 'Mic'
Simple mixer control 'Input Source',2
  Capabilities: cenum
  Items: 'Internal Mic' 'Mic' 'Internal Mic 1'
  Item0: 'Mic'

Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch penum
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 14
  Front Left: Capture 12 [86%] [18.00dB] [on]
  Front Right: Capture 12 [86%] [18.00dB] [on]
Simple mixer control 'Capture',1
  Capabilities: cvolume cswitch penum
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 14
  Front Left: Capture 14 [100%] [21.00dB] [off]
  Front Right: Capture 14 [100%] [21.00dB] [off]
Simple mixer control 'Capture',2
  Capabilities: cvolume cswitch penum
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 14
  Front Left: Capture 14 [100%] [21.00dB] [off]
  Front Right: Capture 14 [100%] [21.00dB] [off]

pulseaudio does support multiple sinks/sources (e.g. audio 4J which has 2 playback and 2 capture subdevices )

ARECORD

card 1: Audio4DJ [Audio 4 DJ], device 0: Audio 4 DJ [Audio 4 DJ]
  Subdevices: 2/2
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1

http://git.0pointer.de/?p=pulseaudio.git;a=blob;f=src/modules/alsa/mixer/profile-sets/native-instruments-audio4dj.conf

[Mapping analog-stereo-a]
description = Analog Stereo Channel A
device-strings = hw:%f,0,0
channel-map = left,right

[Mapping analog-stereo-b-input]
description = Analog Stereo Channel B
device-strings = hw:%f,0,1
channel-map = left,right
direction = input

[Profile output:analog-stereo-all+input:analog-stereo-all]
description = Analog Stereo Duplex Channels A, B (Headphones)
output-mappings = analog-stereo-a analog-stereo-b-output
input-mappings = analog-stereo-a analog-stereo-b-input

Revision history for this message
Alexandre Demers (oxalin) wrote :

Even with the fix applied, it's not working on both my computers. However, using a previous kernel (2.6.35 or 2.6.36) does enumerate the input devices correctly. Am I right to think that

amixer ->
Simple mixer control 'Input Source',2
  Capabilities: cenum
  Items: 'Rear Mic' 'Front Mic' 'Line'
  Item0: 'Rear Mic'

would need to add in pulseaudio file ->
[Option Input Source:Rear Mic]
name = input-microphone
priority = 19

[Option Input Source:Front Mic]
name = input-microphone
priority = 19

Revision history for this message
João Miguel Lopes Moreira (jmlm-1970) wrote :

The only solution to make microphone work is to install linux-backports-modules-alsa-generic...

Just go to:

Menu / System / Administration / Synaptic Package Manager

And search and mark for installation:

linux-backports-modules-alsa-generic

tip: if you have multiple versions click on the first and read the description which should inform what name to install...

If after the reboot and mic mute is off, still does not work, just go to terminal and type:

sudo nano /etc/modprobe.d/alsa-base.conf

and add or change the following:

options snd-hda-intel model=auto enable=yes

Then Ctrl+X, type Y to write and exit, reboot and mic will work.

Bye and have lots of fun with Ubuntu (the best).

Revision history for this message
David Henningsson (diwic) wrote :

Assuming fixed since a long time ago.

Changed in pulseaudio (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.