Last year I purchased a Lenovo P620 with Ubuntu for use as my primary machine, and I’ve been pretty happy with it so far. It comes with a rear audio card, as one might expect, but also a separate, front audio card, that handles the headphone jack but also, curiously, contains a lo-fi speaker. My guess is that, as a workstation, having lo-fi onboard audio was good enough for most intended use-cases.

I use the rear audio ports with 2.1 desktop speakers, and have also invested in an external USB audio interface (the Motu M2) for recording audio and as my preferred headphone port. As such, I have no need for the front audio card at all.

Unfortunately, when Ubuntu boots, the front audio card is sometimes picked as the active device. This becomes an annoyance when I need to listen to something, and usually have to open up the sound settings to select the rear card. I also noticed during my probing of Pulseaudio that there is an audio card representing the HDMI output of my graphics card which I don’t use.

With multiple separate audio cards, it turns out that the key to disabling then is to select the off profile for cards we don’t care about. Note that when configuring Pulseaudio, one can specify the resource identifier (which is a long string), or the resource number (1, 2, etc.). Generally, I’ve found that using the resource identifier is far more durable.

First inspect the audio cards that Pulseaudio knows about:

$ pactl list cards

Card #0
	Name: alsa_card.usb-Generic_Realtek_USB_Audio_Front-00
	Driver: module-alsa-card.c
	Owner Module: 7
	Properties:
		alsa.card = "1"
		alsa.card_name = "ThinkStation P620 Main"
		alsa.long_card_name = "Lenovo-ThinkStation-P620-Main"
		alsa.driver_name = "snd_usb_audio"
		device.bus_path = "pci-0000:04:00.1-usb-0:1:1.0"
		sysfs.path = "/devices/pci0000:00/0000:00:03.1/0000:02:00.0/0000:03:08.0/0000:04:00.1/usb3/3-1/3-1:1.0/sound/card1"
		udev.id = "usb-Generic_Realtek_USB_Audio_Front-00"
		device.bus = "usb"
		device.vendor.id = "17aa"
		device.vendor.name = "Generic"
		device.product.id = "104d"
		device.product.name = "Realtek USB Audio Front"
		device.serial = "Generic_Realtek_USB_Audio_Front"
		device.string = "1"
		device.description = "Realtek USB Audio Front"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-usb"
	Profiles:
		HiFi: Default (sinks: 2, sources: 1, priority: 8000, available: yes)
		off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
	Active Profile: off
	Ports:
		[Out] Speaker: Speaker (priority: 100, latency offset: 0 usec, available)
			Part of profile(s): HiFi
		[Out] Headphones: Headphones (priority: 200, latency offset: 0 usec, not available)
			Part of profile(s): HiFi
		[In] Mic: Mic (priority: 200, latency offset: 0 usec, not available)
			Part of profile(s): HiFi

<snip>

Note the card name (alsa_card.usb-Generic_Realtek_USB_Audio_Front-00 in my case) and the Profiles section. Each card should have an off profile.

Then, for each card to be disabled, configure Pulseaudio to select the off profile:

# Superuser privileges are required to edit /etc/pulse/default.pa
sudo su -
echo 'set-card-profile alsa_card.usb-Generic_Realtek_USB_Audio_Front-00 off' >> /etc/pulse/default.pa
echo 'set-card-profile alsa_card.pci-0000_61_00.1 off' >> /etc/pulse/default.pa

With the configuration modified, restart Pulseaudio for the changes to take effect:

pulseaudio -k

With that, the available sinks (audio output ports) should only be the ones for the audio cards we care about (rear card in my case):

$ pactl list sinks short
0	alsa_output.usb-Generic_Realtek_USB_Audio_Rear-00.HiFi__hw_Rear__sink	module-alsa-card.c	s16le 2ch 44100Hz	RUNNING

I hope you found this helpful!