Sound settings keep switching output against my will

Questions about codecs, DVD playback, web plugins...
Forum rules
Before you post please read how to get help
Post Reply
piso mojado
Level 1
Level 1
Posts: 43
Joined: Wed May 17, 2017 6:35 pm

Sound settings keep switching output against my will

Post by piso mojado » Wed May 24, 2017 1:26 pm

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.
Mint 18.2 Cinnamon 64 bit, kernel 4.10.0-30 on an Intel NUC6CAYH connected to a Samsung SP-R4232 via hdmi

Hoser Rob
Level 12
Level 12
Posts: 4101
Joined: Sat Dec 15, 2012 8:57 am

Re: Sound settings keep switching output against my will

Post by Hoser Rob » Wed May 24, 2017 2:11 pm

Try a look at this:

viewtopic.php?t=224479

piso mojado
Level 1
Level 1
Posts: 43
Joined: Wed May 17, 2017 6:35 pm

Re: Sound settings keep switching output against my will

Post by piso mojado » Wed May 24, 2017 3:17 pm

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 18.2 Cinnamon 64 bit, kernel 4.10.0-30 on an Intel NUC6CAYH connected to a Samsung SP-R4232 via hdmi

piso mojado
Level 1
Level 1
Posts: 43
Joined: Wed May 17, 2017 6:35 pm

Re: Sound settings keep switching output against my will

Post by piso mojado » Mon May 29, 2017 4:12 pm

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 18.2 Cinnamon 64 bit, kernel 4.10.0-30 on an Intel NUC6CAYH connected to a Samsung SP-R4232 via hdmi

piso mojado
Level 1
Level 1
Posts: 43
Joined: Wed May 17, 2017 6:35 pm

Re: Sound settings keep switching output against my will

Post by piso mojado » Sat Jun 03, 2017 3:37 am

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 18.2 Cinnamon 64 bit, kernel 4.10.0-30 on an Intel NUC6CAYH connected to a Samsung SP-R4232 via hdmi

User avatar
Flemur
Level 16
Level 16
Posts: 6061
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Sound settings keep switching output against my will

Post by Flemur » Sat Jun 03, 2017 10:26 am

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?
Mint 18.3 Xfce/fluxbox/pulse-less
Xubuntu 17.10/fluxbox/pulse-less

piso mojado
Level 1
Level 1
Posts: 43
Joined: Wed May 17, 2017 6:35 pm

Re: Sound settings keep switching output against my will

Post by piso mojado » Sat Jun 03, 2017 2:09 pm

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 18.2 Cinnamon 64 bit, kernel 4.10.0-30 on an Intel NUC6CAYH connected to a Samsung SP-R4232 via hdmi

piso mojado
Level 1
Level 1
Posts: 43
Joined: Wed May 17, 2017 6:35 pm

Re: Sound settings keep switching output against my will

Post by piso mojado » Sat Jun 03, 2017 6:17 pm

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 18.2 Cinnamon 64 bit, kernel 4.10.0-30 on an Intel NUC6CAYH connected to a Samsung SP-R4232 via hdmi

hrmcrm
Level 4
Level 4
Posts: 227
Joined: Sun Jul 03, 2016 5:59 pm
Location: San Francisco

Re: Sound settings keep switching output against my will

Post by hrmcrm » Sat Jun 03, 2017 11:28 pm

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.
Howard
ThinkPads 310ED, 600E, T23, X41, X60, T61, X201, E550

piso mojado
Level 1
Level 1
Posts: 43
Joined: Wed May 17, 2017 6:35 pm

Re: Sound settings keep switching output against my will

Post by piso mojado » Fri Jun 16, 2017 12:42 pm

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 18.2 Cinnamon 64 bit, kernel 4.10.0-30 on an Intel NUC6CAYH connected to a Samsung SP-R4232 via hdmi

User avatar
Flemur
Level 16
Level 16
Posts: 6061
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Sound settings keep switching output against my will

Post by Flemur » Fri Jun 16, 2017 1:44 pm

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?
Mint 18.3 Xfce/fluxbox/pulse-less
Xubuntu 17.10/fluxbox/pulse-less

piso mojado
Level 1
Level 1
Posts: 43
Joined: Wed May 17, 2017 6:35 pm

Re: Sound settings keep switching output against my will

Post by piso mojado » Mon Jul 03, 2017 2:47 pm

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 18.2 Cinnamon 64 bit, kernel 4.10.0-30 on an Intel NUC6CAYH connected to a Samsung SP-R4232 via hdmi

piso mojado
Level 1
Level 1
Posts: 43
Joined: Wed May 17, 2017 6:35 pm

Re: Sound settings keep switching output against my will

Post by piso mojado » Thu Jul 13, 2017 9:48 pm

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 18.2 Cinnamon 64 bit, kernel 4.10.0-30 on an Intel NUC6CAYH connected to a Samsung SP-R4232 via hdmi

User avatar
TeaSwigger
Level 3
Level 3
Posts: 125
Joined: Mon Feb 06, 2012 6:42 am
Location: CA

Re: Sound settings keep switching output against my will

Post by TeaSwigger » Fri Jul 14, 2017 2:22 am

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.
Mint 18.3 xfce w/nemo - AMD Quad Core - lovely ASUS Xonar ST sound - Radeon R7 Graphics - 1920x1200 Dell U2415
some favs: Zim - mocp - kid3 - calibre - gimp - artha - deluge - handbrake - k3b - ClickRepair - mc
Folding@Home Mint Team Contributor

piso mojado
Level 1
Level 1
Posts: 43
Joined: Wed May 17, 2017 6:35 pm

Re: Sound settings keep switching output against my will

Post by piso mojado » Mon Aug 13, 2018 5:42 pm

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 18.2 Cinnamon 64 bit, kernel 4.10.0-30 on an Intel NUC6CAYH connected to a Samsung SP-R4232 via hdmi

Post Reply

Return to “Sound, Multimedia, & Codecs”