<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<blockquote
cite="mid:CAN8cciaMdn3GXhU5x8qWLkbM=M2=vz=Lpfid23sHDaeXU6+b9Q@mail.gmail.com"
type="cite">
<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>
</blockquote>
( 0.094| 0.000) D: [lt-pulseaudio] alsa-mixer.c: Setting
analog-input-microphone (analog-input-microphone) priority=0<br>
( 0.094| 0.000) D: [lt-pulseaudio] alsa-mixer.c:
element_set_switch(): e->alsa_name Line<br>
( 0.094| 0.000) D: [lt-pulseaudio] alsa-mixer.c:
element_set_switch(): e->direction == PA_ALSA_DIRECTION_OUTPUT
28404576<br>
( 0.094| 0.000) D: [lt-pulseaudio] alsa-mixer.c:
element_set_switch(): b 0<br>
( 0.094| 0.000) D: [lt-pulseaudio] alsa-mixer.c:
element_set_switch(): me 28912288<br>
( 0.094| 0.000) D: [lt-pulseaudio] alsa-mixer.c:
element_set_switch Line dir=2 index=0 <br>
<br>
However, Mic is selected in sound menu.<br>
<blockquote type="cite">
<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>
</blockquote>
According to log output element_set_volume() is never called at
start, only when opening sound UI.<br>
But it goes to other if branch, because of write_to_hw being false.<br>
Here is fresh log of first run after restart:
<a class="moz-txt-link-freetext" href="http://pastebin.com/GJyUiraP">http://pastebin.com/GJyUiraP</a><br>
Mic was initially selected in UI, but didn't work, then I switched
to Line and back.<br>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<pre class="moz-signature" cols="72">Sincerely, Nazar Mokrynskyi
github.com/nazar-pc
Skype: nazar-pc
Diaspora: <a class="moz-txt-link-abbreviated" href="mailto:nazarpc@diaspora.mokrynskyi.com">nazarpc@diaspora.mokrynskyi.com</a>
Tox: A9D95C9AA5F7A3ED75D83D0292E22ACE84BA40E912185939414475AF28FD2B2A5C8EF5261249</pre>
<br>
</body>
</html>