I tried connecting my Ubuntu laptop to my TV via HDMI, apparently it`s not working. I already tried below options:
1.Run sudo apt-get purge nvidia-*
2.Run sudo add-apt-repository ppa:graphics-drivers/ppa
3.Run sudo apt-get update
4.Run sudo apt-get install nvidia-364 (Check what's the latest version... in my case as July 2017 nvidia-381 was avaliable)
But this does not work for me. My TV, Laptop and HDMI cable are fine, as I am easily able to use HDMI and connect to TV using WINDOWS OS
System Details Shows:
Processor: Intel® Core™ i5 CPU M 480 @ 2.67GHz × 4
Graphics: Intel® Ironlake Mobile
I checked few more links and I found some commands, thought might be helpful, hence sharing the O/P
~$ lsmod | grep -i DRM
drm_kms_helper 151552 1 i915
syscopyarea 16384 1 drm_kms_helper
sysfillrect 16384 1 drm_kms_helper
sysimgblt 16384 1 drm_kms_helper
fb_sys_fops 16384 1 drm_kms_helper
drm 352256 7 i915,drm_kms_helper
~$ lspci -k | grep -A 2 -i "VGA"
00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 18)
Subsystem: Dell Core Processor Integrated Graphics Controller
Kernel driver in use: i915
Let me know if any other details needed. Please help !!
Best Answer
Redirecting Audio can become quite difficult in some cases.
For example my firefox never liked to play audio thru hdmi while all other software did. Since i use pulse audio, it works like charm; check the end of this answer.
I am using Lubuntu 16.04. It might be different from your desktop, but automatic switching never occured by default. I always had to direct the audio stream manually. In general you have at least two audio-outputs: One analoge audiojack and one digital hdmi, in general on different audio-cards.
The hard way:
First i had to get an overview on the audiocards installed on my htpc (ati motherboard with onboard graphics and onboard cpu):
and all the possible audio-streaming channels i could route the sound:
Now I needed to find out, which of these channels is used by my hdmi cable. Therefor I needed an audioplayer that allowed me to route the audio manually to test each of the above channels, one by one, until i found out, which of them belongs to my hdmi. With a GUI vlc and especially audacious come in handy. On CLI basis we could also use aplay, but i am not familiar with that.
Now, after having found out, which channel belongs to my hdmi cable, it was card 0, device 3, i needed to create a file in my homefolder .asoundrc Asound Wiki with the information what card, and what device to use.
Also i needed to run 'alsamixer'. With F6 i did select my soundcard and had to navigate with the arrow keys to the S/PDIF and activate (unmute) it with the M key.
After a reboot audio thru hdmi worked, but firefox remained unwilling to play audio via hdmi.
Long story short, now i use PulseAudio and i am very happy with it.
The easy way
Since i installed PulseAudio the handling of the audio devices has become very easy. I would suggest you to install:
sudo apt-get install gstreamer1.0-pulseaudio pavucontrol pulseaudio-module-x11
pavucontrol
is a comfortable GUI to (re)direct your audio-streams to the device/channel you want.I hope this helps you to find a solution.