Audio defaults to Speaker - built-in audio on reboot

rather than Handset - built-in audio. This is bare bones, nothing else than charger or laptop dock connected to the USB or headphone jack.

This is a recent behaviour I haven’t observed until about a week ago. It is rather problematic with Calls, as the Speaker button doesn’t seem to work for me.

Anyone else experiencing this?

Ok, I would like to sort this out with someone knowledgeable:
Without any headset connected, there are two sound cards on the system:

~$ pactl list short cards
0	alsa_card.platform-sound	module-alsa-card.c
1	alsa_card.platform-sound-wwan	module-alsa-card.c

The default one being index: 0 as seen below

~$ pacmd list-sinks | grep -e name: -e index -e description -e muted
  * index: 0
	name: <alsa_output.platform-sound.HiFi__hw_L5__sink>
	muted: no
		device.profile.description = "Headphones + Speaker + Handset"
		device.description = "Inbyggt ljud Headphones + Speaker + Handset"
    index: 1
	name: <alsa_output.platform-sound-wwan.stereo-fallback>
	muted: no
		device.profile.description = "Stereo"
		device.description = "Modem Stereo"

Connecting the USB headset adds a third one:

2	alsa_card.usb-Generic_USB_Audio-00	module-alsa-card.c

and the default card switches to it.

  * index: 2
	name: <alsa_output.usb-Generic_USB_Audio-00.analog-stereo>
	muted: no
		device.profile.description = "Analog stereo"
		device.description = "USB Audio Analog stereo"

Looking into the configs for pulseaudio, you could wonder why the USB Audio is the default for both audio and mic?

~/.config/pulse$ cat 9b43caf3619f49f8ba467ec270970f44-default-sink
alsa_output.usb-Generic_USB_Audio-00.analog-stereo

~/.config/pulse$ cat 9b43caf3619f49f8ba467ec270970f44-default-source
alsa_input.usb-Generic_USB_Audio-00.analog-stereo

I don’t know if this confuses pulseaudio to use the Speaker instead of Handset, when no USB headset is available. It seems to me that more is going on when it comes to audio on the Librem 5 than meets the eye.

I would be very happy if someone could shed some light on this subject, and maybe also how pulseaudio should be tweaked for one of the most important tasks of the device, namely phone calls.

I don’t know if this confuses pulseaudio to use the Speaker instead of Handset

Confuses? PulseAudio is supposed to default to Speaker and only use Handset when requested (usually by Calls through callaudiod). This sounds like correct behavior.

This is what has failed for me recently. With incoming calls, I get the audio through the Speaker, and the Speaker button in Calls has no effect.

That sounds like the actual issue - when starting a call, the profile should automatically switch to Handset, and switch back to Speaker after pressing the button. Is callaudiod complaining about anything in logs?

Nothing in sudo dmesg | grep -i callaudiod

Just tried an incoming call, and despite having set audio to Handset in the settings, audio got routed through Speakers in Calls. This time, however, I was able to get audio to the Handset by pressing the Speaker button twice. Call audio for at the other end was, as usual I’m afraid, horrible. That is a mic issue, but seems almost impossible to get right.

Nothing in sudo dmesg | grep -i callaudiod

You’re not going to see anything interesting in the kernel log. Use journalctl.

~$ sudo journalctl | grep -i callaudiod
dec 01 17:32:34 pureos callaudiod[1662]: no available input found!
dec 01 17:39:49 pureos callaudiod[1662]: no available input found!
dec 01 17:43:35 pureos callaudiod[1662]: no available input found!
dec 01 17:44:01 pureos callaudiod[1662]: no available input found!
dec 01 18:17:09 pureos callaudiod[1662]: Error in PulseAudio context: Connection terminated
dec 01 18:17:09 pureos callaudiod[1662]: no available input found!
dec 01 18:17:09 pureos callaudiod[1662]: no available input found!
dec 01 18:17:09 pureos callaudiod[1662]: no available output found!
dec 01 18:17:09 pureos callaudiod[1662]: no available input found!
dec 01 18:20:00 pureos callaudiod[1662]: Error in PulseAudio context: Connection terminated
dec 01 18:20:02 pureos callaudiod[1662]: no available input found!

Being confused myself, was so focused on phone calls. Not using phone much to listen to other audio streams…

@dos
I get these errors with callaudiod with every phone call, incoming our outgoing. Is it something that needs further investigation or just to be ignored?

dec 01 17:32:34 pureos callaudiod[1662]: no available input found!
dec 01 17:39:49 pureos callaudiod[1662]: no available input found!
dec 01 17:43:35 pureos callaudiod[1662]: no available input found!
dec 01 17:44:01 pureos callaudiod[1662]: no available input found!
dec 01 18:17:09 pureos callaudiod[1662]: Error in PulseAudio context: Connection terminated
dec 01 18:17:09 pureos callaudiod[1662]: no available input found!
dec 01 18:17:09 pureos callaudiod[1662]: no available input found!
dec 01 18:17:09 pureos callaudiod[1662]: no available output found!
dec 01 18:17:09 pureos callaudiod[1662]: no available input found!
dec 01 18:20:00 pureos callaudiod[1662]: Error in PulseAudio context: Connection terminated
dec 01 18:20:02 pureos callaudiod[1662]: no available input found!
dec 02 06:38:14 pureos callaudiod[1662]: Error in PulseAudio context: Connection terminated
dec 02 06:38:22 pureos callaudiod[1662]: no available input found!
dec 02 06:38:51 pureos callaudiod[1662]: Error in PulseAudio context: Connection terminated
dec 02 06:38:59 pureos callaudiod[1662]: no available input found!
dec 02 09:34:05 pureos callaudiod[1662]: Error in PulseAudio context: Connection terminated
dec 02 09:34:06 pureos callaudiod[1662]: no available input found!
dec 02 10:38:01 pureos callaudiod[1662]: no available input found!
dec 02 10:38:01 pureos callaudiod[1662]: no available output found!
dec 02 10:38:01 pureos callaudiod[1662]: no available input found!
dec 02 10:41:14 pureos callaudiod[1662]: no available input found!
dec 02 10:41:14 pureos callaudiod[1662]: no available output found!
dec 02 10:41:14 pureos callaudiod[1662]: no available input found!

I’m going to ask a related but different question related to the sound from the Librem 5. Is there a way to get sound to play through my attached nextdock instead of the phone speaker? I just assumed it would do that but I can’t see where to enable that.

I experienced something similar and created this issue.