HDMI + Sound + Mint 18

Questions about codecs, DVD playback, web plugins...
Forum rules
Before you post please read how to get help
User avatar
janhostdk
Level 2
Level 2
Posts: 61
Joined: Wed Jun 29, 2016 5:01 am
Location: Dk

Re: HDMI + Sound + Mint 18

Postby janhostdk » Sun Feb 05, 2017 12:29 pm

Re banther
Hmm seems to work on ubuntu mate
but not on mint 18 mate for me..
Dell Vostro 270 4gb ram with Ubuntu 16.04 Mate LTS, Linux Mint 18 Sarah Mate, Win7

User avatar
janhostdk
Level 2
Level 2
Posts: 61
Joined: Wed Jun 29, 2016 5:01 am
Location: Dk

Re: HDMI + Sound + Mint 18

Postby janhostdk » Mon Feb 06, 2017 3:06 pm

Dang no luck !
doesnt help in ubuntu and mint mate 64 bit only temporary..
as soon as i switch resolution, play a dos game, sleepmode or screensaver starts, it deaults to analog output

tried cyb workarounds too, but no luck
Dell Vostro 270 4gb ram with Ubuntu 16.04 Mate LTS, Linux Mint 18 Sarah Mate, Win7

User avatar
janhostdk
Level 2
Level 2
Posts: 61
Joined: Wed Jun 29, 2016 5:01 am
Location: Dk

Re: HDMI + Sound + Mint 18

Postby janhostdk » Mon Feb 06, 2017 3:35 pm

So quickest way workaround for me is to have
A running terminal and when the sound defaults to analog
run the command - pacmd set-card-profile 0 output:hdmi-stereo in the terminal.
OR
run the command - pulseaudio -k
(have tried to disable the suspend-on-idle module in /etc/pulse/default.pa with no luck)

OR use the analog output instead of hdmi (an extra wire )

So where do i put this line :
set-card-profile 0 output:hdmi-stereo
So it will be permanent ??
Or is it possible to hide analog output so hdmi stays default ?

Looks to me the problem is sound properties defaults to analog and forgets if you try to change it to hdmi.
unless the graphic card can have infuence on sound ? then i have the problem with nvidia and intel cards..
Last edited by janhostdk on Sun Mar 05, 2017 10:25 am, edited 3 times in total.
Dell Vostro 270 4gb ram with Ubuntu 16.04 Mate LTS, Linux Mint 18 Sarah Mate, Win7

User avatar
janhostdk
Level 2
Level 2
Posts: 61
Joined: Wed Jun 29, 2016 5:01 am
Location: Dk

Re: HDMI + Sound + Mint 18

Postby janhostdk » Fri Feb 10, 2017 4:22 am

This is sad..I lost 2 Linux Wannabe's becourse of this problem, had to reinstall their windowz :'(
Untill i can get a fix for this I'm keeping my Linux entusiasme for myself..
Dell Vostro 270 4gb ram with Ubuntu 16.04 Mate LTS, Linux Mint 18 Sarah Mate, Win7

JSpeed
Level 1
Level 1
Posts: 8
Joined: Sat Dec 03, 2016 8:06 pm

Re: HDMI + Sound + Mint 18

Postby JSpeed » Sun Apr 02, 2017 5:18 pm

UPDATE: Linux Mint Cinnamon 18.2 causes additional problems. Use update for 18.2

I had the same issue and just finished a work-around just now.

First, try restarting Cinnamon "Ctrl+Alt+Esc" and see if audio starts working again. If it does, this work-around will work.
Suspend is a keyboard shortcut. Disable it and create a new one, running this command:

Code: Select all

bash -c "systemctl suspend && export DISPLAY=:0.0 && cinnamon --replace"


"systemctl suspend" will lock and suspend the computer.
"&&" will ensure the system suspended and resumed before running the next command.
"export DISPLAY=:0.0 && cinnamon --replace" will restart Cinnamon.
may need to run this as "export DISPLAY=:0.0 && cinnamon --replace &" for some reason unknown to me.

If all works properly, the audio should resume even before you log in. Leave music playing when you suspend to test.

JSpeed

UPDATE: Linux Mint Cinnamon 18.2 causes additional problems, Use update below for 18.2

Update: changed the code to switch audio to your HDMI output after reboot. Thanks to XeoNoX (below) for that command.

Code: Select all

bash -c "systemctl suspend && xrandr --output DVI-0 --set audio on"
Last edited by JSpeed on Wed Jul 05, 2017 8:50 pm, edited 4 times in total.

XeoNoX
Level 1
Level 1
Posts: 9
Joined: Thu Mar 24, 2016 9:32 pm

Re: HDMI + Sound + Mint 18

Postby XeoNoX » Sun Apr 09, 2017 12:38 am

1) If you re going to be using HDMI audio then Use default Radeon/Nvidia drivers as they are made for the kernel you are using so to keep things simple lets just stock to the STOCK,DEFUALT drivers and the LATEST KERNEL for your Release.

2)Also make sure you use just pulseaudio and alsa as they are better suited for HDMI Audio, if you use anything else it just makes a bigger headache/mess.

3)If you tried installing oos4 (not very good HDMI support) or a bunch of different sound drivers/managers they may be conflicting...so back to #2 which is....just use pulseaudio / pavucontrol and alsa and uninstall any other driver/audio manager you may have installed.

4) having both HMDI Audio enabled along with the soundcard and speakers plugged in at the same time may cause issues with sound reverting to main sound card. Solution can be to unplug the speakers/headphones from audio output and use just 1 source of audio out, or disable from bios, or you can also blacklist the unused sound device so it doesnt default back by blacklisting it from

Code: Select all

/etc/modprobe.d/
...i wont explain that...just google "modprobe blacklist sound" and while your at it make sure alsa / pulseaudio isnt blacklisted as i know OSS tends to blacklist it.

5) those with resolution changes then audio problem try

Code: Select all

aplay -l
after reading the output assuming HDMI 0 is your main audio run

Code: Select all

xrandr --output HDMI-0 --set audio on
seems like xandr is switching after resolution changes. if you research im sure there is a way to make xandr remember, i just dont remember off top of my head as my HDMI audio is fine after resolution changes/reboots, but then again i have my motherboard analog soundcard blacklisted.

6) last but not least after you have everything working and other sound devices blacklisted, lets make it stick and work out any kinks that may have happened while playing with other managers/drivers.

Code: Select all

sudo apt-get remove --purge alsa-base
sudo apt-get remove --purge pulseaudio
sudo apt-get install alsa-base
sudo apt-get install pulseaudio
sudo alsa force-reload


7) run

Code: Select all

pavucontrol
and should be good to go

JSpeed
Level 1
Level 1
Posts: 8
Joined: Sat Dec 03, 2016 8:06 pm

Re: HDMI + Sound + Mint 18

Postby JSpeed » Sun Apr 09, 2017 6:00 pm

You may have missed the issue I'm having.

The audio does not switch to the "Built-in Audio" device on my computer, but the "RS780 HDMI Audio [Radeon (HD) 3000 Series]" output (speakers/monitor) is "unplugged" after resuming from suspend. I am running Alsa and Pulse, they just do not see the HDMI audio device (ASUS monitor) at all, even if the analog output is completely turned off in software or BIOS or blacklisted. Turning off the analog device is not feasible because that is where my mic plugs in, but doesn't help anyway.

The system shows my monitor HDMI cable is unplugged from audio, but still plugged into video.

Ctrl+Alt+Esc brings back audio. I don't know why it should, or why KDE does not have this issue.
I have not tested or read about this issue with Xfce.
Ubuntu also has the same problems under Cinnamon, but not Mate. (from Ubuntu forums)
Mint has the problem under Cinnamon and Mate.

XeoNoX
Level 1
Level 1
Posts: 9
Joined: Thu Mar 24, 2016 9:32 pm

Re: HDMI + Sound + Mint 18

Postby XeoNoX » Thu Apr 13, 2017 3:24 am

set card to use HDMI
***reference: pacmd for finding correct parameters https://unix.stackexchange.com/questions/62818/how-can-i-switch-between-different-audio-output-hardware-using-the-shell
BE SURE TO SELECT CORRECT OUTPUT, use reference site above on pacmd usage

Code: Select all

xrandr --output HDMI-0 --set audio on

Code: Select all

pacmd set-card-profile 0 output:hdmi-stereo



EDIT /etc/pulse/default.pa

Code: Select all

sudo gedit /etc/pulse/default.pa


add restore_device=false

Code: Select all

load-module module-stream-restore restore_device=false


comment out line with #

Code: Select all

#load-module module-switch-on-port-available


add set-card-profile 0 output:hdmi-stereo at end of file

Code: Select all

set-card-profile 0 output:hdmi-stereo


save and exit /etc/pulse/default.pa

at this point REBOOT and after reboot check to MAKE SURE pulseaudio still loads , open terminal and run "pavucontrol", make sure you get no errors, u may still not hear sound but just make sure it loads with no errors.
if it says something about restart pulse audio or service didnt loead then you didnt correctly edit ]/etc/pulse/default.pa. so go back and try again using steps above. if you get no errors proceed to steps below.

Now just copy /etc/pulse/ to ~/.config/pulse and should fix resuming, be sure to do steps above first

Code: Select all

mkdir -p ~/.config/pulse

Code: Select all

cp -r /etc/pulse/ /home/<yourusername>/.config/

***replace <yourusername> with your login name***
Procedure above makes HDMI the default audio when the computer boot and disables switching of audio card, pre GUI,
reference:

Code: Select all

http://askubuntu.com/questions/71863/how-to-change-pulseaudio-sink-with-pacmd-set-default-sink-during-playback



Now Getting ALSA to work after suspend / hibernate
Some soundcards do not work after the computer has been suspended or hibernated. Files in /etc/pm/sleep.d/ are read when the system is entering or leaving suspend mode. Create a file telling the system to restart alsa when the computer is being brought up from suspended mode to make the audio work again.
The command /sbin/alsa force-reload will kill all running programs using the sound driver so the driver itself is able to be restarted.

Code: Select all

sudo nano /etc/pm/sleep.d/50alsa


Code: Select all

case "$1" in
        hibernate|suspend)
                # Stopping is not required
                ;;
        thaw|resume)
                /sbin/alsa force-reload
                ;;
        *) exit $NA
                ;;
esac

Make the newly created script to be executable with the following command:

Code: Select all

sudo chmod +x /etc/pm/sleep.d/50alsa




FINALLY REBOOT PC

User avatar
janhostdk
Level 2
Level 2
Posts: 61
Joined: Wed Jun 29, 2016 5:01 am
Location: Dk

Re: HDMI + Sound + Mint 18

Postby janhostdk » Tue Apr 25, 2017 12:35 pm

no luck for me..
I killed my ubuntu mate trying to fix same problem
but when trying the diff advices i found my optimal soundsettings :p

Code: Select all

pacmd set-card-profile 0 output:hdmi-surround71+input:analog-stereo

wich i run in terminal whenever my soundsettings mess up untill i find a fix
Last edited by janhostdk on Tue Aug 15, 2017 7:32 am, edited 1 time in total.
Dell Vostro 270 4gb ram with Ubuntu 16.04 Mate LTS, Linux Mint 18 Sarah Mate, Win7

IronRod
Level 1
Level 1
Posts: 10
Joined: Thu Feb 04, 2016 3:37 am

Re: HDMI + Sound + Mint 18

Postby IronRod » Wed Apr 26, 2017 7:24 pm

Kudos to banther. I confirmed my card index using

Code: Select all

pacmd list-cards
Which was zero since there is only one card. Then entered

Code: Select all

pacmd set-card-profile 0 hdmi-stereo+input:analog-stereo
And it fixed my problem of HDMI audio not being the default. It now defaults to HDMI, retains it during a session, and survives suspend, reboot, and shut-down

JSpeed
Level 1
Level 1
Posts: 8
Joined: Sat Dec 03, 2016 8:06 pm

Re: HDMI + Sound + Mint 18

Postby JSpeed » Wed Jul 05, 2017 8:50 pm

@XeoNoX
I went through everything on that post, however don't want what's playing to be killed on resume. My home phone is running through this computer and I suspend it when I'm not home.
Needless to say, without the last items, it doesn't work. However, the first command, ran on resume, restarts audio. For me, the device is DVI-0 (I know, DVI doesn't carry audio, but it does?)

Updated code from above to

Code: Select all

bash -c "systemctl suspend && xrandr --output DVI-0 --set audio on"

SueS
Level 1
Level 1
Posts: 15
Joined: Sat Oct 18, 2014 12:43 pm

Re: HDMI + Sound + Mint 18

Postby SueS » Tue Jul 18, 2017 12:01 am

I think this could be my problem too. I installed Linux Mint Cinnamon 18.2 Sonya and only have sound when I play videos from the Internet. No sound from headphones or mic. Also no sound when I try to play MP3 files.

Please send suggested fixes and/or an explanation of what's going on.

Thank you!

SueS
Level 1
Level 1
Posts: 15
Joined: Sat Oct 18, 2014 12:43 pm

Re: HDMI + Sound + Mint 18

Postby SueS » Tue Jul 18, 2017 12:30 am

As it turns out, installing "pavucontrol" as directed in the release notes here: https://www.linuxmint.com/rel_sonya_cinnamon.php via Software Manager solved my sound issues.

przemko95
Level 1
Level 1
Posts: 1
Joined: Wed Nov 08, 2017 6:56 pm

Re: HDMI + Sound + Mint 18

Postby przemko95 » Wed Nov 08, 2017 7:02 pm

I also have problem with sound. Unfortunately pavucontrol did not fix the error. Does anyone have a solution? :wink:


Return to “Sound, Multimedia, & Codecs”