Showing posts with label sound. Show all posts
Showing posts with label sound. Show all posts

Monday, March 12, 2012

XBMC configuration screenshots

Here is a screenshot of the settings used to get sound working in XBMC from the HDMI connection on my GPU (NVidia GT430).

To find the correct name for the card, I used the command

$aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: SB [HDA ATI SB], device 0: ALC889A Analog [ALC889A Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: SB [HDA ATI SB], device 1: ALC889A Digital [ALC889A Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
It was important for me to do it this way rather than simply a card number because these numbers can change on reboot.

Each card/device combination was tested using
$ aplay -D plughw:1,9 /usr/share/sounds/alsa/Front_Center.wav
until sound was heard. The important part in the above command is "plughw:1,9" which is the card number and device number from the ****List of PLAYBACK Hardware Devices****, respectively.

Once this was working, the card number can be replaced by the name of the card. For me, I replaced "1" with "Nvidia" to give the command
$ aplay -D plughw:NVidia,9 /usr/share/sounds/alsa/Front_Center.wav
I then used this information in my XBMC settings.

Notice the information is being used in the Custom audio device section.

Saturday, March 10, 2012

Sound using HDMI from GPU

I began by following the alsa configuration from the arch wiki.


$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 0: ALC1200 Analog [ALC1200 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 1: ALC1200 Digital [ALC1200 Digital]
  Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 3: NVIDIA HDMI [NVIDIA HDMI]
  Subdevices: 0/1
Subdevice #0: subdevice #0

Then test your output devices to find which gives you sound. In the example below, 0 is the card number and 3 is the device number.


$ aplay -D plughw:0,3 /usr/share/sounds/alsa/Front_Center.wav

If the test is successful, create (or edit) your ~/.asoundrc file to set HDMI as the default audio device.

pcm.!default {
   type hw
   card 0
   device 3
}

The trouble was that on each boot, my card numbers changed!
The solution is to follow the advice here on the alsa wiki

It says, use the name of the card rather than the card number. I created a file /etc/asound.conf with the following

# (from /proc/asound/cards)
#
#

pcm.!default {
    type hw
    card Nvidia
    device 9
}