Well, it is time for another of my posts on getting digital audio SPDIF output working on Myth/LinHES.
First some background. I have had a dragon ver. 1.0 reference system for some years now, and it has served me well. I wanted to upgrade the hard disk, so I thought it was a good opportunity to do a clean install. While I was at it, I noticed that the nforce4 board in the system had a built in coaxial SPDIF audio output. I had been using the optical SPDIF output in a Chaintech AV710 card previously. But since I bought a Blu-Ray player, I no longer had enough free optical inputs on my receiver. But it did have a free coaxial input. I had heard that the nforce4 digital audio was now supported in Linux, so, I pulled the AV710 board, and enabled the onboard audio (Nvidia CK804) in the BIOS. Then I installed my new hard drive, which is a SATA drive (previous one was PATA). The install went really well. No hiccups at all that I can recall. So kudos to the LinHES team again. Things worked well, all except digital audio (as usual... *sigh*)...
After some trial and error, and digging up a few forum posts, I got the coax SPDIF audio working tonight. Here is the HOW-TO, for anyone interested. Since LinHES R7.1 is based on MythTV 0.24, this info should apply to those using other Myth distros also.
1) The LinHES Installation guide on the wiki gives this advice in the Troubleshooting section:
Quote:
No Sound after upgrading. If you don't have sound after upgrading, try running alsaconf as root to reconfigure your alsa drivers. Then alsamixer, and finally "alsactl store" to save the settings.
Do this first, and in particular, note the settings in alsamixer for the IEC958 settings. I found the advice in
this post to be helpful (edited to show the item names I see on my system):
Quote:
- In a terminal window digit alsamixer ;
- go right with the arrow until you find the IEC958 settings ;
- set S/PIDIF to 00 ;
- set S/PDIF Playback AC97-SPSA to 0 ;
- set S/PDIF Playback Source to PCM ;
- hit Escape .
To change the settings use the up/down arrows and to change MM to 00 (and vice versa) hit the M key.
This is important as the SPDIF output must be enabled before you can expect to get any sound out of it.
2) Next, I found the
Digtal Audio Tutorial on the official MythTV wiki to be helpful. Some of the info is dated for an earlier version of Myth, but the important part for me was down at "Discover what settings your sound card wants". You use "aplay -l" like this:
Code:
> aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: CK804 [NVidia CK804], device 0: Intel ICH [NVidia CK804]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: CK804 [NVidia CK804], device 2: Intel ICH - IEC958 [NVidia CK804 - IEC958]
Subdevices: 1/1
Subdevice #0: subdevice #0
You need to find the digital output (denoted as "IEC958" for the Nvidia CK804), and note the card and device numbers. In my case it is card 0 and device 2.
Next, under "Set up ALSA for these settings", the guide tells you how to construct an asound.conf file, using the card and device numbers obtained above. I have an asound.conf I have saved and used with each install, and it contains content very similar to that in the guide. So, I will point you to the guide to create the asound.conf file.
For reference, there is also an article on the MythTV wiki called
Enabling nForce4 optical SPDIF output, but I did not find it necessary to perform these actions.
3) Lastly, I referred to
my own previous posting for R6.04. I will recap briefly here:
A) Service Menu -> LinHES Config -> Audio Settings. Here I chose ALSA driver and type Digital. The Selection dialog showed my sound chip: "CK804 [Nvidia CK804](hw:0,2)". I loaded the ALSA driver. Then I exited.
Note that the hw:0,2 corresponds to the card and device numbers found with the aplay -l command above.
B) Service Menu -> MythTv Config -> Setup -> General (fourth screen "Audio System"). Here use "Scan For Audio Devices" at the top of the screen to scan your audio hardware. This populates some choices in the "Audio Output Device" selection just below. I am not certain, but it seems that you need to choose one of the values populated here. On my system, most are analog outputs (and refer to device 0). However, there is "/dev/dsp" which is the value I find to work for me. You can experiment via trial and error with the outputs here, and hopefully one will work for you.
Here are the complete set of settings I use for the Audio System page:
Audio output device: /dev/dsp
Digital Audio Capabilities: Dolby Digital (checked) DTS (checked)
Speaker Configuration: 5.1
Upconvert to 5.1 (unchecked)
Upmix quality: Good
Advanced Audio Config (checked)
Separate digital output device: ALSA:iec958:{ AES0 0x02 }
NOTE: the use of "AES0 0x02" for the Separate Digital output device is specific to my system. The "0x02" maps to device 2, which is the IEC958 output for the CK804 chipset. Make sure you use the value you found for your sound card. Also, I had to edit this value by hand, as it was pre-populated with 0x01 to start.
C) General (screen 5) -> Audio Mixer
Use internal volume controls (unchecked)
All of these steps allow complete digital audio passthrough for me. I welcome comments or suggestions of settings that work for others.
One thing that irks me is that the Speaker Configuration setting of "5.1" on General (fourth screen "Audio System") does not survive reboots. After a reboot, I noticed that TV shows with a Dolby Digital soundtrack have their audio reported to be PCM by my receiver. A look at Speaker Configuration shows that the value has changed to "Stereo". If anyone knows how to make this setting persist, I would be most grateful. I will probably post a separate inquiry about this...
Regards,
Trevor