Closed broken2048 closed 5 years ago
Thank you for putting out the pull request, it is greatly appreciated!
We certainly need a better way to handle different Raspberry Pi versions though. We don't need to hardcode the base addresses, since they can be determined at run-time with bcm_host.h
https://www.raspberrypi.org/documentation/hardware/raspberrypi/peripheral_addresses.md
All that's left is DMA_CHANNEL
and CLOCK_BASE
. For dma channel, it would be great if we could figure out a free one at run-time. And well the clock base will probably stay hardcoded forever, since I'm not sure if we can even determine that.
Notes: Makefile : /proc/cpuinfo was the only way I could determine Pi 4 hardware, all three memory variants Revision end in "11". int srate ( sample rate ) and int nochan ( number of channels ) is necessary for PCM streams without a detectable header to determine these values. ( mpg123 --stdout <> | as an example ) CLOCK_BASE and DMA_CHANNEL are now hardware dependent. For an analysis of these new Pi 4 values , please see : https://www.raspberrypi.org/forums/viewtopic.php?f=72&t=244479&start=25