<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Pulseaudio doesn't detect jack connection properly (HD AUDIO)"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=90480#c4">Comment # 4</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Pulseaudio doesn't detect jack connection properly (HD AUDIO)"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=90480">bug 90480</a>
              from <span class="vcard"><a class="email" href="mailto:superquad.vortex2@gmail.com" title="Raymond <superquad.vortex2@gmail.com>"> <span class="fn">Raymond</span></a>
</span></b>
        <pre>(In reply to Yan Pashkovsky from <a href="show_bug.cgi?id=90480#c0">comment #0</a>)
<span class="quote">> If I connect front panel sound jacks to my MB via HD Audio, not AC97 and
> plug headphones to the front output - Pulseaudio will be randomly and fast
> switch between front and rear inputs.
> Sound card - Relatek, Pulseaudio 4.0, Linux Mint 17.1
> On Launchpad
> <a href="https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1067434">https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1067434</a></span >

post the output of alsa-info.sh

to debug unsol jack plug and unplug event, you need to enable tracepoint and
find out how those pin get sense command were triggered 

<a href="https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/plain/Documentation/sound/alsa/HD-Audio.txt">https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/plain/Documentation/sound/alsa/HD-Audio.txt</a>

Tracepoints
~~~~~~~~~~~
The hd-audio driver gives a few basic tracepoints.
`hda:hda_send_cmd` traces each CORB write while `hda:hda_get_response`
traces the response from RIRB (only when read from the codec driver).
`hda:hda_bus_reset` traces the bus-reset due to fatal error, etc,
`hda:hda_unsol_event` traces the unsolicited events, and
`hda:hda_power_down` and `hda:hda_power_up` trace the power down/up
via power-saving behavior.

Enabling all tracepoints can be done like
------------------------------------------------------------------------
  # echo 1 > /sys/kernel/debug/tracing/events/hda/enable
------------------------------------------------------------------------
then after some commands, you can traces from
/sys/kernel/debug/tracing/trace file.  For example, when you want to
trace what codec command is sent, enable the tracepoint like:
------------------------------------------------------------------------
  # cat /sys/kernel/debug/tracing/trace
  # tracer: nop
  #
  #       TASK-PID    CPU#    TIMESTAMP  FUNCTION
  #          | |       |          |         |
         <...>-7807  [002] 105147.774889: hda_send_cmd: [0:0] val=e3a019
         <...>-7807  [002] 105147.774893: hda_send_cmd: [0:0] val=e39019
         <...>-7807  [002] 105147.999542: hda_send_cmd: [0:0] val=e3a01a
         <...>-7807  [002] 105147.999543: hda_send_cmd: [0:0] val=e3901a
         <...>-26764 [001] 349222.837143: hda_send_cmd: [0:0] val=e3a019
         <...>-26764 [001] 349222.837148: hda_send_cmd: [0:0] val=e39019
         <...>-26764 [001] 349223.058539: hda_send_cmd: [0:0] val=e3a01a
         <...>-26764 [001] 349223.058541: hda_send_cmd: [0:0] val=e3901a



<a href="https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/log/sound/pci/hda?qt=grep&q=tracepoint">https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/log/sound/pci/hda?qt=grep&q=tracepoint</a></pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>