Jump to content

NVidia HDMI Audio on LinuxMCE 1004: Difference between revisions

From LinuxMCE
L3mce (talk | contribs)
L3mce (talk | contribs)
Line 1: Line 1:
==How to setup NVidia HDMI Audio on LinuxMCE 1004==
==How to setup NVidia HDMI Audio on LinuxMCE 1004==


Add a command in the /usr/pluto/bin/LaunchOrbiter.sh script to let mplayer play a sound-file on startup of the orbiter.
It is assumed that
Its the line right below the xset m command
  sudo aplay -l
  ## Run Orbiter
Does NOT list your HDMI cards.
xset m 2 2
DISPLAY=:0 mplayer /usr/share/sounds/pop.wav
if [[ "$Valgrind" == *"$Executable"* ]]; then
$VGcmd "$Executable" "$@"
Orbiter_RetCode=$?
else
"$Executable" "$@"
Orbiter_RetCode=$?
fi
 
Further:
  apt-get install linux-backports-modules-alsa-`uname -r`
  apt-get install linux-backports-modules-alsa-`uname -r`
  reboot
  reboot
This will get them listed (aplay -l | grep -i 'hdmi')


You will likely have hw0 devices 3,7,8, and 9. It is almost always 3 or 7 on the id41, and seems to be completely random which. Others output on 9... others output on everything. Should look something like:
They should now be listed. Check with:
sudo aplay -l | grep -i 'hdmi'
You will likely have hw0 devices 3,7,8, and 9. It is almost always 3 or 7 on the id41, and seems to be completely random which. Others output on 9... others output on everything. Configured correctly, they should look something like:


card 0: NVidia [HDA NVidia], device 3: NVIDIA HDMI [NVIDIA HDMI]
  '''card 0:''' NVidia [HDA NVidia], '''device 3:''' NVIDIA HDMI [NVIDIA HDMI]
card 0: NVidia [HDA NVidia], device 7: NVIDIA HDMI [NVIDIA HDMI]
  '''card 0:''' NVidia [HDA NVidia], '''device 7:''' NVIDIA HDMI [NVIDIA HDMI]
card 0: NVidia [HDA NVidia], device 8: NVIDIA HDMI [NVIDIA HDMI]
  '''card 0:''' NVidia [HDA NVidia], '''device 8:''' NVIDIA HDMI [NVIDIA HDMI]
card 0: NVidia [HDA NVidia], device 9: NVIDIA HDMI [NVIDIA HDMI]
  '''card 0:''' NVidia [HDA NVidia], '''device 9:''' NVIDIA HDMI [NVIDIA HDMI]


You can test with:
What is important to us here is the card number, and the device number. IF HDMI cards list as card 1: You will have to add either
options snd-hda-intel model=auto 
or
options snd-hda-intel enable_msi=0 index=-2
to /etc/modprobe.d/alsa-base.conf to place the HDMI audo as card 0. For some reason, it has to be card 0. After making this change, you can try
sudo alsa reload -f
But sometimes this is problematic, and a reboot is preferred.


You can test which will work for you with:
  speaker-test -c 2 -l 1 -t sine -D hw:0,7
  speaker-test -c 2 -l 1 -t sine -D hw:0,7


etc based on the output of aplay where the 0 is the card and 7 is the device.
etc based on the output of aplay where the 0 is the card and 7 is the device in that example.


 
Now getting that to stick is another trick. In /usr/pluto/templates/asound.conf I would replace %MAIN_CARD% with 0,7 as per the example or whatever yours turns out to be.
Now getting that to stick is another trick. In /usr/pluto/templates/asound.conf I would replace %MAIN_CARD% with 0,7   or whatever yours is.


  pcm.asym_hdmi {
  pcm.asym_hdmi {
Line 41: Line 37:
  }
  }


 
Lastly we will add a command in the /usr/pluto/bin/LaunchOrbiter.sh script to let mplayer play a sound-file on startup of the orbiter. This sound should exist on all installs, and is the smallest least intrusive one pre-packaged on the system.
You may also have to add
Its the line right below the xset m command
  options snd-hda-intel model=auto or
  ## Run Orbiter
  options snd-hda-intel enable_msi=0 index=-2
  xset m 2 2
to /etc/modprobe.d/alsa-base.conf to place the HDMI audo as card 0. For some reasons, it has to be card 0.
  '''DISPLAY=:0 mplayer /usr/share/sounds/pop.wav'''
if [[ "$Valgrind" == *"$Executable"* ]]; then
$VGcmd "$Executable" "$@"
Orbiter_RetCode=$?
else
"$Executable" "$@"
Orbiter_RetCode=$?
fi


Please report back to L3top with your results.
Please report back to L3top with your results.

Revision as of 23:13, 5 August 2012

How to setup NVidia HDMI Audio on LinuxMCE 1004

It is assumed that

sudo aplay -l

Does NOT list your HDMI cards.

apt-get install linux-backports-modules-alsa-`uname -r`
reboot

They should now be listed. Check with:

sudo aplay -l | grep -i 'hdmi'

You will likely have hw0 devices 3,7,8, and 9. It is almost always 3 or 7 on the id41, and seems to be completely random which. Others output on 9... others output on everything. Configured correctly, they should look something like:

 card 0: NVidia [HDA NVidia], device 3: NVIDIA HDMI [NVIDIA HDMI]
 card 0: NVidia [HDA NVidia], device 7: NVIDIA HDMI [NVIDIA HDMI]
 card 0: NVidia [HDA NVidia], device 8: NVIDIA HDMI [NVIDIA HDMI]
 card 0: NVidia [HDA NVidia], device 9: NVIDIA HDMI [NVIDIA HDMI]

What is important to us here is the card number, and the device number. IF HDMI cards list as card 1: You will have to add either

options snd-hda-intel model=auto  

or

options snd-hda-intel enable_msi=0 index=-2

to /etc/modprobe.d/alsa-base.conf to place the HDMI audo as card 0. For some reason, it has to be card 0. After making this change, you can try

sudo alsa reload -f

But sometimes this is problematic, and a reboot is preferred.

You can test which will work for you with:

speaker-test -c 2 -l 1 -t sine -D hw:0,7

etc based on the output of aplay where the 0 is the card and 7 is the device in that example.

Now getting that to stick is another trick. In /usr/pluto/templates/asound.conf I would replace %MAIN_CARD% with 0,7 as per the example or whatever yours turns out to be.

pcm.asym_hdmi {
       type asym
       playback.pcm "hdmi_playback"
       capture.pcm "plughw:%MAIN_CARD%"
}

Lastly we will add a command in the /usr/pluto/bin/LaunchOrbiter.sh script to let mplayer play a sound-file on startup of the orbiter. This sound should exist on all installs, and is the smallest least intrusive one pre-packaged on the system. Its the line right below the xset m command

## Run Orbiter
xset m 2 2
DISPLAY=:0 mplayer /usr/share/sounds/pop.wav
if "$Valgrind" == *"$Executable"* ; then
	$VGcmd "$Executable" "$@"
	Orbiter_RetCode=$?
else
	"$Executable" "$@"
	Orbiter_RetCode=$?
fi

Please report back to L3top with your results.