Hi Michael,
By default the ‘Speakers (tegra-rt5639)’ should be the default playback device (as per the configuration in /etc/asound.conf). Regardless of whether anything is connected to the audio jack.
I understand that you wish to use the jack event to set the playback device, however, what I don’t understand is what devices you are trying to switch between? In other words, when there is nothing connected to the audio jack, what do you want the default playback device to be?
One thing that I have observed is that despite the interrupt occurring on insertion/removal, I see that the status or availability is not seen by pulseaudio …
$ pacmd list-sinks
>>> 1 sink(s) available.
* index: 0
name: <alsa_output.platform-tegra-snd-rt5639.0.analog-stereo>
...
ports:
analog-output-speaker: Speakers (priority 10000, latency offset 0 usec, <b>available: unknown)</b>
properties:
device.icon_name = "audio-speakers"
active port: <analog-output-speaker>
And looking the pulseaudio log at start-up I see …
$ pulseaudio -k ; pulseaudio -vvvv 2>&1 | grep Jack
E: [pulseaudio] main.c: Failed to kill daemon: No such process
[1]+ Exit 1 pulseaudio -vvvv
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Front Mic Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Front Mic Phantom Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of element 'Mic Jack Mode' succeeded (volume=0, switch=0, enumeration=0).
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Rear Mic Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Rear Mic Phantom Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of element 'Mic Jack Mode' succeeded (volume=0, switch=0, enumeration=0).
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Mic Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Dock Mic Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Front Mic Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Rear Mic Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Internal Mic Phantom Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of element 'Mic Jack Mode' succeeded (volume=0, switch=0, enumeration=0).
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Dock Mic Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Dock Mic Phantom Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of element 'Mic Jack Mode' succeeded (volume=0, switch=0, enumeration=0).
D: [pulseaudio] alsa-mixer.c: Probe of element 'Mic Jack Mode' succeeded (volume=0, switch=0, enumeration=0).
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Mic Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Mic Phantom Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of element 'Mic Jack Mode' succeeded (volume=0, switch=0, enumeration=0).
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Line Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Line Phantom Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of element 'Mic Jack Mode' succeeded (volume=0, switch=0, enumeration=0).
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Headset Mic Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Headset Mic Phantom Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Headphone Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Headphone Mic Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of element 'Mic Jack Mode' succeeded (volume=0, switch=0, enumeration=0).
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Headphone Mic Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of element 'Mic Jack Mode' succeeded (volume=0, switch=0, enumeration=0).
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Line Out Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Line Out Phantom Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Headphone Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Front Headphone Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Speaker Phantom Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Front Headphone Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Front Headphone Phantom Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Headphone Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Headphone Phantom Jack' succeeded (not found)
D: [pulseaudio] alsa-mixer.c: Probe of jack 'Headphone Mic Jack' succeeded (not found)
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
D: [pulseaudio] alsa-mixer.c: Jack Speaker Phantom, alsa_name='Speaker Phantom Jack', detection unavailable
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
D: [pulseaudio] alsa-mixer.c: Jack Speaker Phantom, alsa_name='Speaker Phantom Jack', detection unavailable
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
D: [pulseaudio] alsa-mixer.c: Jack Speaker Phantom, alsa_name='Speaker Phantom Jack', detection unavailable
Looks like the name is prefixed with the machine driver name so I believe this is ok but I need to check …
$ cat /sys/devices/platform/tegra-snd-rt5639.0/sound/card1/input0/name
tegra-rt5639 Headphone Jack
The sysfs shows the above input is not ‘enabled’ but enabling it does not appear to have any impact.
I need to check how well the Jack detection works, but if you can let me know exactly what you are trying to do, then we can figure it out.
Regards
Jon