Audio selection on booth up in ubuntu 22.04 with HDMI connected monitor

strong textHi everyone, I’m using Ubuntu 22.04 in a new mini pc and a 32inch monitor, every time I booth up I have no audio on the monitor. using settings I click HDMI and all ok till the next booth up.How can I get the HDMI setting to remain enabled on booth up? Thanks.

I think you’ll need to edit /etc/pulse/default.pa.
That’s a config file for pulseaudio, which it reads and acts according to, when you login, an pulseaudio starts in your user context.
I thin Id set the “default sink” in that file.
I thinkered a lot with PA when I created my Rpi based network audio, but memory is fadng, and I should dig into this again.
I’m on a phone now, so cannot dig :slight_smile:
So my advice for you is to look for settings in default.pa, and look for something default sink.
Later I can help more, if you don’t succeed.

1 Like

thanks for the reply Laszio, I don’t know how to get into default.pa and it’s settings, years ago we could get into pulse audio and do changes but that seems not to be the case anymore.Any help will be very appreciated.

1 Like

No problem :slight_smile:
Let me know the output of pactl list cards before you set the HDMI to be the output.
Then set it up as you do normally, so you get all sounds through your monitor…
After your sound works as you whish, run pactl list sinks and show me that output.
Let me know, how your default.pa looks now, so run
cat /etc/pulse/default.pa

And after seeing thos outputs, we’re going to scratch our heads :thinking:
Maybe I’ll have some idea?

Alright Laszio, here are the results.



Oh, don’t screenshot please!
I need the whole text…
So, after you ran the command, select the whole output in the terminal, copy to clipboard (ctrl-shift-C should work), paste here, and apply code formatting, alternatively paste the text on pastebin, and bring the link here.

2 Likes

Well Laszio, you totally lost me on that reply, sorry but I don’t have the knowledge needed for that, so maybe I will just keep using settings on booth up, although I do want to thank you for trying to help, but this is out of my league.

Hi raymond (@raymond),
don’t give up.
What László asked is easy.

Can you do this example?
You don’t have to answer…
Open a terminal and type in the command:

pactl list cards

and press enter.

Now select all the text that appears in the terminal and press Control+Shift+c keys to copy the text or place the mouse over the selected text, press the right key and choose “Copy”.

Then reply to the post, and in the area where you write the post, place the mouse arrow, press the right-hand key and choose “paste” or, if you want to use the keys, press Control+v keys

Example:
I selected all the text in the terminal, pressed the right mouse button and chose “Copy”:

image

Next, I went to It’s FOSS, replied to the post, put the mouse over the window to write the text of the post and pressed the right mouse button and chose “Paste”:

In short: I copied the text from the terminal to the post window.


If you want to try again and reply to László, reply in 3 posts:

1 -

2-

3 -

If you have any doubts, ask, but don’t give up

Jorge

1 Like

device.description = “Built-in Audio”
module-udev-detect.discovered = “1”
device.icon_name = “audio-card-pci”
Profiles:
input:analog-stereo: Analog Stereo Input (sinks: 0, sources: 1, priority: 32833, available: yes)
output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 39268, available: yes)
output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (sinks: 1, sources: 1, priority: 39333, available: yes)
off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
Active Profile: output:analog-stereo+input:analog-stereo
Ports:
analog-input-mic: Microphone (type: Mic, priority: 8700, latency offset: 0 usec, availability unknown)
Properties:
device.icon_name = “audio-input-microphone”
Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo
analog-output-lineout: Line Out (type: Line, priority: 9000, latency offset: 0 usec, availability unknown)
Part of profile(s): output:analog-stereo, output:analog-

1 Like

dev.id = “usb-0a12_Avantree_DG60_ABCDEF0123456789-00”
device.bus = “usb”
device.vendor.id = “0a12”
device.vendor.name = “Cambridge Silicon Radio, Ltd”
device.product.id = “1004”
device.product.name = “Avantree DG60”
device.serial = “0a12_Avantree_DG60_ABCDEF0123456789”
device.string = “front:2”
device.buffering.buffer_size = “384000”
device.buffering.fragment_size = “192000”
device.access_mode = “mmap+timer”
device.profile.name = “analog-stereo”
device.profile.description = “Analog Stereo”
device.description = “Avantree DG60 Analog Stereo”
module-udev-detect.discovered = “1”
device.icon_name = “audio-card-usb”
Ports:
analog-output: Analog Output (type: Analog, priority: 9900, availability unknown)
Active Port: analog-output
Formats:
pcm

1 Like

Block audio recording for snap confined packages unless they have

the “pulseaudio” or “audio-record” interfaces plugged.

.ifexists module-snap-policy.so
load-module module-snap-policy
.endif

Modules to allow autoloading of filters (such as echo cancellation)

on demand. module-filter-heuristics tries to determine what filters

make sense, and module-filter-apply does the heavy-lifting of

loading modules and rerouting streams.

load-module module-filter-heuristics
load-module module-filter-apply

Make some devices default

#set-default-sink output
#set-default-source input

Allow including a default.pa.d directory, which if present, can be used

for additional configuration snippets.

Note that those snippet files must have a .pa file extension, not .conf

.nofail

1 Like

Jorge, why is this different from screenshots ?

They still seem to be truncated. Let me do a video a about what I mean. 10 minutes please…

1 Like

Here will be the video, how I did it:

Let youtube finish processing it…

!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

# This startup script is used only if PulseAudio is started per-user
# (i.e. not in system mode)

.fail

### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore

### Automatically augment property information from .desktop files
### stored in /usr/share/application
load-module module-augment-properties

### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available

### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink

### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
.endif

### Automatically connect sink and source if JACK server is present
.ifexists module-jackdbus-detect.so
.nofail
load-module module-jackdbus-detect channels=2
.fail
.endif

### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif

.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif

load-module module-switch-on-connect

### Load several protocols
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix

### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#load-module module-native-protocol-tcp
#load-module module-zeroconf-publish

### Load the RTP receiver module (also configured via paprefs, see above)
#load-module module-rtp-recv

### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
#load-module module-rtp-send source=rtp.monitor

### Load additional modules from GSettings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
.ifexists module-gsettings.so
.nofail
load-module module-gsettings
.fail
.endif


### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore

### Automatically move streams to the default sink if the sink they are
### connected to dies, similar for sources
load-module module-rescue-streams

### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink

### Honour intended role device property
load-module module-intended-roles

### Automatically suspend sinks/sources that become idle for too long
load-module module-suspend-on-idle

### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
.ifexists module-console-kit.so
load-module module-console-kit
.endif
.ifexists module-systemd-login.so
load-module module-systemd-login
.endif

### Enable positioned event sounds
load-module module-position-event-sounds

### Cork music/video streams when a phone stream is active
#load-module module-role-cork

### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply

### Make some devices default
set-default-sink output
set-default-source input
#load-module module-zeroconf-discover
load-module module-tunnel-sink-new server=tcp:192.168.1.8:4713 sink_name=Butyok sink_properties=device.description='Hifi'
1 Like

Hi Raymond,
To answer your question: the text you’ve posted isn’t complete, it could be truncated, like László said.

Follow László’s video, which is excellent, to find out how to put the full text in the post.

Jorge

Perhaps it would be easier for @raymond to use the script command.
Do as follows

script outfile
then do your pactl commands
CTRL D

Then post the whole of outfile to @kovacslt

2 Likes

Another tip - AFTER you’ve posted your output into a reply, mouse select the text you just pasted then format it with the “</>” button on the forum’s (i.e. this page) formatting toolbar :


(the red circle)
And ONLY select the text you pasted - NOT the rest of your manually typed / written reply…

1 Like
device.description = "Built-in Audio"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	Profiles:
		input:analog-stereo: Analog Stereo Input (sinks: 0, sources: 1, priority: 32833, available: yes)
		output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 39268, available: yes)
		output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (sinks: 1, sources: 1, priority: 39333, available: yes)
		off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
	Active Profile: output:analog-stereo+input:analog-stereo
	Ports:
		analog-input-mic: Microphone (type: Mic, priority: 8700, latency offset: 0 usec, availability unknown)
			Properties:
				device.icon_name = "audio-input-microphone"
			Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo
		analog-output-lineout: Line Out (type: Line, priority: 9000, latency offset: 0 usec, availability unknown)
			Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo
ray@ray-laptop:~$
1 Like
ray@ray-laptop:~$  pactl list sinks
Sink #0
	State: SUSPENDED
	Name: alsa_output.pci-0000_00_01.1.hdmi-surround
	Description: Built-in Audio Digital Surround 5.1 (HDMI)
	Driver: module-alsa-card.c
	Sample Specification: s16le 6ch 44100Hz
	Channel Map: front-left,front-right,rear-left,rear-right,front-center,lfe
	Owner Module: 7
	Mute: no
	Volume: front-left: 23024 /  35% / -27.26 dB,   front-right: 23024 /  35% / -27.26 dB,   rear-left: 23024 /  35% / -27.26 dB,   rear-right: 23024 /  35% / -27.26 dB,   front-center: 23024 /  35% / -27.26 dB,   lfe: 23024 /  35% / -27.26 dB
	        balance 0.00
	Base Volume: 65536 / 100% / 0.00 dB
	Monitor Source: alsa_output.pci-0000_00_01.1.hdmi-surround.monitor
	Latency: 0 usec, configured 0 usec
	Flags: HARDWARE DECIBEL_VOLUME LATENCY 
	Properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "HDMI 0"
		alsa.id = "HDMI 0"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "3"
		alsa.card = "0"
		alsa.card_name = "HDA ATI HDMI"
		alsa.long_card_name = "HDA ATI HDMI at 0xfeb64000 irq 40"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:00:01.1"
		sysfs.path = "/devices/pci0000:00/0000:00:01.1/sound/card0"
		device.bus = "pci"
		device.vendor.id = "1002"
		device.vendor.name = "Advanced Micro Devices, Inc. [AMD/ATI]"
		device.product.id = "9840"
		device.product.name = "Kabini HDMI/DP Audio"
		device.form_factor = "internal"
		device.string = "hdmi:0"
		device.buffering.buffer_size = "1058304"
		device.buffering.fragment_size = "529152"
		device.access_mode = "mmap+timer"
		device.profile.name = "hdmi-surround"
		device.profile.description = "Digital Surround 5.1 (HDMI)"
		device.description = "Built-in Audio Digital Surround 5.1 (HDMI)"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	Ports:
		hdmi-output-0: HDMI / DisplayPort (type: HDMI, priority: 5900, available)
	Active Port: hdmi-output-0
	Formats:
		pcm

Sink #1
	State: SUSPENDED
	Name: alsa_output.usb-0a12_Avantree_DG60_ABCDEF0123456789-00.analog-stereo
	Description: Avantree DG60 Analog Stereo
	Driver: module-alsa-card.c
	Sample Specification: s16le 2ch 48000Hz
	Channel Map: front-left,front-right
	Owner Module: 8
	Mute: no
	Volume: front-left: 857 /   1% / -113.01 dB,   front-right: 857 /   1% / -113.01 dB
	        balance 0.00
	Base Volume: 65536 / 100% / 0.00 dB
	Monitor Source: alsa_output.usb-0a12_Avantree_DG60_ABCDEF0123456789-00.analog-stereo.monitor
	Latency: 0 usec, configured 0 usec
	Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY 
	Properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "USB Audio"
		alsa.id = "USB Audio"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "1"
		alsa.card_name = "Avantree DG60"
		alsa.long_card_name = "Avantree DG60 at usb-0000:00:12.0-2, full speed"
		alsa.driver_name = "snd_usb_audio"
		device.bus_path = "pci-0000:00:12.0-usb-0:2:1.0"
		sysfs.path = "/devices/pci0000:00/0000:00:12.0/usb1/1-2/1-2:1.0/sound/card1"
		udev.id = "usb-0a12_Avantree_DG60_ABCDEF0123456789-00"
		device.bus = "usb"
		device.vendor.id = "0a12"
		device.vendor.name = "Cambridge Silicon Radio, Ltd"
		device.product.id = "1004"
		device.product.name = "Avantree DG60"
		device.serial = "0a12_Avantree_DG60_ABCDEF0123456789"
		device.string = "front:1"
		device.buffering.buffer_size = "384000"
		device.buffering.fragment_size = "192000"
		device.access_mode = "mmap+timer"
		device.profile.name = "analog-stereo"
		device.profile.description = "Analog Stereo"
		device.description = "Avantree DG60 Analog Stereo"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-usb"
	Ports:
		analog-output: Analog Output (type: Analog, priority: 9900, availability unknown)
	Active Port: analog-output
	Formats:
		pcm

Sink #2
	State: SUSPENDED
	Name: alsa_output.pci-0000_00_14.2.analog-stereo
	Description: Built-in Audio Analog Stereo
	Driver: module-alsa-card.c
	Sample Specification: s16le 2ch 44100Hz
	Channel Map: front-left,front-right
	Owner Module: 9
	Mute: no
	Volume: front-left: 30419 /  46% / -20.00 dB,   front-right: 30419 /  46% / -20.00 dB
	        balance 0.00
	Base Volume: 65536 / 100% / 0.00 dB
	Monitor Source: alsa_output.pci-0000_00_14.2.analog-stereo.monitor
	Latency: 0 usec, configured 0 usec
	Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY 
	Properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "ALC662 rev1 Analog"
		alsa.id = "ALC662 rev1 Analog"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "2"
		alsa.card_name = "HD-Audio Generic"
		alsa.long_card_name = "HD-Audio Generic at 0xfeb60000 irq 16"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:00:14.2"
		sysfs.path = "/devices/pci0000:00/0000:00:14.2/sound/card2"
		device.bus = "pci"
		device.vendor.id = "1022"
		device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
		device.product.id = "780d"
		device.product.name = "FCH Azalia Controller"
		device.form_factor = "internal"
		device.string = "front:2"
		device.buffering.buffer_size = "352768"
		device.buffering.fragment_size = "176384"
		device.access_mode = "mmap+timer"
		device.profile.name = "analog-stereo"
		device.profile.description = "Analog Stereo"
		device.description = "Built-in Audio Analog Stereo"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	Ports:
		analog-output-lineout: Line Out (type: Line, priority: 9000, availability unknown)
	Active Port: analog-output-lineout
	Formats:
		pcm
2 Likes
ray@ray-laptop:~$ cat /etc/pulse/default.pa
#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

# This startup script is used only if PulseAudio is started per-user
# (i.e. not in system mode)

.fail

### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore

### Automatically augment property information from .desktop files
### stored in /usr/share/application
load-module module-augment-properties

### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available

### Use hot-plugged devices like Bluetooth or USB automatically (LP: #1702794)
.ifexists module-switch-on-connect.so
load-module module-switch-on-connect
.endif

### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink

### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
.endif

### Automatically connect sink and source if JACK server is present
.ifexists module-jackdbus-detect.so
.nofail
load-module module-jackdbus-detect channels=2
.fail
.endif

### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif

.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif

### Load several protocols
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix

### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#load-module module-native-protocol-tcp
#load-module module-zeroconf-publish

### Load the RTP receiver module (also configured via paprefs, see above)
#load-module module-rtp-recv

### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
#load-module module-rtp-send source=rtp.monitor

### Load additional modules from GSettings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
.ifexists module-gsettings.so
.nofail
load-module module-gsettings
.fail
.endif

### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore

### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink

### Honour intended role device property
load-module module-intended-roles

### Automatically suspend sinks/sources that become idle for too long
load-module module-suspend-on-idle

### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
.ifexists module-console-kit.so
load-module module-console-kit
.endif
.ifexists module-systemd-login.so
load-module module-systemd-login
.endif

### Enable positioned event sounds
load-module module-position-event-sounds

### Cork music/video streams when a phone stream is active
load-module module-role-cork

### Block audio recording for snap confined packages unless they have
### the "pulseaudio" or "audio-record" interfaces plugged.
.ifexists module-snap-policy.so
load-module module-snap-policy
.endif

### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply

### Make some devices default
#set-default-sink output
#set-default-source input

### Allow including a default.pa.d directory, which if present, can be used
### for additional configuration snippets.
### Note that those snippet files must have a .pa file extension, not .conf
.nofail
.i

nclude /etc/pulse/default.pa.d
r

1 Like