PiFmRds icon indicating copy to clipboard operation
PiFmRds copied to clipboard

PiFmRds on Raspberry Pi 4

Open Salisito opened this issue 5 years ago • 43 comments

Hi I've buyed a Raspberry Pi 4, 2gb RAM. Before I've had the Raspberry Pi 3 with PiFmRds working. Now I've installed PiFmRds on the raspi 4 and when I run the command, the console says me that it's working in X frequency but in really not, when I tune the frequency that I've set, there's white noise. Has the new raspberry the gpio4 FM disabled or something like this?

Thanks

Salisito avatar Oct 04 '19 04:10 Salisito

Did you use the latest version of the code? Support for the Raspberry Pi 4 was contributed by @markondej a few days ago. I personally don't have a RPi 4 to test.

ChristopheJacquet avatar Oct 04 '19 16:10 ChristopheJacquet

I've installed PiFmRds just yesterday using git clone https://github.com/ChristopheJacquet/PiFmRds.git

Salisito avatar Oct 04 '19 16:10 Salisito

I've just double checked it on RPi4 2GB and on July's Raspbian lite distro it works like a charm (I do always use lite distros). Maybe there's a problem with used DMA channel, try changing definition of DMA_BASE_OFFSET from 0x00007000 to 0x00007500, 0x00007900 etc. (there are 15 DMA channels available). https://github.com/ChristopheJacquet/PiFmRds/blob/master/src/pi_fm_rds.c#L151 I'll try to test it on newest Raspbian (released week ago) and will let you know if any issues occur.

markondej avatar Oct 04 '19 19:10 markondej

I'm going to install lite distro and I'll try again. At the moment I've changed DMA channels and it stills not work.

Salisito avatar Oct 04 '19 19:10 Salisito

I've installed Raspi Lite and PiFmRds and still don't work. When I play something, there are like some interferences. I've also triied in other frequencies. I attach video.

https://drive.google.com/open?id=1CMSGVK1XaeZNwmoAK21N4mxBpRP288cy

Also, when I've wrote "make clean" I've got this:

pi@raspberrypi:~ /PiFmRds/src $ make clean rm -f *.o pi@raspberrypi:~ /PiFmRds/src $ make gcc -Wall -std=gnu99 -c -g -march=armv7-a -O3 -mtune=arm1176jzf-s -mfloat-abi=ha rd -mfpu=vfp -ffast-math -DRASPI=4 rds.c rds.c: In function ‘set_rds_rt’: rds.c:240:5: warning: ‘strncpy’ specified bound 64 equals destination size [-Wst ringop-truncation] strncpy(rds_params.rt, rt, 64); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rds.c: In function ‘set_rds_ps’: rds.c:247:5: warning: ‘strncpy’ specified bound 8 equals destination size [-Wstr ingop-truncation] strncpy(rds_params.ps, ps, 8); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gcc -Wall -std=gnu99 -c -g -march=armv7-a -O3 -mtune=arm1176jzf-s -mfloat-abi=ha rd -mfpu=vfp -ffast-math -DRASPI=4 waveforms.c gcc -Wall -std=gnu99 -c -g -march=armv7-a -O3 -mtune=arm1176jzf-s -mfloat-abi=ha rd -mfpu=vfp -ffast-math -DRASPI=4 pi_fm_rds.c gcc -Wall -std=gnu99 -c -g -march=armv7-a -O3 -mtune=arm1176jzf-s -mfloat-abi=ha rd -mfpu=vfp -ffast-math -DRASPI=4 fm_mpx.c gcc -Wall -std=gnu99 -c -g -march=armv7-a -O3 -mtune=arm1176jzf-s -mfloat-abi=ha rd -mfpu=vfp -ffast-math -DRASPI=4 control_pipe.c gcc -Wall -std=gnu99 -c -g -march=armv7-a -O3 -mtune=arm1176jzf-s -mfloat-abi=ha rd -mfpu=vfp -ffast-math -DRASPI=4 mailbox.c gcc -o pi_fm_rds rds.o waveforms.o mailbox.o pi_fm_rds.o fm_mpx.o control_pipe.o -lm -lsndfile

Salisito avatar Oct 04 '19 19:10 Salisito

@markondej I've also tryied to install your repository and it doesn't work (https://github.com/markondej/fm_transmitter)

Salisito avatar Oct 04 '19 20:10 Salisito

Checked newest Raspbian release and yes, it doesn't work (26 sep 2019). When simply simulating carrier via clock output (on GPIO4) the generated signal is noisy. I have no idea if this is problem with output itself or with clock source (PLLD). Like I wrote earlier everything seemed to work on July's release. I guess they messed something up with firmware (were there any GPU performance releated changes etc?). I will try to change clock source to any other and find out if this would work.

markondej avatar Oct 06 '19 12:10 markondej

Okey, I hope you can fix it!!

Thaanks

Salisito avatar Oct 06 '19 14:10 Salisito

@markondej have you been able to solve the problem?

Salisito avatar Oct 11 '19 13:10 Salisito

Nope, but I've managed to bypass it a little bit. You can switch to GPIO21 instead of GPIO4. I made branch with this "feature".

https://github.com/markondej/PiFmRds

It seemed to work, but there is still a lot of noise...

markondej avatar Oct 13 '19 23:10 markondej

It doesn't work for me...

Salisito avatar Oct 14 '19 14:10 Salisito

I am also having an issue transmitting with the PI 4. I pulled the branch using GPIO21, and also had could not get this working properly.

I can see the change in GQRX when I start he fm_rds command, but, nothing is distinguishable.

captroy avatar Nov 01 '19 15:11 captroy

I seem to be having the same issue =/

GithubKillsMyOpsec avatar Dec 28 '19 18:12 GithubKillsMyOpsec

Maybe this is a pointer to the right solution

Richard G Hirst added RPi4B support to his ServoBlaster and comments on DMA as follows:

The DMA channel used depends on the SOC type. If the Pi has a BCM2711 (Pi4B only, at present) then it uses channel 7; otherwise it uses channel 14.

Source = https://github.com/richardghirst/PiBits/tree/master/ServoBlaster

waterwin avatar Jan 13 '20 22:01 waterwin

Hi all, Thanks for the very useful and neat program.

I have the Raspberry Pi4 with 4GB RAM, running the latest Raspbian Buster distro. Downloaded and compiled the source with no issues (thank you!).

However the problem is I can't seem to get the signal to output an audible signal. The progeam does not generate any error, but when I tune my car radio to the signal it's supposedly outputting signal to, the only thing I can hear is pulses. Something is there though because it is clearly different when the program is running vs not running. But yeah, all I can hear is small pulses, no matter which .wav I used on the -audio tag (I tried all the different supplied samples).

Any pointer in the right direction would be much appreciated! I know a problem is already recognised in the above convo, just in case this is a bit different.

Thanks in advance, and keep up the great work!

henry-shadowjet avatar Feb 03 '20 04:02 henry-shadowjet

Hi all, Thanks for the very useful and neat program.

I have the Raspberry Pi4 with 4GB RAM, running the latest Raspbian Buster distro. Downloaded and compiled the source with no issues (thank you!).

However the problem is I can't seem to get the signal to output an audible signal. The progeam does not generate any error, but when I tune my car radio to the signal it's supposedly outputting signal to, the only thing I can hear is pulses. Something is there though because it is clearly different when the program is running vs not running. But yeah, all I can hear is small pulses, no matter which .wav I used on the -audio tag (I tried all the different supplied samples).

Any pointer in the right direction would be much appreciated! I know a problem is already recognised in the above convo, just in case this is a bit different.

Thanks in advance, and keep up the great work!

I'm in the same boat. I have rasberry pi 4 2gigs. I'm running kali and ssh into it I feel like everything's install commands run but nothing happens. Just s tiny bit of static? I'm not sure if it's running properly. Maybe my signal isnt strong enough but the cord is right next to my antenna. I think this is updated to work for pi 4 but idk if the make clean and make command is working? Let me know if you get it to work.

JokrCode avatar Feb 04 '20 04:02 JokrCode

There was just a kernel update today to 4.19.97-v7l+, so I tried it again with much anticipation, but unfortunately yielded the same result. Still the same static and pulses.

I do have a short wire same as you do, but the radio antenna and the wire is pretty much touching each other so I assume that's not an issue, but thought I should mention it just in case.

Thanks everyone. Any info would be appreciated.

henry-shadowjet avatar Feb 06 '20 23:02 henry-shadowjet

Same with mine I get nothing but I do see something happening but seems not strong enough to take over. Theres another kernel update recently but I haven't done either of them. Is there a way to do it on kali I just dont wanna reinstall it all again just to update the kernel

JokrCode avatar Feb 15 '20 01:02 JokrCode

Since the new kernel update, I can't even get the pulsing sound I get before. Now it's as if nothing happens when I activate the program. Go figure. Haha

henry-shadowjet avatar Feb 16 '20 21:02 henry-shadowjet

Lately I've had some time to play with spectrum analyzer, and this is what worked for me: First, try switching antenna to GPIO21 (last PIN on RPi4 header) using my branch ( https://github.com/markondej/PiFmRds ). Before you start transmitting switch ARM core frequency scaling governor to "performance" settings:

echo "performance"| sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Finally use frequencies below 93.5 MHz

sudo ./pi_fm_rds -audio pulses.wav -freq 92

markondej avatar Mar 21 '20 21:03 markondej

Wow @markondej, now it works!! But the audio quality is not like before...

Salisito avatar Mar 21 '20 22:03 Salisito

There's like a distorsion

Salisito avatar Mar 22 '20 14:03 Salisito

Hello I am trying to get transmission above 93 mhz but no chance My question is why we cant transmite above 93 mhz And i want tell you they published "bcm2711 arm periferals.pdf" take a look at https://github.com/raspberrypi/documentation/tree/master/hardware/raspberrypi/bcm2711

goutx2 avatar Apr 21 '20 00:04 goutx2

Hi there - same deal. I'm on a Raspberry Pi 4, with 4GB of RAM. But instead, I've installed Ubuntu 64bit. I've had no luck running the application, or any available variation. It uses a different architecture (armv8a + aarch64). Given the FPU is not available on this platform, am I right in speculating we won't be having much luck for a while? I'm not good with such low-level code myself.

Budgiebrain994 avatar Apr 26 '20 13:04 Budgiebrain994

The Pi 4 is known to have issues, see this repo that mentions it.

makew0rld avatar May 11 '20 04:05 makew0rld

Bonjour, quand je veux compilé le programme sur ma raspberry pi 4 4g en utilisant make, il me met des message d'erreur comment les résoudre ?

doctorsax avatar May 23 '20 09:05 doctorsax

@doctorsax A priori le programme ne fonctionne pas, ou pas bien, sur RPi 4. Cependant la compilation devrait réussir. Vérifiez que vous avez bien toutes les dépendances listées dans le README.

ChristopheJacquet avatar Jul 08 '20 16:07 ChristopheJacquet

@ChristopheJacquet Bonjour j'ai regarder mais toujours le même message d'erreur Pifmrds

doctorsax avatar Jul 09 '20 15:07 doctorsax

@doctorsax C'est pas une erreur, mais juste un avertissement. Tu peux l'ignorer, je pense.

makew0rld avatar Jul 09 '20 15:07 makew0rld

@makeworld-the-better-one Justement j'ai essayer mais le programme ne veut pas se lancer

doctorsax avatar Jul 09 '20 15:07 doctorsax