Sound settings keep switching output against my will

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
piso mojado
Level 2
Level 2
Posts: 72
Joined: Wed May 17, 2017 6:35 pm

Sound settings keep switching output against my will

Post by piso mojado »

First time Linux user running Mint 18.1 Cinnamon 64 bit onto an Intel NUC6CAY connected to a Samsung SP-R4232 via hdmi

After sleep or sometimes after restart, the output settings will switch themselves from "HDMI/DisplayPort Built-in Audio", which works, to "Analog Output Built-in Audio", which doesn't.

Please help.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Mint 21.2 Cinnamon 64 bit, kernel 5.15.0-91 on an Intel NUC6CAYH connected to a Samsung UN40EH5000FXZA via hdmi. Audio: Intel Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster
Hoser Rob
Level 20
Level 20
Posts: 11762
Joined: Sat Dec 15, 2012 8:57 am

Re: Sound settings keep switching output against my will

Post by Hoser Rob »

Try a look at this:

viewtopic.php?t=224479
For every complex problem there is an answer that is clear, simple, and wrong - H. L. Mencken
piso mojado
Level 2
Level 2
Posts: 72
Joined: Wed May 17, 2017 6:35 pm

Re: Sound settings keep switching output against my will

Post by piso mojado »

Thanks! I read through the thread. I have a number of questions. First, I'm not sure I have pulseaudio. Should I have it? I typed it into the search menu and couldn't find it. Neither could I find the ECT folder. I tried pasting the code IronRod suggested. The first result was this:

Code: Select all

pacmd list-cards
1 card(s) available.
    index: 0
	name: <alsa_card.pci-0000_00_0e.0>
	driver: <module-alsa-card.c>
	owner module: 6
	properties:
		alsa.card = "0"
		alsa.card_name = "HDA Intel PCH"
		alsa.long_card_name = "HDA Intel PCH at 0x91410000 irq 375"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:00:0e.0"
		sysfs.path = "/devices/pci0000:00/0000:00:0e.0/sound/card0"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "5a98"
		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 60, available: unknown)
		output:analog-stereo: Analog Stereo Output (priority 6000, available: unknown)
		output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6060, available: unknown)
		output:analog-surround-40: Analog Surround 4.0 Output (priority 700, available: unknown)
		output:analog-surround-40+input:analog-stereo: Analog Surround 4.0 Output + Analog Stereo Input (priority 760, available: unknown)
		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 5560, available: unknown)
		output:hdmi-stereo: Digital Stereo (HDMI) Output (priority 5400, available: unknown)
		output:hdmi-stereo+input:analog-stereo: Digital Stereo (HDMI) Output + Analog Stereo Input (priority 5460, available: unknown)
		output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (priority 5200, available: unknown)
		output:hdmi-stereo-extra1+input:analog-stereo: Digital Stereo (HDMI 2) Output + Analog Stereo Input (priority 5260, available: unknown)
		output:hdmi-surround-extra1: Digital Surround 5.1 (HDMI 2) Output (priority 100, available: unknown)
		output:hdmi-surround-extra1+input:analog-stereo: Digital Surround 5.1 (HDMI 2) Output + Analog Stereo Input (priority 160, available: unknown)
		output:hdmi-surround71-extra1: Digital Surround 7.1 (HDMI 2) Output (priority 100, available: unknown)
		output:hdmi-surround71-extra1+input:analog-stereo: Digital Surround 7.1 (HDMI 2) Output + Analog Stereo Input (priority 160, available: unknown)
		output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (priority 5200, available: unknown)
		output:hdmi-stereo-extra2+input:analog-stereo: Digital Stereo (HDMI 3) Output + Analog Stereo Input (priority 5260, available: unknown)
		output:hdmi-surround-extra2: Digital Surround 5.1 (HDMI 3) Output (priority 100, available: unknown)
		output:hdmi-surround-extra2+input:analog-stereo: Digital Surround 5.1 (HDMI 3) Output + Analog Stereo Input (priority 160, available: unknown)
		output:hdmi-surround71-extra2: Digital Surround 7.1 (HDMI 3) Output (priority 100, available: unknown)
		output:hdmi-surround71-extra2+input:analog-stereo: Digital Surround 7.1 (HDMI 3) Output + Analog Stereo Input (priority 160, available: unknown)
		off: Off (priority 0, available: unknown)
	active profile: <output:hdmi-stereo+input:analog-stereo>
	sinks:
		alsa_output.pci-0000_00_0e.0.hdmi-stereo/#8: Built-in Audio Digital Stereo (HDMI)
	sources:
		alsa_input.pci-0000_00_0e.0.analog-stereo/#1: Built-in Audio Analog Stereo
		alsa_output.pci-0000_00_0e.0.hdmi-stereo.monitor/#9: Monitor of Built-in Audio Digital Stereo (HDMI)
	ports:
		analog-input-internal-mic: Internal Microphone (priority 8900, latency offset 0 usec, available: unknown)
			properties:
				device.icon_name = "audio-input-microphone"
		analog-input-mic: Microphone (priority 8700, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "audio-input-microphone"
		analog-output-headphones: Headphones (priority 9000, latency offset 0 usec, available: unknown)
			properties:
				device.icon_name = "audio-headphones"
		analog-output: Analog Output (priority 9900, latency offset 0 usec, available: unknown)
			properties:
				
		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 PDP"
		hdmi-output-1: HDMI / DisplayPort 2 (priority 5800, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "video-display"
		hdmi-output-2: HDMI / DisplayPort 3 (priority 5700, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "video-display"
The second thing gave me this result:

Code: Select all

pacmd set-card-profile 0 hdmi-stereo+input:analog-stereo
No such profile: hdmi-stereo+input:analog-stereo
I was concerned by the work of XeoNoX. It's dauntingly complex to me. He also mentions pulseaudio. And he says "force-reload will kill all running programs using the sound driver". So every time the computer goes to sleep, XeoNoX's code will force everything which makes noise to restart? That makes me uneasy. What will that do to a program like KODI? The whole point of my Linux box is to serve as an HTPC.

Please advise.
Mint 21.2 Cinnamon 64 bit, kernel 5.15.0-91 on an Intel NUC6CAYH connected to a Samsung UN40EH5000FXZA via hdmi. Audio: Intel Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster
piso mojado
Level 2
Level 2
Posts: 72
Joined: Wed May 17, 2017 6:35 pm

Re: Sound settings keep switching output against my will

Post by piso mojado »

Ok, now sound isn't working at all, even when I restart or change the settings. I think that code messed things up worse. How do I reverse it?
Mint 21.2 Cinnamon 64 bit, kernel 5.15.0-91 on an Intel NUC6CAYH connected to a Samsung UN40EH5000FXZA via hdmi. Audio: Intel Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster
piso mojado
Level 2
Level 2
Posts: 72
Joined: Wed May 17, 2017 6:35 pm

Re: Sound settings keep switching output against my will

Post by piso mojado »

The sound now turns itself off and on seemingly at random. Linux is so buggy!
Last edited by piso mojado on Sat Jun 03, 2017 1:56 pm, edited 1 time in total.
Mint 21.2 Cinnamon 64 bit, kernel 5.15.0-91 on an Intel NUC6CAYH connected to a Samsung UN40EH5000FXZA via hdmi. Audio: Intel Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster
User avatar
Flemur
Level 20
Level 20
Posts: 10097
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Sound settings keep switching output against my will

Post by Flemur »

piso mojado wrote:The sound now turns itself of and on seemingly at random. Linux is so buggy!
Linux audio is pretty bad. Even when it works (not the sound quality, the fact that audacity shows me about 50 inputs to select from, for an old, simple sound card with three inputs: mic, line, mix).
First, I'm not sure I have pulseaudio. Should I have it?
You probably do have pulseaudio.
Should you have it? I don't think so, which is why I always remove it. Others disagree.

If you don't have Cinnamon (the DE: poor design makes pulseaudio a requirement), try disabling or - gasp! - removing pulseaudio.
Then reboot. If you removed it and want it back, reinstall it.

If you still have problems:

Code: Select all

sudo dpkg-reconfigure alsa 
sudo dpkg-reconfigure alsa-base
sudo dpkg-reconfigure alsa-utils
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
piso mojado
Level 2
Level 2
Posts: 72
Joined: Wed May 17, 2017 6:35 pm

Re: Sound settings keep switching output against my will

Post by piso mojado »

Thank you very much for your reply! I do have Cinnamon. Mint 18.1 Cinnamon 64 bit, kernel 4.10.0-21 on an Intel NUC6CAYH connected to a Samsung SP-R4232 via hdmi. I've been toying with switching to XFCE because of the audio and because Cinnamon flat isn't working with with Kodi, which largely defeats its purpose for me. Something about "compositing manager is not supported." I'm just afraid of making things worse. Plus I had a friend spend an entire day set up my networking and I don't know if I can do it myself.
Mint 21.2 Cinnamon 64 bit, kernel 5.15.0-91 on an Intel NUC6CAYH connected to a Samsung UN40EH5000FXZA via hdmi. Audio: Intel Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster
piso mojado
Level 2
Level 2
Posts: 72
Joined: Wed May 17, 2017 6:35 pm

Re: Sound settings keep switching output against my will

Post by piso mojado »

Just spent another hour going through this thread, copying and pasting and getting error messages. No luck. It's terrifying; I have no idea what I'm doing. The 18.1 release notes suggest installing "pavucontrol", but it doesn't exist in the Software Manager".
Mint 21.2 Cinnamon 64 bit, kernel 5.15.0-91 on an Intel NUC6CAYH connected to a Samsung UN40EH5000FXZA via hdmi. Audio: Intel Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster
hrmcrm

Re: Sound settings keep switching output against my will

Post by hrmcrm »

piso mojado wrote:"pavucontrol", but it doesn't exist in the Software Manager".
I just searched for pavu in Mint 18.1 KDE kernel 4.4.0-78 Software Manager and it found pavucontrol.
piso mojado
Level 2
Level 2
Posts: 72
Joined: Wed May 17, 2017 6:35 pm

Re: Sound settings keep switching output against my will

Post by piso mojado »

I figured out how to install Pavucontrol. It's nice, but not a panacea. Intermittent audio trouble persists which Pavucontrol doesn't solve. I'm considering trying out different kernels, but not sure which ones to try.
Mint 21.2 Cinnamon 64 bit, kernel 5.15.0-91 on an Intel NUC6CAYH connected to a Samsung UN40EH5000FXZA via hdmi. Audio: Intel Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster
User avatar
Flemur
Level 20
Level 20
Posts: 10097
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Sound settings keep switching output against my will

Post by Flemur »

piso mojado wrote:I figured out how to install Pavucontrol. It's nice, but not a panacea. Intermittent audio trouble persists which Pavucontrol doesn't solve. I'm considering trying out different kernels, but not sure which ones to try.
Re your original problem,
After sleep or sometimes after restart, the output settings will switch themselves from "HDMI/DisplayPort Built-in Audio", which works, to "Analog Output Built-in Audio", which doesn't.
Perhaps this is a bit complicated for a beginner, but you might check the command "amixer"; I run a script that sets the audio to sensible values at login, like:

Code: Select all

amixer set 'Master',0        25%  unmute
amixer set 'Headphone',0    100%  unmute
...
amixer set 'Surround'        0 mute
But I'm not sure if you can change the output device (I only have one). The syntax for some of the commands/settings is a bit funky. "man amixer" tells more, also internet examples help.

Anyway, just running

Code: Select all

amixer
gives tons of output.

Here's what I'd try:
- when the audio is working, do

Code: Select all

amixer > ~/works.txt
(writes output to a file called "$HOME/works.txt")
Then when the audio is not working, do

Code: Select all

amixer > ~/broken.txt
Then (the "~/" part just means "under $HOME directory").

Code: Select all

diff works.txt broken.txt 
will list what is different. Then you could *possibly* set up a script, using amixer to set output, etc, to set it back the way it should be.

Edit:
Install "qasmixer" :

Code: Select all

sudo apt-get install qasmixer
- it's similar to alsamixer but much better. You can select your output device with it:
qasmixer -> View -> "Show device selection" (should show a list on the left side of the GUI).
Perhaps at worst you'd need to start qasmixer and reset the output device after sleep/reboot.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
piso mojado
Level 2
Level 2
Posts: 72
Joined: Wed May 17, 2017 6:35 pm

Re: Sound settings keep switching output against my will

Post by piso mojado »

Thank you, Flemur, for continuing to try to help me. I've started to follow your instructions. I haven't had success yet finding a difference between works.txt and broken.txt -- I'll keep experimenting.

The situation with my audio continues to get stranger. Now for example, Firefox youtube audio works, but daily motion and others sites don't. Audio on Chrome doesn't work. "Media Player" audio works, but VLC doesn't. Restarting my system a few times usually temporarily fixes the problem.

I installed qasmixer, but haven't figured it out yet. None of my poking around has had any effect yet. When I click on the big blue sliders, I expect to hear audio feedback, but receive only silence.
Mint 21.2 Cinnamon 64 bit, kernel 5.15.0-91 on an Intel NUC6CAYH connected to a Samsung UN40EH5000FXZA via hdmi. Audio: Intel Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster
piso mojado
Level 2
Level 2
Posts: 72
Joined: Wed May 17, 2017 6:35 pm

Re: Sound settings keep switching output against my will

Post by piso mojado »

Today,

Code: Select all

diff works.txt broken.txt 
gave me this:

44c44
< Mono: Playback [on]
---
> Mono: Playback [off]

As before, the sound setting had changed itself from "HDMI/DisplayPort Built-in Audio" to "Analog Output Built-in Audio". Switching it back had no immediate effect.

I poked around in QasMixer, but couldn't find a Mono: Playback setting.

According to PulseAudio Volume control, my HDMI cable is unplugged. PAV is wrong about this.

Restarting three times brought audio back, which is typical of my Linux audio experience so far.
Mint 21.2 Cinnamon 64 bit, kernel 5.15.0-91 on an Intel NUC6CAYH connected to a Samsung UN40EH5000FXZA via hdmi. Audio: Intel Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster
User avatar
TeaSwigger
Level 3
Level 3
Posts: 132
Joined: Mon Feb 06, 2012 6:42 am
Location: CA

Re: Sound settings keep switching output against my will

Post by TeaSwigger »

No expert here either, but to try helping... Perhaps you could try this:

Create a file, /etc/asound.conf, with the following content:

Code: Select all

pcm.!default {
    type hw
    card HDMI
}

ctl.!default {
    type hw
    card HDMI
}
From your posts, it sounds as if the sound devices are being re-ordered randomly whenever the system is started or wakes. This may tell the principal sound system, ALSA, to use the HDMI as the default, regardless of the device order (you may then also need to set the sound applet(s) and/or players to use the HDMI as well). The qualifiers are: a) the HDMI may not be named HDMI on your system and b) I don't know if this will do with pulseaudio installed (I don't use pulseaudio, a mixer nor HDMI). To undo this change, it should suffice to simply delete that /etc/asound.conf file.

Since you're new to linux, I'll try to explain the steps in more detail in case it's helpful:

To create the file, open a terminal. You now need a) a text editor and b) root permissions. So you enter, for this example: gksu xed /etc/asound.conf, where 'gksu' is the preferred way to open a graphical app with root permissions, 'xed' is the text editor app and '/etc/asound.conf' means to open or create the file 'asound.conf' in the folder/directory 'etc'. You will be prompted to enter your password in a popup box. Then the text editor xed will open. You can paste or type in the code above, then save and close xed and the terminal; it should be applied right away and you probably don't need to reboot (though it wouldn't hurt; ALSA will detect the change but I don't know if, for instance, the mixer app will notice). You can use any text editor.

To remove the file if desired, one way is to open a terminal and enter sudo rm /etc/asound.conf , where in this example sudo is to assume root permission and rm is to remove. It is wise to only accept, use and enter any rm commands with the utmost care and caution. Mistakes, misuse or abuse can result in irreversable loss of data.

The reference for the code was here: https://wiki.archlinux.org/index.php/Ad ... chitecture . If you need to see a listing of the devices and names of the devices at any time, open the terminal and enter aplay -l and then aplay -L.

Here is what the outputs of: aplay -l and aplay -L look like for my system:

Code: Select all

me@mine ~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ST [Xonar ST], device 0: Multichannel [Multichannel]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: ST [Xonar ST], device 1: Digital [Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
and

Code: Select all

me@mine ~ $ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default
sysdefault:CARD=ST
    Xonar ST, Multichannel
    Default Audio Device
front:CARD=ST,DEV=0
    Xonar ST, Multichannel
    Front speakers
surround21:CARD=ST,DEV=0
    Xonar ST, Multichannel
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=ST,DEV=0
    Xonar ST, Multichannel
    4.0 Surround output to Front and Rear speakers
surround41:CARD=ST,DEV=0
    Xonar ST, Multichannel
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=ST,DEV=0
    Xonar ST, Multichannel
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=ST,DEV=0
    Xonar ST, Multichannel
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=ST,DEV=0
    Xonar ST, Multichannel
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=ST,DEV=0
    Xonar ST, Multichannel
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=ST,DEV=0
    Xonar ST, Multichannel
    Direct sample mixing device
dmix:CARD=ST,DEV=1
    Xonar ST, Digital
    Direct sample mixing device
dsnoop:CARD=ST,DEV=0
    Xonar ST, Multichannel
    Direct sample snooping device
dsnoop:CARD=ST,DEV=1
    Xonar ST, Digital
    Direct sample snooping device
hw:CARD=ST,DEV=0
    Xonar ST, Multichannel
    Direct hardware device without any conversions
hw:CARD=ST,DEV=1
    Xonar ST, Digital
    Direct hardware device without any conversions
plughw:CARD=ST,DEV=0
    Xonar ST, Multichannel
    Hardware device with all software conversions
plughw:CARD=ST,DEV=1
    Xonar ST, Digital
    Hardware device with all software conversions
hdmi:CARD=HDMI,DEV=0
    HDA ATI HDMI, HDMI 0
    HDMI Audio Output
dmix:CARD=HDMI,DEV=3
    HDA ATI HDMI, HDMI 0
    Direct sample mixing device
dsnoop:CARD=HDMI,DEV=3
    HDA ATI HDMI, HDMI 0
    Direct sample snooping device
hw:CARD=HDMI,DEV=3
    HDA ATI HDMI, HDMI 0
    Direct hardware device without any conversions
plughw:CARD=HDMI,DEV=3
    HDA ATI HDMI, HDMI 0
    Hardware device with all software conversions
In the aplay -l output, the HDMI after 'card 1:' shows that it's named the HDMI on my system as simply 'HDMI'. The aplay -L output may be useful, if for example, specifying the output for configuring some media players, should you get into that.

Hope this helps.
“You can make a strong business case for equality but not everyone wants to hear it.” - Prof. Kate Pickett

Mint 20.2 xfce w/nemo - AMD A10 7700K APU - spdif to Bifrost DAC - Dell U2415
some favs: Zim, deadbeef, kid3, gimp, artha, deluge, handbrake, mc
piso mojado
Level 2
Level 2
Posts: 72
Joined: Wed May 17, 2017 6:35 pm

Re: Sound settings keep switching output against my will

Post by piso mojado »

Before I ever got around to trying teaswigger's suggestions, I went into preferences/power management and set everything to "never". I haven't had audio trouble since.
Mint 21.2 Cinnamon 64 bit, kernel 5.15.0-91 on an Intel NUC6CAYH connected to a Samsung UN40EH5000FXZA via hdmi. Audio: Intel Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster
Locked

Return to “Sound”