[mythtv-users] Myth, Jack & resampling

Alen Edwards allen.edwards at oldpaloalto.com
Fri Jul 4 19:30:15 UTC 2008



Mark Greenwood wrote:
> On Friday 04 July 2008 15:57:04 Dave Badia wrote:
>   
>> On Fri, Jun 27, 2008 at 2:15 PM, Mark Greenwood <fatgerman at ntlworld.com>
>> wrote:
>>
>>     
>>> It would appear from your log that your sound card runs at a native sample
>>> rate of 48KHz (a lot of them do, especially if they have digital IO). In
>>> order to get its timing correct, JACK needs to run at the same rate.
>>>       
>> Ah, so assuming my sound card only supports 48KHz, that would explain why
>> the myth code is resampling the output.  Is there some definitive way I can
>> see if my sound card (mb audio VT8233) supports output at the 44.1KHz sample
>> rate?  Seems like that's the what this is coming down to...
>>
>> From all of the "bit-perfect audio" articles I've been reading, it seems
>> that some sound cards will pass through at 44.1KHz, but others won't.
>>
>> for reference, lspci shows:
>> 00:11.5 Multimedia audio controller: VIA Technologies, Inc.
>> VT8233/A/8235/8237 AC97 Audio Controller (rev 60)
>>     
>
> It's a complicated problem... To the very best of my knowledge, all "standard" digital audio I/O is 48KHz. Therefore if the source audio is not 48KHz it will have to be resampled somewhere along the line. If the sound card supports "pass-through at 44.1KHz" then what's actually happening is that the sound card is doing the resampling to 48KHz. In your case, your other email implies that myth is doing the resampling. This would tend to indicate that myth is running internally at 44.1KHz and is having to resample in order to send data at the rate the sound card requires. This in turn implies that the sound card driver is running at 48KHz.
>
> So, because you're using jackd we have the opportunity to experiment. What sample rate is jackd running at? I like to use qjackctl to start jackd, it's a much easier way of playing with the settings. If you start jackd at 48KHz then it will require audio to be sent to it at 48KHz. Audio at any other rate will play at the wrong speed. If, in this scenario, myth is still doing resampling then it implies that myth is running internally at 44.1KHz and is resampling in order to pass the data to jack at the rate jack requires. This to me doesn't sound like a very good thing but as far as I know there's no way to change the sample rate myth uses internally. In this scenario you could try starting jackd at 44.1KHz and see what happens. Your sound card might then do the resampling for you. Which is usually a good thing.
>
> Note that when you use qjackctrl you are able to patch inputs to outputs on the fly and save the settings - this is usually much easier and far more flexible than passing command line parameters to jackd to tell it which output to use. I start jackd by having qjackctrl start up at boot. I'd suggest you give it a try.
>
> It's complicated when you start including jackd in the equation, but at least you have full control over it. Like I say though I don't know a lot about how it interacts with ALSA because I use it with freebob as the driver. Your best bet for now would seem to be to play around with the sample rates and see what happens.
>
> Mark
>
>   
>> Thanks for the help
>> Dave
>>
>>     
>
>   
I don't think it is correct to say all digital I/O is 48KHz.

 From Wikipedia:  "S/PDIF is used to transmit digital signals of a 
number of formats, the most common being the 48 kHz sample rate 
<http://en.wikipedia.org/wiki/Sample_rate> format used in DAT 
<http://en.wikipedia.org/wiki/Digital_Audio_Tape>, and the 44.1 kHz 
format used in CD audio."

And from Answers.com:
"S/PDIF is used to transmit digital signals of a number of formats, the 
most common being the 48 kHz sample rate 
<http://www.answers.com/topic/sampling-rate-2> format used in DAT, and 
the 44.1 kHz format used in CD audio. In order to support both systems, 
as well as others that might be needed, the format has no defined data 
rate <http://www.answers.com/topic/bit-rate-1>. "

Apparently some old sound cards only output 48KHz.  They clearly don't 
meet the S/PDIF specification.

Allen



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-users/attachments/20080704/15eacdc6/attachment.htm 


More information about the mythtv-users mailing list