[mythtv-users] mythmusic iec958 help

Joe Henley joehenley at kc.rr.com
Sun Jul 6 22:48:59 UTC 2008


Mark,

"I may be getting the various ongoing spdif threads confused here, but 
if your audio pitch is too high then your audio is not being re-coded 
anywhere. What's happening is that a 44.1KHz signal is being clocked at 
48KHz - the samples are being played too fast, giving rise to the pitch 
change. The problem is that it *should* be being resampled to 48KHz 
somewhere along the line if the output sample rate is 48KHz. Resampling 
means exactly that - a 44.1KHz signal is re-coded using interpolation 
into a 48KHz signal, thus changing the sampling rate without altering 
the pitch. I may be saying the same thing as you in a different way, but 
I wanted to be clear where I'm coming from. "

Yes, you are correct.  The CD signal is written on the disk with a 
44.1KHz sample rate by the producer.  The data stream comes off the CD, 
sent to the sound card (drivers) and then sent to the spdif connector. 
But before it sends it, it adds a header which indicates the underlying 
sample rate.  On some sound cards, it just assumes everything will have 
a 48KHz sample rate (ie., DVD, TV off the TV card, etc.), ignores the 
44.1KHz standard for CD's, and uses 48KHz for everything.  And for a 10% 
error, in a world of MP3's -- where the sound quality is very low -- 
this is a reasonable cost reduction for the sound card maker.

When that signal comes out the spdif and into the amp, if it's a CD 
sound, the data is from a sampling at 44.1KHz, but the header says its 
at 48KHz.  The amp trusts the header info, runs it thru a dac at 48KHz 
rate, and the analog signal is now 10% too high or fast.

Some sound cards can take a properly "headered" CD data stream (@44.1 
KHZ), up-sample it to 48KHz, and then output it.  This eliminates most 
of the problems, but unfortunately, the alsa routines called to do this 
(IMO) focus on lower CPU use and not high quality re-sampling, and thus 
many people think the results are about as bad as as just defaulting to 
48KHz in the header.  There are some professional quality re-samplers 
out there, and they are often used for this task, but they are quite 
expensive.

"I have the optical out connected to my surround amp (a Yamaha 
DSP-E800). It doesn't mention anything about 44.1KHz spdif output. I 
have the optical out connected to my surround amp (a Yamaha DSP-E800). 
It doesn't mention anything about 44.1KHz spdif output. "

Does the Yamaha have any indicator lights to inform you of the type of 
signal it's getting?  I have a Denon which does this; made my original 
efforts at sorting all this junk out -- much easier.

"FWIW the volume control doesn't work, but this doesn't matter as my 
surround amp has a volume control on it. I wouldn't expect to set the 
volume from my cable box or DVD player either. "

Right, spdif is signal only.  Amp does the d to a and manages volume of 
the speakers.

IIRC, MP3 is always at 48KHz, then compressed, then transmitted.  The 
DVD's are originally sampled at 48KHz.  I don't know about the 22KHz 
internet stream and videos.  But from what you describe, your USB sound 
card is able to properly recognize the underlying sample rate and code 
the  (spdif bound) data header correctly.

"The sampling rate of the source material should be irrelevant, 
otherwise everything would have to be recorded at the same sampling rate 
everywhere and you wouldn't be able to play DVDs and CDs on the same 
machine. Which, basically, is the problem being discussed... I would not 
expect any digital sound system to be incapable of doing that. Something 
is very wrong somewhere if that isn't working. "

And yes, you're correct here, too.  There is something wrong with 
pre-pending a header which says CD data sampled at 44.1KHz is really 
sampled at 48KHz.  But most sound cards do this.

Joe Henley


More information about the mythtv-users mailing list