I couldn't get sound from HDMI. I find my Nvidia HDMI driver from kmix gui. But I can't send sound to my TV from HDMI.
How can I get sound from HDMI?
Thanks for advance..
[SOLVED] Get sound from HDMI
[SOLVED] Get sound from HDMI
Last edited by oranus on 09 Apr 2012, 07:30, edited 1 time in total.
- brokenman
- Site Admin
- Posts: 6104
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
- Contact:
Re: Get sound from HDMI
please issue from console: alsamixer and ensure your card is being correctly detected and all volumes are unmuted (use 'm' to unmute). If you make changes then run: alsactl
Use: aplay -L to see which devices can give sound. Do you see HDMI anywhere in there?
aplay -l will give you the device number of the HDMI card. Then use alsamixer -c <number> to try to configure the settings.
You can test devices with: speaker-test -c 2 -r 48000 -D hw:X,X where X is a device number or using mplayer.
Lastly ... using the info above add a file called ~/.asoundrc andn add:
Be sure that your TV accepts the Khz range you are sending to it. You may need to refer to the TV manual for this. You could perhaps set the Khz in the asoundrc file. be warned that this asoundrc file takes precedence of alsa.conf once you create it (judging by reading the code in alsa.conf).
For some indepth info please follow the footsteps of those that fought before you:
http://www.linuxquestions.org/questions ... page2.html
Use: aplay -L to see which devices can give sound. Do you see HDMI anywhere in there?
aplay -l will give you the device number of the HDMI card. Then use alsamixer -c <number> to try to configure the settings.
You can test devices with: speaker-test -c 2 -r 48000 -D hw:X,X where X is a device number or using mplayer.
Lastly ... using the info above add a file called ~/.asoundrc andn add:
Code: Select all
pcm.!default {
type hw
card 0
device 9
}
ctl.!default {
type hw
card 0
device 9
}
For some indepth info please follow the footsteps of those that fought before you:
http://www.linuxquestions.org/questions ... page2.html
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.
Re: Get sound from HDMI
Thanks for help brokenman
I deal with problem.
And I write script for any computer to set sound master to HDMI.
I deal with problem.

- fanthom
- Moderator Team
- Posts: 5588
- Joined: 28 Dec 2010, 02:42
- Distribution: Porteus Kiosk
- Location: Poland
- Contact:
Re: Get sound from HDMI
here is my output:
as you can see HDMI is definied as 'card 0, device3'. i have failed to redirect all sounds to the TV (different apps uses different settings) but here is mplayer syntax (i'm also using vaapi feature of my i3 CPU)
now i have sound from the movie redirected to the TV and all other sounds stays muted on the laptop 
Cheers
Code: Select all
guest@porteus:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: STAC92xx Analog [STAC92xx Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
guest@porteus:~$
Code: Select all
mplayer -vo vaapi -va vaapi -ao alsa:device=hw=0.3

Cheers
Please add [Solved] to your thread title if the solution was found.
- brokenman
- Site Admin
- Posts: 6104
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
- Contact:
Re: Get sound from HDMI
Gonna share?And I write script for any computer to set sound master to HDMI.
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.
Re: Get sound from HDMI
I'm newbie on scripting....
Please correct script if you see any errors....
thanks...
Posted after 5 minutes 7 seconds:
Generally Nvidia HDMI device settings are initally off. So I have to change settings from alsamixer...
I can't find to set HDMI device setting "on" from cli yet.
Please correct script if you see any errors....
thanks...
Code: Select all
#!/bin/bash
echo HDMI device are searching. ..
echo It takes a few minutes....
sleep 2
clear
Find_sound()
{
yer=/root/.asoundrc
if [ -f $yer ]
then
rm $yer
fi
for(( k = 0; k <= 1; k++ ))
do
for(( i = 1; i <= 10; i++ ))
do
ses=`mplayer -ao alsa:device=hw=$k.$i /usr/share/sounds/k3b_success1.wav 2>/dev/null |grep Starting |wc -l`
if [ $ses -eq 1 ]
then
echo 'Do you hear sound from HDMI device? y/n'
#`typeset - var`
read var
if [ "$var" == "y" ]
then
echo HDMI device has just find...
echo Settings done...
echo 'pcm.!default {' >>/root/.asoundrc
echo 'type hw' >>/root/.asoundrc
echo 'card '$k >>/root/.asoundrc
echo 'device '$i >>/root/.asoundrc
echo '}' >>/root/.asoundrc
echo 'ctl.!default {' >>/root/.asoundrc
echo 'type hw' >>/root/.asoundrc
echo 'card '$k >>/root/.asoundrc
echo 'device '$i >>/root/.asoundrc
echo '}' >>/root/.asoundrc
echo HDMI device ready...
sleep 2
exit 0
fi
fi
done
done
}
Find_sound
clear
echo HDMI Device are not found....
sleep 2
echo 'You should set your HDMI device configuration manually...'
sleep 2
echo Please remove Item: [off] section by pressing m
echo Use right arrow to enter another HDMI device and remove all [off] written section...
sleep 10
echo After finish settings press ESC...
HDMI=`aplay -l | grep HDMI |awk {'print $3'} |head -n 1 `
alsamixer -c $HDMI
clear
echo HDMI device are searching again....
sleep 2
Find_sound
Generally Nvidia HDMI device settings are initally off. So I have to change settings from alsamixer...
I can't find to set HDMI device setting "on" from cli yet.
Re: Get sound from HDMI
The posted script did not work for me, modifying alsamixer then storing the settings and manually changing .asoundrc enabled sound however I have no volume control other than the hardware on the TV.