Subject: Re: 48 kHz does not work on snapper(4) on NetBSD 3.1
To: Marco Trillo <marcotrillo@gmail.com>
From: Michael Lorenz <macallan@netbsd.org>
List: port-macppc
Date: 12/07/2006 13:40:22
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

On Dec 7, 2006, at 12:52, Marco Trillo wrote:

> On 12/7/06, Marco Trillo <marcotrillo@gmail.com> wrote:

>> When playing an audio file at 48000 samples/sec on snapper(4) on
>> NetBSD 3.1, it plays at a speed of 44100 samples/sec (so it plays at
>> 91% speed and with pitch distortion).
>
> Well, I finally got it working!

Great!

> The problem was in snapper_set_rate().
> The Mac OS X I2S controller uses by default a MCLK-to-samplerate ratio
> of 64 which gets a more accurate result.
> However, snapper.c used a ratio of 256 which produced the same result
> for both 44100 and 48000.
>
> If you add a printf() to the current snapper.c to read the variables
> 'mdiv' and 'sdiv', you will see that it will produce the same results
> for both 44100 and 48000.
>
> The following patch for NetBSD 3.1 solves the problem.
> It works for me! Now I get 48 kHz audio! :-)
>
> I will try to make an updated patch against NetBSD-current (and by the
> way add support for 32 kHz too) and send it through send-pr(1).

Ok, I'll wait ;)

have fun
Michael
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iQEVAwUBRXhgFspnzkX8Yg2nAQLHOQf/Vg2KSF32LWr+8CJKWZ4GFnmgZ8ZV6N0m
5eJRecpWD/cnQLGkbjfxbXkJ/Z7xNlF/9huF7qFnoPkoDyJQJXa4mYWyLf43hSQq
QUIMf/AdjSn0gMvRZVFIcv18Nm2jA65rUfvFvK0nhmHgl/haiDJO9y5ehzrKyFqR
+a0dI9vviZxbzTE/5dq4tCC2zImQvmpb5v8K6uRVEZTygk6ziptuT0wUh5zkyqjB
0zUEDpARSj3ZyVQDpzH7lYJpzCHJdPotJmweLtvuvHPCWzuK2AJpQL9S1XZUC0tt
fHs3Xb+CMiepcqpeWhim4vnWQ8en9sT8HYTu3qAoY7kieEcAcvJQ2A==
=Fi8q
-----END PGP SIGNATURE-----