<p><br>
>><br>
>> ( 0.090| 0.000) D: [lt-pulseaudio] alsa-mixer.c: Activating path analog-input-mic<br>
>> ( 0.090| 0.000) D: [lt-pulseaudio] alsa-mixer.c: Path analog-input-mic (Microphone), direction=2, priority=87, probed=yes, supported=yes, has_mute=yes, has_volume=yes, has_dB=yes, min_volume=0, max_volume=48, min_dB=-12, max_dB=12<br>
>> ( 0.090| 0.000) D: [lt-pulseaudio] alsa-mixer.c: Element Mic, direction=2, switch=1, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=4, required_absent=0, mask=0x3600000000f66, n_channels=2, override_map=yes<br>
>> ( 0.090| 0.000) D: [lt-pulseaudio] alsa-mixer.c: Element PCM Capture Source, direction=2, switch=0, volume=0, volume_limit=-1, enumeration=1, required=0, required_any=0, required_absent=0, mask=0x0, n_channels=0, override_map=no<br>
>> ( 0.090| 0.000) D: [lt-pulseaudio] alsa-mixer.c: Option Mic (analog-input-microphone/analog-input-microphone) index=0, priority=0<br>
>> ( 0.090| 0.000) D: [lt-pulseaudio] alsa-mixer.c: Element Line, direction=2, switch=2, volume=2, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x6, n_channels=2, override_map=no<br>
>> ( 0.090| 0.000) D: [lt-pulseaudio] alsa-mixer.c: Jack Mic, alsa_name='Mic Jack', detection unavailable<br>
>> ( 0.090| 0.000) D: [lt-pulseaudio] alsa-mixer.c: Jack Mic Phantom, alsa_name='Mic Phantom Jack', detection unavailable<br>
>> ( 0.090| 0.000) D: [lt-pulseaudio] alsa-mixer.c: Setting analog-input-microphone (analog-input-microphone) priority=0<br>
>> ( 0.090| 0.000) D: [lt-pulseaudio] alsa-mixer.c: element_set_switch(): e->alsa_name Line<br>
>> ( 0.090| 0.000) D: [lt-pulseaudio] alsa-mixer.c: element_set_switch():<br>
e->direction == PA_ALSA_DIRECTION_OUTPUT 33694896<br>
>><br>
>> Do you mean the direction is not input ?<br>
><br>
> According to debug message, it is so, however in config:</p>
<p>Both are cvolume and cswitch</p>
<p>Simple mixer control 'Line',0<br>
Capabilities: cvolume cswitch cswitch-joined<br>
Capture channels: Front Left - Front Right<br>
Limits: Capture 0 - 48<br>
Front Left: Capture 24 [50%] [0.00dB] [on]<br>
Front Right: Capture 24 [50%] [0.00dB] [on]<br>
Simple mixer control 'Mic',0<br>
Capabilities: cvolume cswitch cswitch-joined<br>
Capture channels: Front Left - Front Right<br>
Limits: Capture 0 - 48<br>
Front Left: Capture 24 [50%] [0.00dB] [on]<br>
Front Right: Capture 24 [50%] [0.00dB] [on]</p>
<p>Seem mono capture switch but capture volume are stereo</p>
<p>>>><br>
>>> [Mapping analog-stereo-input]<br>
>>> device-strings = hw:%f,1,0<br>
>>> paths-input = analog-input-mic analog-input-linein<br>
>>> channel-map = left,right<br>
>>> direction = input<br>
><br>
> There is explicit mentioning of required direction.<br>
><br>
>> ( 0.090| 0.000) D: [lt-pulseaudio] alsa-mixer.c: element_set_switch(): b 0<br>
>><br>
>> pulseaudio seem just turn off line switch instead of turn on nic capture volum/switch when activating mic path<br>
>><br>
>> One line show element name , values or enum index and enum name instead of three lines<br></p>
<p>tatic int element_set_switch(pa_alsa_element *e, snd_mixer_t *m, bool b) {<br>
snd_mixer_elem_t *me;<br>
snd_mixer_selem_id_t *sid;<br>
int r;</p>
<p> pa_assert(m);<br>
pa_assert(e);</p>
<p> SELEM_INIT(sid, e->alsa_name);<br>
if (!(me = snd_mixer_find_selem(m, sid))) {<br>
pa_log_warn("Element %s seems to have disappeared.", e->alsa_name);<br>
return -1;<br>
}</p>
<p> if (e->direction == PA_ALSA_DIRECTION_OUTPUT)<br>
r = snd_mixer_selem_set_playback_switch_all(me, b);<br>
else<br>
r = snd_mixer_selem_set_capture_switch_all(me, b);</p>
<p> if (r < 0)<br>
pa_log_warn("Failed to set switch of %s: %s", e->alsa_name, pa_alsa_strerror(errno));<br>
+ else<br>
+ pa_log_dbg("element_set_switch %s dir=%d index=%d ", e->alsa_name, e->direction, b);<br>
return r;<br>
}</p>
<p>><br>
> Sorry, I'm not sure I understand what do you mean by this.<br>
> I'm not C/C++ developer at all, can't even find definition of snd_mixer_elem_t to find what is that and how to use it (my guess that you've being asking about it, right?).<br>
>><br>
>> ( 0.090| 0.000) D: [lt-pulseaudio] alsa-mixer.c: element_set_option(): e->alsa_name PCM Capture Source<br>
>> ( 0.090| 0.000) D: [lt-pulseaudio] alsa-mixer.c: element_set_option(): e->switch_use == PA_ALSA_SWITCH_SELECT 0<br>
>> ( 0.090| 0.000) D: [lt-pulseaudio] alsa-mixer.c: element_set_option(): alsa_idx 0<br>
>><br>
>> snd_mixer_selem_get_enum_item_name() provide the name of enum item by index<br>
></p>
<p>The pcm capture source seem changed to mic which is index 0</p>
<p>There are some difference between Capture Source of ac97 codec and PCM Capture Source of snd-usb-audio</p>
<p>The source of Ac97 capture source are cswitch-exclusive , only one cswitch can be on and others are off</p>
<p>Simple mixer control 'Line',0<br>
Capabilities: pvolume pswitch pswitch-joined cswitch cswitch-exclusive penum<br>
Capture exclusive group: 0<br>
Playback channels: Front Left - Front Right<br>
Capture channels: Front Left - Front Right<br>
Limits: Playback 0 - 31<br>
Front Left: Playback 0 [0%] [-34.50dB] [off] Capture [off]<br>
Front Right: Playback 0 [0%] [-34.50dB] [off] Capture [off]</p>
<p>Simple mixer control 'Mic',0<br>
Capabilities: pvolume pvolume-joined pswitch pswitch-joined cswitch cswitch-exclusive penum<br>
Capture exclusive group: 0<br>
Playback channels: Mono<br>
Capture channels: Front Left - Front Right<br>
Limits: Playback 0 - 31<br>
Mono: Playback 0 [0%] [-34.50dB] [off]<br>
Front Left: Capture [on]<br>
Front Right: Capture [on]<br><br></p>
<p>static int element_set_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_channel_map *cm, pa_cvolume *v, bool deferred_volume, bool write_to_hw) {</p>
<p> ...</p>
<p> } else {<br>
- if ((r = snd_mixer_selem_set_capture_dB(me, c, value, rounding)) >= 0)<br>
+ if ((r = snd_mixer_selem_set_capture_dB(me, c, value, rounding)) >= 0) {<br>
+ pa_log_debug("element_set_volume %s %d dB", e->alsa_name, value);<br>
r = snd_mixer_selem_get_capture_dB(me, c, &value);<br>
+ }<br>
}</p>