[alsa-devel] Internal Mics and Speakers not visible in PulseAudio

David Henningsson david.henningsson at canonical.com
Thu Jun 7 16:49:44 CEST 2012


On 06/07/2012 04:59 AM, Raymond Yau wrote:
>
>
> David Henningsson <david.henningsson at canonical.com
> <mailto:david.henningsson at canonical.com>> 於 2012年6月1日星期五寫道:
>  > On 06/01/2012 04:54 AM, Raymond Yau wrote:
>  >>
>  >> 2012/5/30 David Henningsson<david.henningsson at canonical.com
> <mailto:david.henningsson at canonical.com>>:
>  >>>
>  >>> On 05/30/2012 03:04 PM, Raymond Yau wrote:
>  >>>>
>  >>>> I am afraid this does not work with desktop computer which has front
>  >>>> mic , internal mic, Line in ,CD (or stereo mix with those via hda
>  >>>> codecs)
>  >>>>
>  >>>> With ubuntu 12.04 and unity ,  if I enable hda jack detect with my
>  >>>> ad198x on my desktop, sound  preference does not allow me to select
>  >>>> front mic since I am still using ac97 front panel (with no jack detect
>  >>>> circuit)
>  >>>
>  >>>
>  >>
> For those user with hda front audio panel, When the rear mic is
> unplugged, pulse audio change the input to another sound card if there
> is no plugged input jacks as pa don't regard cd or stereo mic as valid
> port of the input source.
>
> When the rear mic is plugged before pulaseaudio start and it is the
> first port of the input in the sound setting ,it change to the webcam
> mic(second port) after the rear mic is unplugged.
>
> So it won't autoselect when The user plugged the rear mic again. He have
> to select the rear mic in sound setting, the rear mic is the last port
> in sound setting.it <http://setting.it> will change to the mic1of
> another sound card(last port)

I think we have to live with these kinds of issues in PulseAudio until 
Colin has completed his priority list implementation.

>  >> There are difference for the system settings/sound in unity and gnome
>  >>
>  >> In gnome session, the system settings/sound list the three hardcoded
>  >> ports (front mic, line and rear mic) instead of all the items in the
>  >> "Input source" / "Capture Source" controls ( There is no CD in HDA,
>  >> and no CD , stereo mix, aux, phone for my other sound cards with ac97
>  >> codec)
>  >>
>  >> Is there any way to add back "Stereo Mix" to pulseaudio 's port ?
>  >
>  > Yes. See:
>  >
>  >
> http://www.freedesktop.org/wiki/Software/PulseAudio/Backends/ALSA/Profiles
>  >
>  > However if you have additional questions about how to write
> PulseAudio profiles and paths I might not have the time to help you out
> with that, hopefully you will be able to sort that out by yourself.
>
> I have follows colin's tutorial compiling and running pulse audio from git.

You don't need to recompile pulseaudio to change configuration files, 
they are all in /usr/share/pulseaudio/alsa-mixer

> Do i need to build the unity/gnome sound setting and what are the name
> of the system setting sound in gnome and unity?
>
> Although there is no aux in sound setting, select analog input in sound
> setting will select the aux
>
> Why changing the input port from rear mic to front mic also change the
> value of rear mic boost and front mic boost at the same time ?
>
> This  forbid multi streaming capture using two mic.

You can change this by changing the configuration files.

>  >> In unity session, the system settings/sound only list  the plugged
> jacks.
>  >>
>  >> I think the usage of jack detect to select input source automatically
>  >> is broken for for those  motherboards which have three audio jacks in
>  >> rear panel and retask those pink and blue jacks for surround51 output.
>  >>
>  >> The module-switch-on-available-port should check whether "Channel
>  >> mode' is 6 and exclude the result those jack detect of "rear mic" and
>  >> "line in" since they have been retasked for output
>  >
>  > Hmm. That would lead to quite hairy code in PulseAudio, I'm
> afraid...and I don't think it's the right way to solve the problem either.
>  >
>  > I think we could go about this in different ways.
>  >
>  > 1) The easiest way is to say that if you're changing "Channel mode"
> manually in alsamixer, you're on your own. After all, the normal/newbie
> end user would not know about alsamixer at all, so if you're capable of
> changing things in alsamixer you're assumed to be capable of configuring
> PulseAudio's profiles (using the link above) to match that as well.
>  >
>  > 2) We could make a policy decision to remove the code that retasks
> the jacks, and direct people to hda-jack-retask if they want to do that.
> That would mean simpler code for everyone - however, with the recent
> addition of multi-IO in the Realtek driver (for example), things doesn't
> seem to head that way...
>  >
>  > 3) We could add both "Line Out Surround Jack" and "Rear Mic Jack".
> The "Rear Mic Jack" would always return present=no when you're in
> 6-channel surround retask mode, and "Line Out Surround Jack" would
> always return present=no when you're in the normal mode.
>  >
>
>
> It seem that is not possible to implement 3) in current implementation
> in hda-jack.c

But everything is possible with the right patches :-)

> I prefer an module parameter of hda for disable the creation of jack
> detect control since this force pa to fallback like the other sound
> cards which have no jack detection

Why don't you just remove the jack detection from PulseAudio's 
configuration files instead?

> The behaviour of desktop users are different from notebook users
> The desktop users are unlikely to plug/unplug the jacks at rear panel
> every time. They rather connected all the necessary jacks of the rear
> audio panel
>
>  >> BTW, the ICH8 HDA controller support multi stream capturing and ad1988
>  >> has thee capture subdevices
>  >>
>  >> arecord -l
>  >> card 1: Intel [HDA Intel], device 0: AD198x Analog [AD198x Analog]
>  >>   Subdevices: 3/3
>  >>   Subdevice #0: subdevice #0
>  >>   Subdevice #1: subdevice #1
>  >>   Subdevice #2: subdevice #2
>  >
>  > You would be able to make a multi-source profile in PulseAudio that
> can record from all of these simultaneously, but we're missing a patch
> that can control volumes and switches with indices, so you would have to
> control the gain manually in alsamixer.
>  >
> I don't think this work since when changing from rear mic to front mic,
> pulseaudio also change the rear mic boost and front mic boost.
> Especially when the pulse audio API does not allow application to select
> different sink or source (I.e. Multi streaming playback/capture is not
> supported by pulse audio)
>
> The possible way is
> 1) an module parameter of hda driver to disable creation of jack
> detection controls
> 2) don't use module-switch-on-available-port in default.pa
> <http://default.pa>
>
> Btw it seem sound is distorted when the application capture mono and the
> sound card only support stereo is because pa just sum the left and right
> channel (clipping)

Ok. As a workaround, lower the input gain.

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


More information about the Alsa-devel mailing list