How to get audio thru HDMI out of motherboard?

Problems and successes with specific brands/models of computer audio hardware
Message
Author
User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#1 Post by Flash »

Any suggestions on how to get sound through an HDMI cable? (I'll move this to a more appropriate place if that seems to be a good idea but this seems to be a good place for now.) I bought a new motherboard (Gigabyte GA-MA69GM-S2H) because it has an HDMI output on the motherboard. The video works through the HDMI cable but not the audio. The audio does work through the audio output jack.

If I understand the HDMI standard correctly, it includes multiplexing digital audio through the HDMI cable along with video. I'm not certain my (ViewSonic N3250W) follows the standard that far. I don't have a device which is known to put both video and audio through the HDMI cable, to test it.

Thanks. :)
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=69321][color=blue]Puppy Help 101 - an interactive tutorial for Lupu 5.25[/color][/url]

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#2 Post by tempestuous »

Well I had a look at the Gigabyte link you provided, and I see this
Realtek Function driver for Realtek Azalia audio chip (Including Microsoft UAA/HDMI Driver)
so your motherboard appears to support audio over HDMI.

But I'm guessing that the relevant Linux ALSA driver for the audio chip on your motherboard (probably snd-hda-intel) needs to catch up with this new development. I don't imagine it should be too complex, just a case of routing the S/PDIF (digital) signal to the HDMI connector.

Let's keep things in perspective, though; I see that your LCD TV has 2x 10W speakers. These cannot be too high quality, so it's probably not worth getting too fussy about. If your TV will allow HDMI input for picture along with analogue input for sound then this should be fine.
A step up in sound reproduction would be to send the S/PDIF signal from your motherboard to an external surround sound amplifier. I think that a special ALSA configuration file is required to enable the S/PDIF output in Linux.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#3 Post by Flash »

Hey, those speakers sound good enough to me. :) I can barely tell any difference between mp3 at 32kbps mono, and the original CD .wav files they were condensed from. A high quality sound system would be wasted on me.

Mostly I'm excited about eliminating a wire from the mat that hangs off the back of my computer. The other day I plugged the audio into the wrong jack on the back of the display because I couldn't see what I was doing. It was several days before I figured out why the sound wouldn't work. :x It's dark behind the display, and the jacks face down so you can't see them without crouching down and looking up. It requires a braille-reading contortionist to connect anything to it. :lol:

I guess I can wait until Puppy includes ALSA that is updated to include the required driver.
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=69321][color=blue]Puppy Help 101 - an interactive tutorial for Lupu 5.25[/color][/url]

sathyan
Posts: 14
Joined: Thu 24 May 2007, 01:50

#4 Post by sathyan »

i have a Benq joybook S41 laptop which has a HDMI port with nvidia geforce 8600M GS graphics card..
and i'm using puppy 3 with 2.6.21.7
puppy automatically installed the driver for the sound card... which has
HDA Intel card and with the chip Realtek ALC262...
and the alsa mixer version is 1.0.14

i don't know how to send the audio signal thru the hdmi port.. any help ? :?:
but it works fine in winxp.. with a sharp 46" LCD TV... with 1080P support

when i open the alsamixer.. there is PCM and Front to control the volume..
one more problem is... when i play the audio in puppy the audio is heared from the speaker of the laptop and also from the headphone jack.. how to disable the speaker when i connect the headphones to the laptop ? :?:

i use NVIDIA-100.14.19-k2.6.21.7.pet driver for my graphics card... how to change the refresh rate to 30Hz ? in which file i need to change this.. is it in xorg.conf or xorg.conf.NVIDIA

advanced thanks for ur help :) ...

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#5 Post by tempestuous »

I just had another look at this issue, and found this link
http://www.mediaboxblog.co.uk/blog1.php ... -hd3200-rs
which is a successful attempt to output audio via HDMI under Linux.

It seems my original comment about the snd-hda-intel (ALSA) driver needing to pass S/PDIF audio to the HDMI connector is slightly wrong;
since the HDMI connector is attached to the graphics chip, the graphics driver needs to make the HDMI connector accessible as an output source to the ALSA driver ... so clearly success will be achieved by the interaction of the ALSA audio driver with the Xorg graphics driver.

So Flash, it appears you need to install a graphics driver for your ATi graphics chip, which will play well with ALSA.
I suggest that option 1 would be the upgraded "radeonhd" Xorg driver contributed by Patriot -
http://www.murga-linux.com/puppy/viewto ... 242#353242

and option 2 would be the proprietary ATi graphics "Catalyst" driver contributed by MU -
http://www.murga-linux.com/puppy/viewtopic.php?t=46507

then refer to the earlier link for instructions. Basically, the command -

Code: Select all

aplay -l
will reveal whether ALSA can "see" the HDMI connector as a valid output device. If so, you then need to specify the correct ALSA device number when running various audio applications, because otherwise ALSA will default to the "normal" audio output of your sound card.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#6 Post by Flash »

Thank you, tempestuous! :D

I installed Patriot's ATI driver yesterday. It fixed both motherboards that had been giving me trouble with display geometry.

It seems that aplay -l sees an HDMI device, but I can't for the life of me figure out how I'm supposed to tell aplay which device to use. Here's what I've found:
# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: SB [HDA ATI SB], device 0: ALC883 Analog [ALC883 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: SB [HDA ATI SB], device 1: ALC883 Digital [ALC883 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 3: ATI HDMI [ATI HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0


# aplay --help
Usage: aplay [OPTION]... [FILE]...

-h, --help help
--version print current version
-l, --list-devices list all soundcards and digital audio devices
-L, --list-pcms list device names
-D, --device=NAME select PCM by name
-q, --quiet quiet mode
-t, --file-type TYPE file type (voc, wav, raw or au)
-c, --channels=# channels
-f, --format=FORMAT sample format (case insensitive)
-r, --rate=# sample rate
-d, --duration=# interrupt after # seconds
-M, --mmap mmap stream
-N, --nonblock nonblocking mode
-F, --period-time=# distance between interrupts is # microseconds
-B, --buffer-time=# buffer duration is # microseconds
--period-size=# distance between interrupts is # frames
--buffer-size=# buffer duration is # frames
-A, --avail-min=# min available space for wakeup is # microseconds
-R, --start-delay=# delay for automatic PCM start is # microseconds
(relative to buffer size if <= 0)
-T, --stop-delay=# delay for automatic PCM stop is # microseconds from xrun
-v, --verbose show PCM structure and setup (accumulative)
-V, --vumeter=TYPE enable VU meter (TYPE: mono or stereo)
-I, --separate-channels one file for each channel
--disable-resample disable automatic rate resample
--disable-channels disable automatic channel conversions
--disable-format disable automatic format conversions
--disable-softvol disable software volume control (softvol)
--test-position test ring buffer position
--test-coef=# test coeficient for ring buffer position (default 8)
expression for validation is: coef * (buffer_size / 2)
--test-nowait do not wait for ring buffer - eats whole CPU
Recognized sample formats are: S8 U8 S16_LE S16_BE U16_LE U16_BE S24_LE S24_BE U 24_LE U24_BE S32_LE S32_BE U32_LE U32_BE FLOAT_LE FLOAT_BE FLOAT64_LE FLOAT64_BE IEC958_SUBFRAME_LE IEC958_SUBFRAME_BE MU_LAW A_LAW IMA_ADPCM MPEG GSM SPECIAL S 24_3LE S24_3BE U24_3LE U24_3BE S20_3LE S20_3BE U20_3LE U20_3BE S18_3LE S18_3BE U 18_3LE
Some of these may not be available on selected hardware
The availabled format shortcuts are:
-f cd (16 bit little endian, 44100, stereo)
-f cdr (16 bit big endian, 44100, stereo)
-f dat (16 bit little endian, 48000, stereo

# aplay -L
default:CARD=SB
HDA ATI SB, ALC883 Analog
Default Audio Device
front:CARD=SB,DEV=0
HDA ATI SB, ALC883 Analog
Front speakers
surround40:CARD=SB,DEV=0
HDA ATI SB, ALC883 Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=SB,DEV=0
HDA ATI SB, ALC883 Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=SB,DEV=0
HDA ATI SB, ALC883 Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=SB,DEV=0
HDA ATI SB, ALC883 Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=SB,DEV=0
HDA ATI SB, ALC883 Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=SB,DEV=0
HDA ATI SB, ALC883 Digital
IEC958 (S/PDIF) Digital Audio Output
null
Discard all samples (playback) or generate zero samples (capture)
hdmi:CARD=HDMI
HDA ATI HDMI, ATI HDMI
HDMI Audio Output

# aplay -D=hdmi
ALSA lib pcm.c:2211:(snd_pcm_open_noupdate) Unknown PCM =hdmi
aplay: main:608: audio open error: No such file or directory


# aplay -D=3
ALSA lib pcm.c:2211:(snd_pcm_open_noupdate) Unknown PCM =3
aplay: main:608: audio open error: No such file or directory
As you can see, I tried a couple of ways to tell aplay to use the HDMI. I'm not sure what it's telling me.
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=69321][color=blue]Puppy Help 101 - an interactive tutorial for Lupu 5.25[/color][/url]

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#7 Post by 8-bit »

I'm just an outsider looking in, but since one of the audio outputs seems to be listed under #aplay -L as HDMI audio output, have you tried
#aplay -D=HDMI

That is capitalized as in the returned options.

Your example showed #aplay -D=hdmi

Might work, you never know.

It is like Puppy looking for its files when booting and cannot find them because they are capitalized.
Maybe this is the reverse of that.

User avatar
Patriot
Posts: 733
Joined: Thu 15 Jan 2009, 19:04

#8 Post by Patriot »

Hmmm .....

Flash,
Flash wrote: ........
# aplay -D=hdmi
ALSA lib pcm.c:2211:(snd_pcm_open_noupdate) Unknown PCM =hdmi
aplay: main:608: audio open error: No such file or directory

# aplay -D=3
ALSA lib pcm.c:2211:(snd_pcm_open_noupdate) Unknown PCM =3
aplay: main:608: audio open error: No such file or directory
You're almost there ... the equal sign (=) borks it up ... These should work :

aplay -D default /usr/share/audio/2barks.au
aplay -D hdmi /usr/share/audio/2barks.au


Rgds

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#9 Post by 8-bit »

Patriot,
You are right as usual. I tried it with my PC and analog sound card using your example.

Mine showed:

# aplay -L
default:CARD=NVidia
HDA NVidia, ALC888 Analog
Default Audio Device
front:CARD=NVidia,DEV=0
HDA NVidia, ALC888 Analog
Front speakers
surround40:CARD=NVidia,DEV=0
HDA NVidia, ALC888 Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=NVidia,DEV=0
HDA NVidia, ALC888 Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=NVidia,DEV=0
HDA NVidia, ALC888 Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=NVidia,DEV=0
HDA NVidia, ALC888 Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=NVidia,DEV=0
HDA NVidia, ALC888 Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
null
Discard all samples (playback) or generate zero samples (capture)

And #aplay -D default /usr/share/audio/2barks.au
played to both front and rear speaker ports.

#aplay -D front /usr/share/audio/2barks.au gave me

Playing Sparc Audio '/usr/share/audio/2barks.au' : Mu-Law, Rate 8000 Hz, Mono
aplay: set_params:979: Sample format non available

No front headphone output on that one.

I had tried the others in Vista with it graphic display and only the 2 speaker setup worked.
So I did not expect a whole lot.

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#10 Post by tempestuous »

Flash wrote:# aplay --help
...
-D, --device=NAME select PCM by name
That's interesting, I have always specified audio devices to ALSA applications by their device number, not name.
Flash wrote:# aplay -l
...
card 1: HDMI [HDA ATI HDMI], device 3: ATI HDMI [ATI HDMI]
Your device is seen as ALSA device 1,3. So this should work -

Code: Select all

aplay -D hw:1,3 /usr/share/audio/2barks.wav

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#11 Post by Flash »

Okay, I found time to do some more tinkering. :)

First I ran
# aplay -D default /usr/share/audio/2barks.wav
Playing WAVE '/usr/share/audio/2barks/wav' : Signed 16 bit Little Endian, Rate 8000 Hz, mono.
to see that it would do something through the regular speaker outlet, and I heard two barks.

Encouraged, I tried
# aplay -D hw:1,3 /usr/share/audio/2barks.wav
Playing WAVE '/usr/share/audio/2barks/wav' : Signed 16 bit Little Endian, Rate 8000 Hz, mono
aplay: set_params:984: Channels count non available
but no sound came from the speakers on the LCD. They work in Windows. Every control in Alsamixer was turned up to max and IEC958 was on.

I assume "set_params:984" is an aplay error message that means my particular hardware won't work with this particular driver. :( .

I tinkered around with the aplay -c option but couldn't figure out what it's for.
Last edited by Flash on Tue 27 Oct 2009, 03:46, edited 1 time in total.

User avatar
Patriot
Posts: 733
Joined: Thu 15 Jan 2009, 19:04

#12 Post by Patriot »

Hmmm .....

Flash,
Flash wrote: .....
# aplay -D hw:1,3 /usr/share/audio/2barks.wav
Playing WAVE '/usr/share/audio/2barks/wav' : Signed 16 bit Little Endian, Rate 8000 Hz, mono
aplay: set_params:984: Channels count non available .....
Normally, we use alsa device number but in this case aplay -D is looking for PCM name. Doing aplay -L gives a list of PCM names, it's the first word of every description. So,

# aplay -D hdmi /usr/share/audio/2barks.wav

should work if you have unmuted the iec958 in alsamixer ...


Rgds

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#13 Post by Flash »

No luck:
#aplay -D hdmi /usr/share/audio/2barks.wav
aplay: main:608: audio open error: No such device
The only thing that even seemed to want to work was aplay -D hw:1,3

I can't figure out what the "channels" error message means.

User avatar
Patriot
Posts: 733
Joined: Thu 15 Jan 2009, 19:04

#14 Post by Patriot »

Hmmm .....
Flash wrote:No luck ........
Bummer ..... After a bit of checking, I believe -D parameter can also be :

for default output:
aplay -Dplughw:0,0 /usr/share/audio/2barks.wav

for hdmi output:
aplay -Dplughw:1,3 /usr/share/audio/2barks.wav


Rgds

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#15 Post by Flash »

Thanks, Patriot. That led to some progress, perhaps:
#aplay -Dplughw0,0 /usr/share/audio/2barks.wav
Playing WAVE '/usr/share/audio/2barks.wav' : Signed 16 bit Little Endian, Rate 8000 Hz Mono
And I get two barks from the speakers plugged into the green speaker jack on the motherboard.
#aplay -Dplughw1,3 /usr/share/audio/2barks.wav
Playing WAVE '/usr/share/audio/2barks.wav' : Signed 16 bit Little Endian, Rate 8000 Hz Mono
There is now no error message, but still no sound from the LCD speakers, which work in Windows.

Everything that looks like it has anything to do with speakers is turned up in Alsamixer, and IEC958 is on.

User avatar
Patriot
Posts: 733
Joined: Thu 15 Jan 2009, 19:04

#16 Post by Patriot »

Hmmm .....
Flash wrote: ........
Everything that looks like it has anything to do with speakers is turned up in Alsamixer, and IEC958 is on.
Is the hdmi mixer unmuted ?

# alsamixer -c 1


Rgds

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#17 Post by tempestuous »

Yes, the HDMI port is seen as card 1.
So it would clearly be a good idea to check alsamixer settings for card 1.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#18 Post by Flash »

Well all right then. After some adventure involving throwing a tantrum because apparently static electricity caused my computer to reboot when I plugged a flash memory into it, I finally got everything together to make this post. :lol:

Alsamixer -c 1 showed that the HDMI was muted even though IEC958 was on in the default Alsamixer window. (See first image.)

After I unmuted IEC958 in the HDMI alsamixer window, I again first tried playing 2barks through the regular speakers to make sure it would work. Then I switched from device 0,0 to 1,3, and again got no sound even though there were no error messages. (See second image. Ignore the first line, the one with the red line through it. "bash: setenv: command not found" is there when I open rxvt. I don't know why.)
Attachments
alsamixer default and -c 1.jpg
(62.31 KiB) Downloaded 2885 times
aplay HDMI result.jpg
(51.61 KiB) Downloaded 3272 times

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#19 Post by tempestuous »

You have made progress.
- it's a good sign that alsamixer can access the HDMI port as card 1.
- it's a good sign that aplay plays the audio file without error.

Since DigitalTV and DVD both have a standard sample rate of 48 kHz, it might just be that your HDMI monitor might not be able to handle the 8 kHz sample rate of 2barks.wav.
I suggest you try to play a 48kHz uncompressed wav file. I just sent you a PM with a link to 48kHz and 44.1kHz test audio files.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#20 Post by Flash »

Thanks, tempestuous. Both of the links were to the same 48 kHz file. It didn't play in HDMI but did in the Alsaplayer default audio.. :(

I have a CD full of various wav files. They all seem to be 22.05 kHz mono, but since that's just half of a 44.1 kHz stereo I think it would play if a 44.1 kHz stereo file would. None of them would play in HDMI either.

Next?

Post Reply