[SOLVED] Default Sound device keeps changing

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
LostAndDazed

[SOLVED] Default Sound device keeps changing

Post by LostAndDazed »

Hi, I suspect this is an underlying Ubuntu issue, but if my 19.1+Cinnamon screen saver kicks in, when I next use Mint it has reset the default sound card from the HDMI back to the internal card, so no video sound. I am changing this back to HDMI about ten times a day. :cry:

I recall this same problem when I was using Ubuntu 16 way back when, but thought Mint would have it fixed by now. Many Updates and Upgrades and still it happens.

How can I force Mint/Ubuntu/Whatever to leave my choice of Sound device alone?

Thanks
Last edited by LostAndDazed on Sun Feb 24, 2019 5:04 pm, edited 1 time in total.
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Default Sound device keeps changing

Post by MrEen »

Hi LostAndDazed.

As long as your internal sound card and HDMI sound card are different devices, this should be a piece of cake. The output of running aplay -l in the terminal will answer that question. If there are multiple card numbers, you should be good to try what's next.

Install and run PulseAudio Volume Control (pavucontrol.) On the Output Devices tab click on the check mark next to the HDMI port to make it the default (fallback) device. That should deselect the onboard card from being the default device.

If you never use the onboard sound card at all or extremely rarely, you can set it to Off on the Configuration tab of pavucontrol.

Hope that helps.
LostAndDazed

Re: Default Sound device keeps changing

Post by LostAndDazed »

MrEen wrote: Wed Feb 20, 2019 7:18 pm The output of running aplay -l in the terminal will answer that question. If there are multiple card numbers
Thanks for your reply, but it does not look promising.
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC271X Analog [ALC271X Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
I installed pavucontrol and there is only one device shown at a time in "Output" tab. The drop down at the bottom was showing "All output devices." I went to the "Configuration" tab and selected "Output HDMI" and then back to the "Output" tab and it showed the HDMI option there, but at no time was I able to check or uncheck for **any** output options. I could not even "Lock" or "Unlock" the channels. I tried using sudo to launch pavucontrol from the CLI but still the same.

Could 19.1 have an "improved" process here? :D :shock:

ETA: I am OK with totally disabling the internal card it is never used on this laptop.
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Default Sound device keeps changing

Post by MrEen »

Ok, HDMI is on the same card number. We can still set this up properly but I need a little more info. Start a song or video while everything is working properly, then in the terminal run pacmd list-sinks and paste the output back here.
LostAndDazed

Re: Default Sound device keeps changing

Post by LostAndDazed »

MrEen wrote: Fri Feb 22, 2019 4:37 pm pacmd list-sinks
Hi, thanks for hanging in there with this.

Code: Select all

:~$ pacmd list-sinks
1 sink(s) available.
  * index: 8
	name: <alsa_output.pci-0000_00_1b.0.hdmi-stereo>
	driver: <module-alsa-card.c>
	flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: RUNNING
	suspend cause: 
	priority: 9030
	volume: front-left: 35390 /  54% / -16.06 dB,   front-right: 35390 /  54% / -16.06 dB
	        balance 0.00
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 24.87 ms
	max request: 4 KiB
	max rewind: 64 KiB
	monitor source: 8
	sample spec: s16le 2ch 48000Hz
	channel map: front-left,front-right
	             Stereo
	used by: 1
	linked by: 1
	configured latency: 25.00 ms; range is 0.50 .. 341.33 ms
	card: 0 <alsa_card.pci-0000_00_1b.0>
	module: 7
	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 Intel PCH"
		alsa.long_card_name = "HDA Intel PCH at 0xc0610000 irq 31"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:00:1b.0"
		sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "1e20"
		device.product.name = "7 Series/C216 Chipset Family High Definition Audio Controller"
		device.form_factor = "internal"
		device.string = "hdmi:0"
		device.buffering.buffer_size = "65536"
		device.buffering.fragment_size = "32768"
		device.access_mode = "mmap+timer"
		device.profile.name = "hdmi-stereo"
		device.profile.description = "Digital Stereo (HDMI)"
		device.description = "Built-in Audio Digital Stereo (HDMI)"
		alsa.mixer_name = "Realtek ALC271X"
		alsa.components = "HDA:10ec0269,10250743,00100100 HDA:80862806,80860101,00100000"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	ports:
		hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: yes)
			properties:
				device.icon_name = "video-display"
				device.product.name = "ASUS VS239"
	active port: <hdmi-output-0>
:~$ 
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Default Sound device keeps changing

Post by MrEen »

This should keep your default on HDMI:

In the terminal type xed admin:///etc/pulse/default.pa and scroll to the bottom of the file and change this:

Code: Select all

### Make some devices default
#set-default-sink output
#set-default-source input
to this:

Code: Select all

### Make some devices default
set-default-sink alsa_output.pci-0000_00_1b.0.hdmi-stereo
#set-default-source input
Please note the comment (#) has been removed from the beginning of the line. Save the file, then run pulseaudio -k in the terminal and you should be all fixed.
LostAndDazed

Re: Default Sound device keeps changing

Post by LostAndDazed »

MrEen wrote: Sat Feb 23, 2019 3:00 pm This should keep your default on HDMI:
Great, thanks I have just done that. I now need to wait until the screen saver kicks in as it was only happening after that.

Will get back to you either way. Thank you for taking the time, it is very much appreciated.
LostAndDazed

[SOLVED] Re: Default Sound device keeps changing

Post by LostAndDazed »

MrEen wrote: Sat Feb 23, 2019 3:00 pm run pulseaudio -k in the terminal and you should be all fixed.
And, quite correct you are! Great, that seems to have finally fixed that. I have lived with it for years and after changing to Mint a few months back I realized just how staid ubuntu had become. I am being spoiled by Mint/Cinnamon and that has taught me to expect better and now I have it. Again, thank you very much!
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: [SOLVED] Default Sound device keeps changing

Post by MrEen »

That's great LostAndDazed. I'm happy I could help. :D
LostAndDazed

Re: [SOLVED] Default Sound device keeps changing

Post by LostAndDazed »

MrEen wrote: Sun Feb 24, 2019 5:05 pm That's great LostAndDazed. I'm happy I could help. :D
AAAARRRGGGGGHHH -- replied too soon! Started up this morning and it is back to the internal board. Oh, well, at least it seems to be fixed for after the screen saver kicks in. I will only have to reset it once a day.
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: [SOLVED] Default Sound device keeps changing

Post by MrEen »

There are a few possibilities causing that. The graphics card may not have finished initializing before pulseaudio was setting the default (which wasn't yet present.) Or maybe for some reason, before shutting down, the file that ends with -default-sink in ~/.config/pulse was overwritten with the onboard card which will take precedence over /etc/pulse/default.pa I believe. Or, it may have been Gremlins. :wink:
LostAndDazed

Re: [SOLVED] Default Sound device keeps changing

Post by LostAndDazed »

MrEen wrote: Mon Feb 25, 2019 3:04 pm Or, it may have been Gremlins. :wink:
Might have to go with them! This morning it is set at the HDMI for default. Beats me. Yesterday after your last post I checked the date stamp on that "-default-sink" file and it was 3:15pm. Something happened at that time, but no idea if it was the screen saver kicking in or what. I will watch it closely today and see if I can see what's what.
ouck

Re: Default Sound device keeps changing

Post by ouck »

MrEen wrote: Sat Feb 23, 2019 3:00 pm This should keep your default on HDMI:
Thank you MrEen! I have many audio devices and you help me to set a default one.

Mint has no solution for that or is it a bug ? (Mint 20 Cinnamon)
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: [SOLVED] Default Sound device keeps changing

Post by MrEen »

Hi ouck,

The only other solution that I know of (barring the use of a .asoundrc file that I don't recommend) is to use PulseAudio Volume Control (pavucontrol) and click on the check mark for the appropriate device on the Output Devices tab. But sometimes, especially when HDMI is involved, it's best to set it the way it was done up above, if you always want a specific device to be the default.
SolidState
Level 1
Level 1
Posts: 42
Joined: Wed Nov 14, 2018 9:06 pm

Re: [SOLVED] Default Sound device keeps changing

Post by SolidState »

@MrEen
I have the same problem with an intel based sound device. I followed your reciepe installing the pavucontrol utilities, and the other steps but over a powercycle, the default device always comes up as the analog input rather than what I try to force, hdmi. If I use suspend it usually sticks to that hdmi setting.

The machine is a mini, tiny atx box found on aliexpress, like 3x5" with an N2930 mobile processor. So for all intents and purposes it's a laptop motherboard afaik.

I wonder if there is a way to pass parameters to the sound modules so as to not activate the analog in/out portion of the device. I tried tinkering in the CMOS but it seems to be an all or nothing affair. Looking at the modules but haven't seen any clues so far.

How 'bout dem modules?

cheers

SS
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: [SOLVED] Default Sound device keeps changing

Post by MrEen »

Hi SolidState,

Let's see the output of pacmd list-cards to see how we might try going about stopping this.
SolidState
Level 1
Level 1
Posts: 42
Joined: Wed Nov 14, 2018 9:06 pm

Re: [SOLVED] Default Sound device keeps changing

Post by SolidState »

Thanks for taking a look chief!

Code: Select all

1 card(s) available.
    index: 0
	name: <alsa_card.pci-0000_00_1b.0>
	driver: <module-alsa-card.c>
	owner module: 7
	properties:
		alsa.card = "0"
		alsa.card_name = "HDA Intel PCH"
		alsa.long_card_name = "HDA Intel PCH at 0xd0f10000 irq 97"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:00:1b.0"
		sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "0f04"
		device.product.name = "Atom Processor Z36xxx/Z37xxx Series High Definition Audio Controller"
		device.form_factor = "internal"
		device.string = "0"
		device.description = "Built-in Audio"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	profiles:
		input:analog-stereo: Analog Stereo Input (priority 65, available: no)
		output:analog-stereo: Analog Stereo Output (priority 6500, available: unknown)
		output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6565, available: no)
		output:iec958-stereo: Digital Stereo (IEC958) Output (priority 5500, available: unknown)
		output:iec958-stereo+input:analog-stereo: Digital Stereo (IEC958) Output + Analog Stereo Input (priority 5565, available: no)
		output:hdmi-stereo: Digital Stereo (HDMI) Output (priority 5900, available: unknown)
		output:hdmi-stereo+input:analog-stereo: Digital Stereo (HDMI) Output + Analog Stereo Input (priority 5965, available: no)
		off: Off (priority 0, available: unknown)
	active profile: <output:hdmi-stereo>
	sinks:
		alsa_output.pci-0000_00_1b.0.hdmi-stereo/#0: Built-in Audio Digital Stereo (HDMI)
	sources:
		alsa_output.pci-0000_00_1b.0.hdmi-stereo.monitor/#0: Monitor of Built-in Audio Digital Stereo (HDMI)
	ports:
		analog-input-front-mic: Front Microphone (priority 8500, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "audio-input-microphone"
		analog-input-rear-mic: Rear Microphone (priority 8200, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "audio-input-microphone"
		analog-output-lineout: Line Out (priority 9000, latency offset 0 usec, available: no)
			properties:
				
		analog-output-speaker: Speakers (priority 10000, latency offset 0 usec, available: unknown)
			properties:
				device.icon_name = "audio-speakers"
		analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "audio-headphones"
		iec958-stereo-output: Digital Output (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
			properties:
				
		hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: yes)
			properties:
				device.icon_name = "video-display"
				device.product.name = "SAMSUNG"
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: [SOLVED] Default Sound device keeps changing

Post by MrEen »

Okay, in the terminal run xed admin:///etc/pulse/default.pa and when the file opens add this to the bottom:

Code: Select all

set-card-profile alsa_card.pci-0000_00_1b.0 output:hdmi-stereo
Save the file, ignore any warnings in the terminal, then reboot to test if it worked.
SolidState
Level 1
Level 1
Posts: 42
Joined: Wed Nov 14, 2018 9:06 pm

Re: [SOLVED] Default Sound device keeps changing

Post by SolidState »

Three power cycles later and it holds the hdmi as the default! brilliant! I even deliberately set the device to the analog before each reboot, and it comes up HDMI on the restart.

This is a different line for default.pa than the earlier solution so I guess my case is not exactly the same. Works. Can't ask for more.

Kudos to you

Thank you chief!
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: [SOLVED] Default Sound device keeps changing

Post by MrEen »

I'm glad that worked. :D

Sometimes what seems to be the same issue can actually be quite different. As all your sound options were on one card, all we needed to do was set the correct profile. If your HDMI was on a separate card, then we'd want to set the default sink.
Locked

Return to “Beginner Questions”