You are not logged in.

#1 2012-08-17 08:02:44

blux
Member
Registered: 2012-08-17
Posts: 17

Pulseaudio incorrectly detects a headphone being plugged in

I am running Pulseaudio to be able to stream audio from a media box running MPD. I am hearing an occasional stutter in the audio which can be traced back to Pulseaudio detecting a headphone being plugged in or out, although I am not using any headphones. This is what shows up in the Pulseaudio log:

D: [pulseaudio] module-alsa-card.c: Jack 'Front Headphone Jack' is now plugged in
D: [pulseaudio] device-port.c: Setting port analog-output-headphones to status yes
D: [pulseaudio] module-switch-on-port-available.c: finding port analog-output-headphones
D: [alsa-sink] alsa-mixer.c: Activating path analog-output-headphones
D: [alsa-sink] alsa-mixer.c: Path analog-output-headphones (Headphones), direction=1, priority=90, probed=yes, supported=yes, has_mute=yes, has_volume=yes, has_dB=yes, min_volume=0, max_volume=64, min_dB=-179, max_dB=0
D: [alsa-sink] alsa-mixer.c: Element Master, direction=1, switch=1, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x7ffffffffffff, n_channels=1, override_map=yes
D: [alsa-sink] alsa-mixer.c: Element Headphone, direction=1, 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
D: [alsa-sink] alsa-mixer.c: Element Front, direction=1, switch=1, volume=3, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x6, n_channels=2, override_map=no
D: [alsa-sink] alsa-mixer.c: Element Surround, direction=1, 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
D: [alsa-sink] alsa-mixer.c: Element Side, direction=1, 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
D: [alsa-sink] alsa-mixer.c: Element Center, direction=1, switch=2, volume=2, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x7ffffffffffff, n_channels=1, override_map=no
D: [alsa-sink] alsa-mixer.c: Element LFE, direction=1, switch=2, volume=2, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x7ffffffffffff, n_channels=1, override_map=no
D: [alsa-sink] alsa-mixer.c: Element PCM, direction=1, switch=0, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x3600000000f66, n_channels=2, override_map=yes
D: [alsa-sink] alsa-mixer.c: Element IEC958, direction=1, switch=2, volume=0, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x0, n_channels=0, override_map=no
D: [alsa-sink] alsa-mixer.c: Jack Front Headphone, alsa_name='Front Headphone Jack', detection possible
D: [alsa-sink] alsa-mixer.c: Jack Headphone, alsa_name='Headphone Jack', detection unavailable
I: [alsa-sink] alsa-sink.c: Successfully enabled deferred volume.
I: [alsa-sink] alsa-sink.c: Hardware volume ranges from -179.00 dB to 0.00 dB.
I: [alsa-sink] alsa-sink.c: Fixing base volume to 0.00 dB
I: [alsa-sink] alsa-sink.c: Using hardware volume control. Hardware dB scale supported.
I: [alsa-sink] alsa-sink.c: Using hardware mute control.
I: [pulseaudio] sink.c: Changed port of sink 0 "alsa_output.pci-0000_00_14.2.analog-stereo" to analog-output-headphones
I: [pulseaudio] module-device-restore.c: Restoring volume for sink alsa_output.pci-0000_00_14.2.analog-stereo.
D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
D: [alsa-sink] alsa-sink.c: Requested volume: 0:  49% 1:  49%
D: [alsa-sink] alsa-sink.c:            in dB: 0: -18.53 dB 1: -18.53 dB
D: [alsa-sink] alsa-sink.c: Got hardware volume: 0:  49% 1:  49%
D: [alsa-sink] alsa-sink.c:               in dB: 0: -18.40 dB 1: -18.40 dB
D: [alsa-sink] alsa-sink.c: Calculated software volume: 0:  99% 1:  99% (accurate-enough=yes)
D: [alsa-sink] alsa-sink.c:                      in dB: 0: -0.13 dB 1: -0.13 dB
D: [alsa-sink] sink.c: Volume going down to 32182 at 2147160675

A few minutes later, this shows up:

D: [pulseaudio] module-alsa-card.c: Jack 'Front Headphone Jack' is now unplugged
D: [pulseaudio] device-port.c: Setting port analog-output-headphones to status no
D: [pulseaudio] module-switch-on-port-available.c: finding port analog-output-headphones
D: [alsa-sink] alsa-mixer.c: Activating path analog-output
D: [alsa-sink] alsa-mixer.c: Path analog-output (Analog Output), direction=1, priority=99, probed=yes, supported=yes, has_mute=yes, has_volume=yes, has_dB=yes, min_volume=0, max_volume=64, min_dB=-179, max_dB=0
D: [alsa-sink] alsa-mixer.c: Element Master, direction=1, switch=1, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x7ffffffffffff, n_channels=1, override_map=yes
D: [alsa-sink] alsa-mixer.c: Element Headphone, direction=1, switch=1, volume=3, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x6, n_channels=2, override_map=no
D: [alsa-sink] alsa-mixer.c: Element Front, direction=1, switch=1, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x6, n_channels=2, override_map=yes
D: [alsa-sink] alsa-mixer.c: Element Surround, direction=1, switch=1, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x60, n_channels=2, override_map=yes
D: [alsa-sink] alsa-mixer.c: Element Side, direction=1, switch=1, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0xc00, n_channels=2, override_map=yes
D: [alsa-sink] alsa-mixer.c: Element Center, direction=1, switch=1, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x4900000000018, n_channels=1, override_map=yes
D: [alsa-sink] alsa-mixer.c: Element LFE, direction=1, switch=1, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x80, n_channels=1, override_map=yes
D: [alsa-sink] alsa-mixer.c: Element PCM, direction=1, switch=0, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x3600000000f66, n_channels=2, override_map=yes
D: [alsa-sink] alsa-mixer.c: Element IEC958, direction=1, switch=2, volume=0, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x0, n_channels=0, override_map=no
I: [alsa-sink] alsa-sink.c: Successfully enabled deferred volume.
I: [alsa-sink] alsa-sink.c: Hardware volume ranges from -179.00 dB to 0.00 dB.
I: [alsa-sink] alsa-sink.c: Fixing base volume to 0.00 dB
I: [alsa-sink] alsa-sink.c: Using hardware volume control. Hardware dB scale supported.
I: [alsa-sink] alsa-sink.c: Using hardware mute control.
I: [pulseaudio] sink.c: Changed port of sink 0 "alsa_output.pci-0000_00_14.2.analog-stereo" to analog-output
I: [pulseaudio] module-device-restore.c: Restoring volume for sink alsa_output.pci-0000_00_14.2.analog-stereo.
D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
D: [alsa-sink] alsa-sink.c: Requested volume: 0:  67% 1:  67%
D: [alsa-sink] alsa-sink.c:            in dB: 0: -10.44 dB 1: -10.44 dB
D: [alsa-sink] alsa-sink.c: Got hardware volume: 0:  67% 1:  67%
D: [alsa-sink] alsa-sink.c:               in dB: 0: -10.40 dB 1: -10.40 dB
D: [alsa-sink] alsa-sink.c: Calculated software volume: 0: 100% 1: 100% (accurate-enough=yes)
D: [alsa-sink] alsa-sink.c:                      in dB: 0: -0.04 dB 1: -0.04 dB
D: [alsa-sink] sink.c: Volume going up to 43909 at 1966675250
I: [pulseaudio] module-device-restore.c: Restoring mute state for sink alsa_output.pci-0000_00_14.2.analog-stereo.
D: [alsa-sink] sink.c: Volume change to 32182 at 1966637933 was written 80 usec late
D: [alsa-sink] alsa-sink.c: Written HW volume did not match with the request: 0:  49% 1:  49% (request) != 0:  48% 1:  48%
D: [alsa-sink] alsa-sink.c:                                            in dB: 0: -18.53 dB 1: -18.53 dB (request) != 0: -19.00 dB 1: -19.00 dB
D: [alsa-sink] sink.c: Volume change to 43909 at 1966675250 was written 24 usec late

My ALSA info: http://pastebin.com/L8JuRfNL

Any idea how what might cause this and how it can be resolved?

Offline

#2 2012-08-17 11:31:24

blux
Member
Registered: 2012-08-17
Posts: 17

Re: Pulseaudio incorrectly detects a headphone being plugged in

After a PulseAudio discussion hinted me in the direction of commenting out:

load-module module-switch-on-port-available

in /etc/pulse/default.pa, the stutter at least is gone. The PulseAudio log still shows a lot of incorrect jack detection events:

D: [pulseaudio] module-alsa-card.c: Jack 'Front Headphone Jack' is now plugged in
D: [pulseaudio] device-port.c: Setting port analog-output-headphones to status yes
D: [pulseaudio] module-alsa-card.c: Jack 'Front Headphone Jack' is now unplugged
D: [pulseaudio] device-port.c: Setting port analog-output-headphones to status no
D: [pulseaudio] module-alsa-card.c: Jack 'Front Headphone Jack' is now plugged in
D: [pulseaudio] device-port.c: Setting port analog-output-headphones to status yes
D: [pulseaudio] module-alsa-card.c: Jack 'Front Headphone Jack' is now unplugged
D: [pulseaudio] device-port.c: Setting port analog-output-headphones to status no
D: [pulseaudio] module-alsa-card.c: Jack 'Front Headphone Jack' is now plugged in
D: [pulseaudio] device-port.c: Setting port analog-output-headphones to status yes

This does not feel like a proper solution, but I'm happy the stuttering is gone smile

Offline

Board footer

Powered by FluxBB