Comments (7)
So does anybody have a working version of this pifm file either source or compiled one for RasPi 3? 😇
from pirateradio.
@SiobhanRamsey I'm trying to make it work in my Pi3 also but I don't know what I have to do extra to listen it in the radio. Its show in ps aux to be running but It doesnt work. Did you figure it out ?
from pirateradio.
Cheers, guys, any progress on this one? Badly want to run it on my Pi3 :)
Merry Christmas btw :)
from pirateradio.
This project is basically abandoned, no updates for 3 years.
from pirateradio.
Too bad 😟
from pirateradio.
The problem is that the C program directly accesses the GPIO memory, and on the Raspberry Pi 2 and Pi 3 they used a different broadcom processor which results in all the memory mapped addresses for the hardware peripherals changing. The method the code uses to access GPIO for example is deprecated (it reads at a specific base address in real memory, which is only valid on the original BCM2835 chip in the Raspberry Pi 1). The Pi 2 uses a BCM2836 and the Pi3 uses yet another different CPU chip.
The recommended way to get the base address of the GPIO peripheral is to read the various magic numbers coded inside the BCM chip firmware, which is mapped into the virtual file /proc/device-tree/soc/ranges
So, the code in this file....
https://github.com/Make-Magazine/PirateRadio/blob/master/pifm.c#L99
Should be modified to read the various magic numbers from the soc file and use those instead.
Here is an example C file where I do this in one of my drivers...
https://github.com/whaleygeek/pyenergenie/blob/master/src/energenie/drv/gpio_rpi.c#L54
void gpio_init()
{
uint32_t peri_base = BCM2708_PERI_BASE; /* default if device tree not found */
uint32_t gpio_base;
FILE* fp;
/* for RPi2, get peri-base from device tree */
if ((fp = fopen("/proc/device-tree/soc/ranges", "rb")) != NULL)
{
unsigned char buf[4];
fseek(fp, 4, SEEK_SET);
if (fread(buf, 1, sizeof(buf), fp) == sizeof(buf))
{
peri_base = buf[0]<<24 | buf[1]<<16 | buf[2]<<8 | buf[3];
}
fclose(fp);
}
gpio_base = peri_base + GPIO_BASE_OFFSET;
/* open /dev/mem */
if ((mem_fd = open("/dev/mem", O_RDWR|O_SYNC) ) < 0)
{
printf("can't open /dev/mem \n");
exit(-1); //TODO return a result code
}
/* mmap GPIO */
gpio_map = mmap(
NULL, //Any adddress in our space will do
BLOCK_SIZE, //Map length
PROT_READ|PROT_WRITE,// Enable reading & writting to mapped memory
MAP_SHARED, //Shared with other processes
mem_fd, //File to map
gpio_base //Offset to GPIO peripheral
);
close(mem_fd); //No need to keep mem_fd open after mmap
if (gpio_map == MAP_FAILED)
{
printf("mmap error %d\n", (int)gpio_map);//errno also set!
exit(-1); //TODO return a result code
}
// Always use volatile pointer!
gpio = (volatile unsigned *)gpio_map;
}
from pirateradio.
@DavidWhaleMEF I don't really have a great understanding of this code, but something like this?
from pirateradio.
Related Issues (18)
- Archlinux setup? HOT 4
- Bug in Read_config? HOT 6
- Incorrect config_location in PirateRadio.py - Line 17 HOT 1
- Make: Pirate radio on Raspberry PI B+ HOT 2
- Getting an error when running PirateRadio.py HOT 4
- Change what GPIO pin is used for output HOT 5
- UnicodeDecodeError: HOT 3
- Raspberry pi 2 HOT 4
- error in the line read_config() HOT 3
- Error running PirateRadio.py HOT 10
- Add RDS support
- About DMA
- Bad audio quality HOT 1
- Release source code of pifm.c HOT 4
- configparser for Pi/Raspbian HOT 4
- AirPlay streaming support HOT 2
- Bluetooth A2DP Streaming support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pirateradio.