[mythtv-users] SPDIF and analog audio simultaneously

Kevin Kuphal kuphal at dls.net
Wed Jul 7 00:59:31 EDT 2004


Kevin Kuphal wrote:

> J. Scott wrote:
>
>> Thanks to a lot of information from this archive, I was able to get 
>> my SPDIF output working properly using my nForce onboard audio.
>>
>>  
>>
>> I'm still working on the issue of being able to output analog audio 
>> simultaneously with SPDIF. I distribute the audio and video 
>> throughout my house via a rf modulator that requires an analog audio 
>> signal. For this purpose, I have to always have analog audio enabled.
>>
>>  
>>
>> I recently got a 6.1 home theater set up, so I'd like to be able to 
>> send a digital audio signal directly to the receiver. I really only 
>> need this feature for MythVideo and maybe MythMusic.
>>
>>  
>>
>> So I'm looking for ideas on how to either:
>>
>>  
>>
>> 1. Have the audio output delivered in both analog and digital format 
>> simultaneously. Everything I've seen so far indicates that you have 
>> to specify a single device (analog or digital) for the audio output. 
>> I wonder if a solution might include using a separate soundcard, or 
>> using some of the other 5.1 channels built into the onboard soundcard???
>>
>>  
>>
>> OR
>>
>>  
>>
>> 2. Devise a simple way to switch between digital output and analog 
>> output, preferrably using the remote control. This is reasonably easy 
>> with MythTV and MythMusic, but I can't see any way to do it in 
>> MythVideo without altering the mplayer command line- a little tricky 
>> from the remote!
>>
>>  
>>
>> Worst case I guess I could get a cheap front-end (xBox?) to put in 
>> the cabinet with the home theater receiver. I believe the xBox 
>> supports SPDIF output.
>>
>>  
>>
>> Thanks for the ideas!
>>
> I think what you're looking for is the ALSA PCM plug-in "dshare"
>
> Something like this in your .asoundrc:
>
> pcm.dualchannel {
>    type share
>    slave spdif
>    bindings.0 0
>    bindings.0 1
>    }
> }
>
> Now, I might have the bindings mixed up as I've never done this, but 
> you can see the reference material from ALSA here:
>
> http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html#pcm_plugins_dshare 
>
>
> I think what it means is you define pcm.dualchannel as your default 
> ALSA device like:
>
> pcm.!default {
> type plug
> slave.pcm "dualchannel"
> }
>
> And the dual channel definition takes the spdif output and maps 
> channel 0 to channel 0 and channel 0 to channel 1.  I think that means 
> that your digital would be hw:0,0 and your analog hw:0,1 (thus channel 
> 0 and 1 on card 0)
>
I messed up the definition.

pcm.dualchannel {
   type dshare
    ipc_key 1234
   slave spdif
   bindings.0 0
   bindings.0 1
   }
}

Again, I'm not sure if this even works as I wrote it but I hope it gets 
you in the right direction.

Kevin



More information about the mythtv-users mailing list