[mythtv-users] Myth, Jack & resampling

Mark Greenwood fatgerman at ntlworld.com
Fri Jun 27 18:15:20 UTC 2008

On Friday 27 June 2008 05:20:49 Alen Edwards wrote:
> Dave Badia wrote:
> > So I've been playing with jack audio support in mythtv a bit....
> >
> > Sample rates are still a mystery to me.
> > If I run jack with a sample rate of 44100      (jackd -R -dalsa 
> > -diec958 -r44100 -p1024 -n2,   sysout shows configuring for 44100Hz, 
> > period = 1024 frames, buffer = 2 periods)
> > and set MusicAudioDevice to JACK:
> > and I play songs in MythMusic that are sampled at 44100 (flac encoded 
> > files)
> > but I see this in the frontend log
> >
> > JACK tmpdir identified as [/var/run/jack]
> > JACK tmpdir identified as [/var/run/jack]
> > 2008-06-26 22:14:14.693 AO: Using resampler. From: 44100 to 48000
> >
> > and 48.0 kHz appears on the mythmusic UI screen.
> > I confused as to why it is being resampled
> >
> > Pretty sure my source FLAC is indeed 44.1, as if I switch my audio 
> > output to ALSA:iec958, the mythmusic UI screen shows 44.1kHz.
> >
> > Must admit, I'm pretty new to sample rates, etc, so I may be having 
> > some fundamental mis-understanding here.
> >
> > Thanks
> > Dave
> The docs say that JACK outputs to ALSA.
> I think that ALSA is resampling up to 48kHz.  Even if you give it 
> digital in and want digital out, it will decode and encode.  It 
> resamples in the process.  My understanding is that it also does not do 
> a very good job and that it is easy to hear the difference between 
> passthrough and resample mode.  Have not tried it as I could not get the 
> wiki to work and gave up when I read it wasn't going to give me what I 
> wanted anyway.  When you put ALSA in passthrough as you did when you 
> switched it to iec958, it does not resample.

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. I'm not sure how it works when you use ALSA as I only use JACK with Firewire devices, but it looks to me like ALSA is having to do some resampling to keep JACK happy. You should probably try starting JACK at 48KHz. It should make no difference what sample rate your audio files are recorded at - resampling will happen somewhere along the line and ought to be transparent to both your eyes and your ears.


> Hope this helps,
> Allen
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

More information about the mythtv-users mailing list