LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Audio through HDMI Cable? (https://www.linuxquestions.org/questions/linux-hardware-18/audio-through-hdmi-cable-733378/)

Jeff91 06-16-2009 11:08 AM

Audio through HDMI Cable?
 
When I run my video through the HDMI cord on my laptop it does not put through any audio to my LCD TV when on Ubuntu. It works just fine through Windows. Any suggestions?

~Jeff

Electro 06-16-2009 02:06 PM

You have to tell Linux to output through digital. Use aplay -l and note down what device is digital audio for HDMI. Then you can test it using mplayer. The following should work assuming 0.3 is digital audio over HDMI.

mplayer -ac hwac3,hwdts, -ao alsa:device=hdmi -channels 2 [i]file[/file]

or

mplayer -ac hwac3,hwdts, -ao alsa:device=plughw:0.3 -channels 2 [i]file[/file]

or

mplayer -afm hwac3,hwdts, -ao alsa:device=hdmi -channels 2 [i]file[/file]

or

mplayer -afm hwac3,hwdts, -ao alsa:device=plughw:0.3 -channels 2 [i]file[/file]

If it works in a reliable way or all the time, you can then create $HOME/.asoundrc to always use it.

Not all systems support passing digital audio through HDMI.

Jeff91 06-16-2009 03:06 PM

I'll give that a go... I also need to set this up for my not-so-computer savy friend how ever so I need to get it working automatically. Also how would I go about having other applications, such as firefox (for streaming video) or VLC, to use the HDMI audio out? Start with a similar argument after them?

~Jeff

Jeff91 06-16-2009 08:01 PM

Here is copied from terminal the digital entry:
Code:

card 0: Intel [HDA Intel], device 1: ALC888 Digital [ALC888 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

What exactly should I use to launch mplayer to test this?

~Jeff

Electro 06-17-2009 05:55 PM

The following should work.

mplayer -afm hwac3,hwdts, -ao alsa:device=hdmi -channels 2 file

or

mplayer -afm hwac3,hwdts, -ao alsa:device=plughw:0.2 -channels 2 file

Digital audio is not reliable in Linux. Linux is not designed for computer illiterates. Also Linux is still design for servers. Third Linux power saving features like Suspend to RAM or Suspend to Disk is not reliable enough to use in production systems.

A notebook computer that I suggest for computer illiterates is a MacBook or MacBook Pro. Mac OS X has Unix like commands that can be access from Applications -> Utilities -> Terminal.

If you insist using Linux for notebook computers, you have to do the following.
1) Install MPlayer with almost every feature do not forget LIVE support and leave out GUI or GTK
2) Install SMPlayer
3) Install mplayerplug-in
4) Install VLC
5) Install Adobe Flash plug-in
6) Install Adobe Reader
7) Install PulseAudio and its utilities and modules
8) Pick a GUI WiFi program that is easy. I use kwifimanager.
9) Install acpid, cpufreqd, and laptop-tools
10) Install hibernate scripts and configure
11) Configure acpid, cpufreqd, and laptop-tools
12) Configure hal and dbus for removable storage devices
13) Install and configure ifplugd
14) Configure PulseAudio
15) Test mplayerplug-in at apple.com, nasa.gov, or others
16) Test WiFi
17) Test removable storage
18) Test power management between AC and battery
19) Test hibernate scripts for Suspend to RAM or Suspend to Disk
20) Test lid close if want to turn off lamp.
21) Test xscreensaver or similar program
22) Test PulseAudio to find out how easy it is to switch from analog outputs to digital

The following is what I use for MPlayer config (/etc/mplayer/mplayer.conf).

Code:

##################
# video settings #
##################

# Specify default video driver (see -vo help for a list).
vo=vdpau,gl,xv,x11,null

dr=yes


##################
# audio settings #
##################

# Specify default audio driver (see -ao help for a list).
ao=alsa,oss,null


##################
# other settings #
##################

# Drop frames to preserve audio/video sync.
framedrop = yes

# cache settings
cache = 102400

# Prefill 20% of the cache before starting playback.
cache-min = 20.0

# Prefill 50% of the cache before restarting playback after the cache emptied.
cache-seek-min = 20

# DVD: Display English subtitles if available.
#slang = en

# DVD: Play English audio tracks if available.
alang = en

# You can also include other configuration files.
#include = /path/to/the/file/you/want/to/include
fontconfig=1
subfont-osd-scale=4
subfont-text-scale=3

a52drc=0
identify=yes

stop-xscreensaver=yes

xineramascreen=-1

lavdopts=threads=2

[vo.gl]
vf-clr=yes
vf=softskip,scale=-1:-1

[vo.vdpau]
vf-clr=yes

#For VDPAU to work properly
vc=ffmpeg12vdpau,ffwmv3vdpau,ffvc1vdpau,ffh264vdpau,

I suggest use Gentoo for better flexibility during setup.

Jeff91 06-23-2009 12:55 PM

Thanks for your help thus far, any idea what I would use to launch the film via VLC to get audio over the HDMI? mplayer is alright, but I much prefer VLC for movie watching.

~Jeff

Electro 06-25-2009 08:27 PM

VLC is not reliable and stable all the time, so I suggest use MPlayer. I suggest SMPlayer for GUI front end for MPlayer because it is easy to use. Do not use MPlayer's GUI front end (GMPlayer) because it is not reliable. I recommend do not include GMPlayer while compiling MPlayer.

If you insist of using lousy VLC, the settings are in the preferences. It is not hard to figure out. Getting VLC to pass through AC-3 and DTS with out first decoding it will be a problem.

I still strongly recommend an Apple notebook because Mac OS X is tailored for "not-so-computer savvy" users. Linux is still tailored for servers. Linux for notebooks is far from production use because putting a notebook computer in suspend mode is not reliable and stable. Mac OS X uses SAMBA for file sharing and CUPS for printing, so you still are using some open source projects.

Jeff91 06-26-2009 09:44 AM

Heh, say what you will but desktop Linux has come a long way in the last couple of years and it is only going to continue advancing. One day we will see support for things such as HDMI audio support on it.

Anywho I just went out and got a 1/8 to RCA cable to run my sound through my stereo.

~Jeff


All times are GMT -5. The time now is 03:27 PM.