Bug 51354 - Ports(Jack Detection) state error
Summary: Ports(Jack Detection) state error
Status: RESOLVED NOTOURBUG
Alias: None
Product: PulseAudio
Classification: Unclassified
Component: modules (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: pulseaudio-bugs
QA Contact: pulseaudio-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-23 03:19 UTC by Meng Zhuo
Modified: 2012-10-03 07:40 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
logs while headphone plugged (5.19 KB, application/zip)
2012-06-23 03:19 UTC, Meng Zhuo
Details
pulseaudio -vvvvv (74.25 KB, text/plain)
2012-10-01 14:14 UTC, Meng Zhuo
Details
full log as asked (131.09 KB, text/plain)
2012-10-03 01:03 UTC, Meng Zhuo
Details

Description Meng Zhuo 2012-06-23 03:19:04 UTC
Created attachment 63368 [details]
logs while headphone plugged

My headphone port work fine while (un)plugged. But It appears that pacmd nor PulseAudio doesn't get the right signal from Alsa
version state:
<code>
$ uname --a
Linux x200s 3.4.0-999-generic #201205300405 SMP Wed May 30 08:06:16 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
</code>
<code>
$ pacmd --version
pacmd 2.0
Compiled with libpulse 2.0.0
Linked with libpulse 2.0.0
</code>
The logs of shell command "pacmd list-sinks" and "amixer" while my headphone plugged in the attachment. As you can see, amixer knows that headphone is plugged, meanwhile the state of pulseaudio is "unknown"
Comment 1 Meng Zhuo 2012-10-01 14:14:26 UTC
Created attachment 67927 [details]
pulseaudio -vvvvv
Comment 2 Meng Zhuo 2012-10-01 14:17:53 UTC
D: [pulseaudio] alsa-mixer.c: Jack Headphone, alsa_name='Headphone Jack', detection unavailable
D: [pulseaudio] alsa-mixer.c: Jack Front Headphone, alsa_name='Front Headphone Jack', detection unavailable
--------------
meanwhile in amixer 
-------------
numid=23,iface=CARD,name='Headphone Jack',index=1
  ; type=BOOLEAN,access=r-------,values=1
  : values=on
-------------
I think something broken during detection.
Comment 3 Tanu Kaskinen 2012-10-02 21:43:35 UTC
It would be nice to have the full log of pulseaudio -vvv. The log that is attached doesn't start from the beginning, and doesn't contain the part where the jack is probed.

Anyway, I think the most likely reason is that pa_alsa_find_jack() returns NULL in jack_probe(). This is the code:

snd_hctl_elem_t* pa_alsa_find_jack(snd_hctl_t *hctl, const char* jack_name)
{           
    snd_ctl_elem_id_t *id;

    snd_ctl_elem_id_alloca(&id);
    snd_ctl_elem_id_clear(id);
    snd_ctl_elem_id_set_interface(id, SND_CTL_ELEM_IFACE_CARD);
    snd_ctl_elem_id_set_name(id, jack_name);
    
    return snd_hctl_find_elem(hctl, id);
}

So, if this function returns NULL, either the function is incorrect, or the bug is in alsa.

I've added David to CC (I don't know if you already get all bug traffic anyway - if you do, tell me so and I won't do this again).
Comment 4 Meng Zhuo 2012-10-03 01:03:42 UTC
Created attachment 68019 [details]
full log as asked
Comment 5 Meng Zhuo 2012-10-03 01:11:04 UTC
I had attached full log.
I don't know C stuff, it just my wild guess while jack detection of Mic works fine, not the Headphones.

P.S. I'm a newbie of bug tracking, what does "get all bug traffic" means?
Comment 6 David Henningsson 2012-10-03 07:04:46 UTC
-------------
numid=23,iface=CARD,name='Headphone Jack',index=1
  ; type=BOOLEAN,access=r-------,values=1
  : values=on
-------------

The problem is that 'Headphone Jack' has an index > 0. This is done by ALSA when there are two different headphone jacks and has no other way to distinguish them. If there is no other 'Headphone Jack', without an index, it's a bug in ALSA.

Do you have a launchpad bug for this, or could you file one with "ubuntu-bug alsa-driver"? In Ubuntu Quantal (which I see you're running), alsa info will be collected automatically.
Comment 7 David Henningsson 2012-10-03 07:07:14 UTC
@Tanu, no I don't get all bug email (maybe I should? :-) ), so thanks for cc:ing me.
Comment 8 Meng Zhuo 2012-10-03 07:40:35 UTC
(In reply to comment #6)
> -------------
> numid=23,iface=CARD,name='Headphone Jack',index=1
>   ; type=BOOLEAN,access=r-------,values=1
>   : values=on
> -------------
> 
> The problem is that 'Headphone Jack' has an index > 0. This is done by ALSA
> when there are two different headphone jacks and has no other way to
> distinguish them. If there is no other 'Headphone Jack', without an index,
> it's a bug in ALSA.
> 
> Do you have a launchpad bug for this, or could you file one with "ubuntu-bug
> alsa-driver"? In Ubuntu Quantal (which I see you're running), alsa info will
> be collected automatically.

I filed a bug report
https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1060729
Hope it helps


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.