<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Active port is not set when plugging in headphones in a lenovo Ultradock jack"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=80074">80074</a>
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>lennart@poettering.net
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>pulseaudio-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Active port is not set when plugging in headphones in a lenovo Ultradock jack
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>pulseaudio-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>francois@fmarier.org
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>alsa
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>PulseAudio
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=101132" name="attach_101132" title="Output of "pulseaudio -k && pulseaudio -vvv"">attachment 101132</a> <a href="attachment.cgi?id=101132&action=edit" title="Output of "pulseaudio -k && pulseaudio -vvv"">[details]</a></span>
Output of "pulseaudio -k && pulseaudio -vvv"

If I plug headphones in the headphone jack of my laptop (T440p), the active
port goes from analog-output-speaker to analog-output-headphones as expected.

However, if I use the headphone jack the dock, the active port stays as
analog-output-speaker, instead of switching to analog-output.

I don't use Ubuntu, but I followed the instructions on
<a href="https://wiki.ubuntu.com/ALSA/JackSense">https://wiki.ubuntu.com/ALSA/JackSense</a> and as far as I can tell, the kernel can
tell whether or not headphones are plugged in. Both on the laptop itself:

    $ diff -u codec.no_hp.txt codec.hp_laptop.txt
    --- codec.no_hp.txt    2014-06-16 16:03:58.036317735 +1200
    +++ codec.hp_laptop.txt    2014-06-16 16:04:34.399789974 +1200
    @@ -155,14 +155,14 @@
         Conn = Analog, Color = Unknown
         DefAssociation = 0x1, Sequence = 0x0
         Misc = NO_PRESENCE
    -  Pin-ctls: 0x40: OUT
    +  Pin-ctls: 0x00:
       Unsolicited: tag=00, enabled=0
       Power states:  D0 D1 D2 D3 EPSS
       Power: setting=D0, actual=D0

as well as on the dock:

    $ diff -u codec.no_hp.txt codec.hp_dock.txt
    --- codec.no_hp.txt    2014-06-16 16:03:58.036317735 +1200
    +++ codec.hp_dock.txt    2014-06-16 16:03:48.412457393 +1200
    @@ -162,7 +162,7 @@
         Conn = Analog, Color = Unknown
         DefAssociation = 0x1, Sequence = 0x0
         Misc = NO_PRESENCE
    -  Pin-ctls: 0x40: OUT
    +  Pin-ctls: 0x00:
       Unsolicited: tag=00, enabled=0
       Power states:  D0 D1 D2 D3 EPSS
       Power: setting=D0, actual=D0

However, pulseaudio only updates the active port when plugging into the laptop
jack:

    $ diff -u sinks.no_hp.txt sinks.hp_laptop.txt
    --- sinks.no_hp.txt    2014-06-16 16:02:05.541949763 +1200
    +++ sinks.hp_laptop.txt    2014-06-16 16:00:21.983451258 +1200
    @@ -104,8 +104,8 @@
             device.icon_name = "audio-card-pci"
         Ports:
             analog-output: Analog Output (priority: 9900)
    -        analog-output-speaker: Speakers (priority: 10000)
    -        analog-output-headphones: Headphones (priority: 9000, not
available)
    -    Active Port: analog-output-speaker
    +        analog-output-speaker: Speakers (priority: 10000, not available)
    +        analog-output-headphones: Headphones (priority: 9000, available)
    +    Active Port: analog-output-headphones
         Formats:
             pcm

and not on the dock:

    $ diff -u sinks.no_hp.txt sinks.hp_dock.txt
    $</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>