[mythtv] [patch] multi channel audio patch 1

Steve Adeff adeffs at gmail.com
Sat Dec 31 14:26:52 EST 2005

On Friday 30 December 2005 15:12, Michael T. Dean wrote:
> Allan Stirling wrote:
> > Michael T. Dean wrote:
> >> Instead of re-encoding to AC-3, ALSA will allow 6-channel PCM output
> >> via the digital connection.
> >
> > Not according to:
> >
> > http://alsa.opensrc.org/SurroundSound
> >
> > "Note that surround51 and surround40 are supposed to be analog, not
> > for the digital AC3/DTS. They don't decode anything. They just support
> > the multi-channel PCM."
> Yeah.  I know those are analog.
> > http://www.epanorama.net/documents/audio/spdif.html
> >
> > "IEC958 was named IEC60958 at 1998. IEC60958 (The S/PDIF) can carry
> > normal audio and IEC61937 datastreams. IEC61937 datastreams can
> > contain multichannel sound like MPEG2, AC3 or DTS. When IEC61937
> > datastrams are transferred, the bits which normally carry audio
> > samples are replaced with the databits from the datastream and the
> > headers of the S/PDIF signal. Channel-status information contains one
> > bit (but 1) which tells if the data in S/PDIF frame is digital audio
> > or some other data (DTS, AC3, MPEG audio etc.). This bit will tell
> > normal digital audio equipments that they don't try to play back this
> > data as they were audio samples. (would sound really horrible if this
> > happens for some reason)."
> >
> > So most decoders only support 48kHz @ (max) 24bit x 2 channels.
> > Dividing this down to get more channels isn't supported AND would
> > sound nasty.
> >
> > Hence why AC3, DTS etc is used as the protocol.
> OK.  I stand corrected.  I didn't realize S/PDIF was so limited.  I had
> seen a lot of info on the 'net talking about multi-channel PCM audio
> over S/PDIF, but had never actually tried it myself (having a 2 speaker
> setup and all).  I may use analog connections instead of digital, after
> all.

I was going to comment on this, but yes, S/PDIF has a very low bitrate 
transfer ability, which is why some soundcards (and the xbox) have ac3 
encoder chips to allow them to take PCM 6channel from games and encode them 
to ac3 for digital output. 

Now, for the specific use of timestretch with AC3 output, I don't see why one 
should worry about re-encoding to AC3 as far as sound quality, the conversion 
won't loose much overall, and for someone using timestretch I don't think 
they'll care if they are getting a bit-perfect time stretched ac3 signal to 
their receiver.

So, if ALSA can reencode to AC3, I think it would be a great idea for the 
timestretch code.

It would also be a nice feature to allow for MythMusic as well. I currently 
use XBMC's ability to output music to all channels when I'm playing music in 
"the background" to do work around the apartment, etc. If the code for doing 
this has already been figured out, patching it into MythMusic would be a nice 
second step.


More information about the mythtv-dev mailing list