View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 10 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Wed Jan 04, 2012 9:45 pm 
Offline
Joined: Sun Oct 30, 2005 7:07 pm
Posts: 72
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 05, 2012 12:45 am 
Offline
Joined: Tue Aug 15, 2006 11:14 am
Posts: 1293
Location: Orlando FL
This has always been a struggle for me as well My latest bug is that with 7 it recognizes my HDMI port as an audio port and want's to use it.... Still on 6.03 till I figure it out.

_________________
My System


Top
 Profile  
 
PostPosted: Thu Feb 23, 2012 8:49 am 
Offline
Joined: Wed May 24, 2006 9:10 am
Posts: 107
Location: Minneapolis, MN
Quote:
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...


Thanks for the guide. I also have dragon V1.0 hardware, but chose to stick with the Chaintech AV-710 because I thought it would be easier. Anyway, even with the chaintech, my sound setting switches from 5.1 to stereo after a reboot. I too am looking for any answers to get the 5.1 setting to stick after a reboot.


Top
 Profile  
 
PostPosted: Thu Feb 23, 2012 10:15 am 
Offline
Joined: Sun Sep 05, 2004 7:06 pm
Posts: 690
That write up was very insightful, thanks for sharing it. My system is inching ever so closer to 5.1 if I could only get a amp upgrade :(
This brought to mind an issue that I had with ALSA. I'm not sure this pertains but here goes.

For a long time I stuggled with mythback completing correctly. One of the issues that I had when the backup would run it would stop at the end
ALSA Asound state and would say it could not find it. My sound worked correctly but it seemed this I was missing something configuration wise.
I researched and found that this has to do with the default sound install of ARCH Linux.

[url]https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture
[/url]
Quote:
you just need to save your mixer settings


Code:
# alsactl store


Quote:
This will create the file /var/lib/alsa/asound.state, saving the alsamixer settings.

Quote:
Then, add the alsa daemon to your DAEMONS array in /etc/rc.conf to automatically restore the mixer settings at boot. See rc.conf#Daemons for detailed instructions.



If I'm correct then you just have a custom config for ALSA rather than a bug


Top
 Profile  
 
PostPosted: Sat Feb 25, 2012 10:41 pm 
Offline
Joined: Wed May 24, 2006 9:10 am
Posts: 107
Location: Minneapolis, MN
Thanks for the tip RacerX, I followed your recommendation. Unfortunately it did not fix the problem. The system still reverts back to stereo from 5.1 after reboot.


Top
 Profile  
 
PostPosted: Tue Mar 06, 2012 4:43 pm 
Offline
Joined: Wed May 24, 2006 9:10 am
Posts: 107
Location: Minneapolis, MN
Does anyone else have this issue of 5.1 sound reverting back to stereo after a reboot? I am just trying to figure out if it is specific to nforce4 boards. Since I am using a chaintech, I would think not, but you never know....


Top
 Profile  
 
PostPosted: Tue Mar 06, 2012 10:11 pm 
Offline
Joined: Mon Dec 24, 2007 9:47 am
Posts: 535
Location: Ottawa, Canada
tama102 wrote:
Does anyone else have this issue of 5.1 sound reverting back to stereo after a reboot? I am just trying to figure out if it is specific to nforce4 boards. Since I am using a chaintech, I would think not, but you never know....

I have an nforce4 based board running 5.1 on one of my frontends with no issues. I am at 7.2 plus latest updates but have never had an issue of this sort.

When you say it is reverting to stereo, where do you see this? I assume you did a rescan within the mythtv audio settings page.


Top
 Profile  
 
PostPosted: Thu Mar 08, 2012 10:29 am 
Offline
Joined: Wed May 24, 2006 9:10 am
Posts: 107
Location: Minneapolis, MN
Hey christ,

Its under Service Menu -> MythTv Config -> Setup -> General (fourth screen "Audio System"). Then under the "speaker configuration" option, I set it to 5.1. When I go back and play a recording, my amp then recognizes and output the signal as dolby digital 5.1. I can go back to that service menu screen at any time and it is still set to 5.1 under speaker configuration.

However, once the system is shutdown or rebooted, the sound output displayed by my amp is 'stereo'. Sure enough I go back into Service Menu -> MythTv Config -> Setup -> General (fourth screen "Audio System") and under speaker configuration the system has changed it to "stereo". For this reason, after every shutdown or reboot, I have ot go into the service menu and change it from stereo to 5.1


Top
 Profile  
 
PostPosted: Thu Mar 08, 2012 8:56 pm 
Offline
Joined: Mon Dec 24, 2007 9:47 am
Posts: 535
Location: Ottawa, Canada
ok. Well I assume you also set the sound to ALSA in the LinHES audio menu. It seems to default to OSS but I prefer ALSA. I also assume you have done the rescan audio on the page you mention.

The one thing that comes to mind is you may either have 2 sound cards in your system and they may be swapping positions or the one card you have is changing places on the pci bus. I know this because I transitioned from SPDIF to HDMI recently and didn't bother to take out my old sound card and sure enough they were swapping around.

What does "aplay -l" and "aplay -L" show?

Does the frontend log or dmesg show anything peculiar?

it is possible that the db is partially corrupt but I doubt it. If in doubt run "optimize_mythdb.pm" which might correct this.

More likely is myth is detecting a change in the config and setting the db so start with the fundamentals per above. Hope that helps get you started. I'll be offline for a while.


Top
 Profile  
 
PostPosted: Mon Mar 19, 2012 8:03 am 
Offline
Joined: Wed May 24, 2006 9:10 am
Posts: 107
Location: Minneapolis, MN
Alright, sorry for the long delay in response, didnt have a chance to tinker for awhile. aplay -l showed what I thought it would, that my card and digital audio out it on device 0, hardware 1. This is how I had my asound.conf setup, so I thought it should be working. After some tinkering and reloading of drivers, I did get it to work. here is what I did:

1.) Deleted my asound.conf file in /etc/.
2.) rebooted
3.) Reset my ALSA driver by going to the Linhes service menu, then loaded OSS driver, and rebooted. Once rebooted, I went back into the service menu and loaded ALSA driver. Set sound card driver to ALSA, and type to digital in the same menu. Then set the card to AV710[Chaintech AV-710](hw:0,1)
4.) Lastly in the mythtv service menu, set output device to ALSA:iec958:Card=AV710,DEV=0, check dolby digital and dts, speaker config 5.1.
5.) Reboot

After doing this, I got the dolby digital settings to stay after a reboot. Not exactly sure why this worked, I probably could have skipped some of the steps, but this is what worked for me, and now I am 99% ready to make the switch to 7.2 (last thing to do is to get Lirc to work with xbmc).


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu