For sometime I had trouble trying to get audio working over the HDMI port. I finally managed to get it working. I'm not sure if this is because of the latest ATI Catalyst 8.7 drivers or if it was something I had missed in the past.
Follow up:
Edit: Since writing this article support for HDMI audio is now possible with the open source radeonhd driver, so if you would prefer to use radeonhd, head over to HOWTO: Compiling and running radeonhd with HDMI audio to find out how.
Installing the Catalyst drivers
So this is what I done. Download the latest drivers from the AMD website ( http://ati.amd.com/support/drivers/linux/linux-radeon.html )
to your home folder and install the run script and follow the on screen instructions. You can run the installer by typing the following in the console
cd ~/
chmod +x ati-driver-installer-8-7-x86.x86_64.run
sudo ./ati-driver-installer-8-7-x86.x86_64.run
Enabling HDMI Audio
After you reboot it is then time to change your default audio output and enable the IEC958 option for the HDA ATI HDMI.
First we will cover the IEC958 option. You enable this via the Volume Control's applet, you can access this by double clicking on the speaker icon on your gnome panel. It should look something like this

Next we need to switch to the HDMI sound card, which is actually a different sound device than the ALC889 that is on board the GA-MA78GM-S2H. You can do this by going to File->Change Device within the menu. You need to be looking for HDA ATI HDMI device. Select this and the volume controls will change. Once you have done this it will look something like this.
.
Select the IEC958 option so that it's checked, you can then exit the volume controls applet. Now you will have to do this on every reboot, so a way around this is to store the alsa settings using the alsactl command. So within a command prompt, enter something like this.
sudo alsactl store 1
Now the 1 following the word store is a reference to which sound device settings you would like to store. On my GA-MA78GM-S2H the HDMI device is number one, you can find out which device number is your HDMI device by doing the following in a terminal window
aplay -l
the output should look something like this
**** List of PLAYBACK Hardware Devices ****
card 0: SB [HDA ATI SB], device 0: ALC882 Analog [ALC882 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: SB [HDA ATI SB], device 1: ALC882 Digital [ALC882 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
as you can see the HDA ATI HDMI device is card number one, so you would need to replace the number in alsactl command to correspond to your HDMI device.
Next we need to change the default audio output settings for your gnome session. You can control this using the Sound Preferences program (System->Preferences->Sound). Once you have opened the program, make sure the default device for all options is set to your HDMI device. Once you have done this is should look like this.

You should be able to test the sound playback by clicking on the Test button. If you hear no audio then something is wrong!
So most gnome applications should work with this just fine, but in some cases they will not. You can usually get around this problem by specifying the specific ALSA device you wish to use during playback. For instance you can specify the HDMI device on the command line with mplayer using the following method
mplayer -ao alsa:device=hw=1.3 myfile
The 1 in the above example is the card and the 3 is the device, again you can find this information from the output of aplay -l.

Thank you very much
1. To run the ati update, I had to precede the file name with 'bash'. I received a command not found error until I figured that out.
2. After changing FIle->Change Device to the ATI HDMI option, nothing appeared in the volume control box. I had to go to Edit->Preferences and check the IEC958 box so that it was visible in the volume control box.
Strange that you had to precede it like that. I'll have to edit the post to include your findings. My volume manager showed the IEC958 box by default.
Thanks for the input.
I tried it with mythbuntu 8.04 and new alsa driver and new kernel version and new catalyst 8.8. But HDMI does not work. thanks best regards cuni
Ubuntu 8.04, alsa 1.0.16, kernel 2.6.24-20
Thanks.
My apologies, 1.0.15 is what I have installed.
yesterday ,I tried it and HDMI audio works (with your kernel version) . But I have to unmute mute the hdmi devices every time to hear something. I will try to use catalyst 8.7 instead of 8.8 . This is the only difference between your and my setup I guess. thanks cuni
Known Issue:
Connecting an HDMI display device may result in the audio failing to be heard
maybe this is really my problem. ciao cuni
Could well be. Try going back to 8.7 to see if the problem goes away. Let me know how it goes.
You have to specify the alsa HDMI device in the 'Audio output device' field within the configuration. For my machine it looks like this.
ALSA:hw:1,3why,it doesnt work.I tried with the 8.7catalyst,8.8 catalyst
alsa version 1.0.15,alsa 1.0.16 new kernel but nothing.Any idea?I follwed your guide at the beginning but nothing.
Is it the same Gigabyte board I have? What version BIOS firmware do you have?
F3 is what I have too
I haven't actually tried. Can you run mythfrontend from a console to see if you get any error messages in the console output window, running myth in windowed mode will help with this. Let me know if it output's any messages.
http://www.jwele.com/motherboard_detail.php?419
Interestingly I only have this problem in mythtv. Mplayer for example has no problem with:
mplayer -ao alsa:device=hw=1.3 file.mpg
Anyone find a solution to this?
jp
There are a few experiencing this bug with fglrx. Have you tried the radeonhd driver? If you don't required 3D support just yet then that would probably be a better alternative for you. Check my recent posts, I have an article on how to get it compiled and running.
What kind of video are you watching, TV stream or local media on hard disk? What type is it, SD or HD? What is playback like when playing via mplayer?
Maybe there is something missing from my xorg.conf?
A video source like that should have no problems being decoded in software, did you try the source in mplayer? You could try executing the following
NO_XV="1" mythfrontend
This will tell myth not to use Xv since radeonhd currently doesn't support it. My mythtv setup uses mplayer and not the internal player and that works fine even with HD content.
The other problem I had was that the video signal was cutting out for a few seconds every 10 minutes or so. Have you observed this?
I've got a fair amount of overscan (say 100 pixels around the border) but this isn't that big a deal yet.
jp
Can't say I have observed this issue
I had this initially with radeonhd which I didn't have with fglrx, but there was a mode on my TV that allowed a just scan 1:1 mapping which solved the problem for me. It usually in your screen size settings, for example I had 16:9, Wide Zoom, Zoom, 4:3, Just Scan
jp
I also tried as you suggested to configure software scaling in myth. It sorta works (decoder=standard, video renderer=xshm, trheads=2). But video is choppy and I see bad things in the logs:
2008-10-15 19:13:03.970 VideoOutputXv: Falling back to X shared memory video output.
2008-10-15 19:13:04.320 AO: dropping back audio_buffer_unused
2008-10-15 19:13:09.062 VideoOutputXv Error:
***
* Your system is not capable of displaying the
* full framerate at 1920x1080 resolution. Frames
* will be skipped in order to keep the audio and
* video in sync.
2008-10-15 19:13:10.099 NVP: prebuffering pause
2008-10-15 19:13:19.027 NVP: prebuffering pause
The CPU usage is only 60% per core, and I'm surprised that it claims things are too slow despite having a fair amount of CPU room.
I've still got the video+audio dropout problem which i didn't see with the catalyst driver.
At least I 'm making progress. Thanks for your help.
jp
Can you try xlib as the renderer. Did you try mplayer, would like to see if that works smoothly for you. Use this when trying mplayer
mplayer -vo x11 -zoom -fs filenametoplayyou may need to install it from the Ubuntu repos if you haven't got it installed.
mplayer -vo x11 -zoom 1064_20080701133000.mpg
------snip----------
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough
VDec: vo config request - 480 x 480 (preferred colorspace: Mpeg PES)
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
The selected video_out device is incompatible with this codec.
Try appending the scale filter to your filter list,
e.g. -vf spp,scale instead of -vf spp.
VDecoder init failed :(
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffmpeg2] vfm: ffmpeg (FFmpeg MPEG-2)
You missed the -fs option, which basically means full screen. Let me know how that goes, and if it's smooth.
Fullscreen mplayer displays this smoothly, but I noticed that it decided to keep the original 4:3 aspect ratio, while myth tries to expand the video to the full 1920x1080 resolution, which results in quite a bit more work for it to do, and probably the source for slightly choppy playback using shm.
I'd suspect that if I can get myth to keep the real aspect ratio, the radeonhd driver/my system would be sufficient for playing SD.
Thanks for the pointers.
jp
Scaling should be no problem for your PC even if it's stretching from 4:3 to 16:9, so that's not the problem with MythTV. You can use
-aspect 16:9on mplayer to force a 4:3 source to be stretched to 16:9 I think. (if that is how you prefer it).To me it looks like Myth is still trying to use Xv, which is why it's having problem. I have configured my Myth to use mplayer instead of the internal player so I never see this issue.
Not ideal, but I am so annoyed with the catalyst driver, that I will live with it. Hopefully xvideo will come to the HD3200, but apparently this requires 3d and not all the docs have been released by ATI.
One remaining minor annoyance is that HDMI audio doesn't get mutted while fast forwarding.
jp
Any help is greatly appreciated.
I haven't completed TV part yet, at the moment I am only using it for DVD and Video playback. As far as I am aware though you have to use the internal player for TV playback.
So until AMD release information on their new XvBA architecture (http://www.phoronix.com/scan.php?page=article&item=amd_xvmc_xvba&num=1) that's inside the latest fglrx you may be out of luck, especially with HD content.
Is this normal? Plus I cannot get SPDIF to work, whilst using audio over HDMI.
Chris
No this shouldn't be normal, does the video stutter at all at the same time? Can you try upgrading to Catalyst 8.11? In regards to SPDIF, as far as I am aware (correct me if I am wrong here though) you can only choose one output audio device, since we are changing the audio output default device to be HDMI then that is where the audio will come from. I guess you could do two things in the situation. Set the SPDIF to be the default audio out device and then when you require HDMI audio specify the HDMI audio device within the application you are using. For instance using mplayer you would use -ao alsa:device=hw=1.3 (for me anyway, the 1.3 may be different on yours, which it shouldn't be since it's the same motherboard).
Either way I'm taking your direction and moving to the radeonhd drivers. I'm praying the tearing stops and the sound becomes perfect.
Thanks again.
I was wondering if you had any more ideas or suggestions for this? I need both the HDMI Sound + Direct Rendering OpenGL for my setup (a Boxee machine).
Unfortunately at the moment radeonhd does not support accelerated video/2d/3d, although this is something that I hope will arrive for Christmas. At the moment if you need OpenGL your only option is the ATI Catalyst drivers. As to why it's not working with ATI's driver I am not quite sure, but the HDMI audio support in fglrx is buggy as you can see, since the radeonhd driver works with it no problem.
So now my plan is to go back to Catalyst 8.11, using DVI-to-HDMI and try to get optical out to work. If I can do that, then my last problem is video tearing during playback.
--wpd
Thank. Now fixed