Yes, I'm aware that there is a factor of two/one bit that is missing. You can run:
- Code: Select all
/opt/vc/bin/vcgencmd measure_clock pwm
which is right. But if I set PWM_RANGE to 0x800 as I predicted I could, the audio comes out at half speed.
Can you run with 0x800?
I turned off the 2 noxious REPEATFF bits and changed the REANGE to 0x800 -
same frequency, cleaner sound... compare
cc -DTEST_AMPLITUDE=0.005 -o mmap-sinetest4 mmap-sinetest4.c -lm && ./mmap-sinetest4
cc -DTEST_AMPLITUDE=0.005 -o mmap-sinetest5 mmap-sinetest5.c -lm && ./mmap-sinetest5
(amplitude turned way down low so errors are more audible.) I think it's 11 bits now.
(will stay off the emoticons since this web page turns them to ugly sprites, too bad...)