Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PiFmRds on Raspberry Pi 4 #134

Open
Salisito opened this issue Oct 4, 2019 · 42 comments
Open

PiFmRds on Raspberry Pi 4 #134

Salisito opened this issue Oct 4, 2019 · 42 comments
Labels

Comments

@Salisito
Copy link

Salisito commented Oct 4, 2019

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

@ChristopheJacquet
Copy link
Owner

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.

@Salisito
Copy link
Author

Salisito commented Oct 4, 2019

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

@markondej
Copy link
Contributor

markondej commented Oct 4, 2019

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.

@Salisito
Copy link
Author

Salisito commented Oct 4, 2019

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
Copy link
Author

Salisito commented Oct 4, 2019

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
Copy link
Author

Salisito commented Oct 4, 2019

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

@markondej
Copy link
Contributor

markondej commented Oct 6, 2019

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.

@Salisito
Copy link
Author

Salisito commented Oct 6, 2019

Okey, I hope you can fix it!!

Thaanks

@Salisito
Copy link
Author

@markondej have you been able to solve the problem?

@markondej
Copy link
Contributor

markondej commented Oct 13, 2019

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...

@Salisito
Copy link
Author

It doesn't work for me...

@captroy
Copy link

captroy commented Nov 1, 2019

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.

@GithubKillsMyOpsec
Copy link

I seem to be having the same issue =/

@waterwin
Copy link

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

@henry-shadowjet
Copy link

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!

@JokrCode
Copy link

JokrCode commented Feb 4, 2020

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.

@henry-shadowjet
Copy link

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.

@JokrCode
Copy link

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

@henry-shadowjet
Copy link

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

@markondej
Copy link
Contributor

markondej commented Mar 21, 2020

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

@Salisito
Copy link
Author

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

@Salisito
Copy link
Author

There's like a distorsion

@goutx2
Copy link

goutx2 commented Apr 21, 2020

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

@Budgiebrain994
Copy link

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.

@makew0rld
Copy link

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

@doctorsax
Copy link

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 ?

@ChristopheJacquet ChristopheJacquet mentioned this issue Jul 8, 2020
@ChristopheJacquet
Copy link
Owner

@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.

@doctorsax
Copy link

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

@makew0rld
Copy link

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

@doctorsax
Copy link

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

@makew0rld
Copy link

Quel est le résultat quand tu exécutes ./pi_fm_rds? Je ne suis pas le developer, mais je sais que c'est cette résultat que Christophe a besoin.

@comicsansgreenki
Copy link

Weird. I'm running the compiled binary just fine on my Raspberry Pi 400.

@captroy
Copy link

captroy commented Sep 20, 2021

Hey all, I think I have a fix for this issue. I've successfully transmitted RDS on my pi 4, and put a pull request for the code change. Fingers crossed this works for group!

I should mention, this is thanks to @1anakin20 for his fix on the pi-rc project. @ @

@comicsansgreenki
Copy link

Hey all, I think I have a fix for this issue. I've successfully transmitted RDS on my pi 4, and put a pull request for the code change. Fingers crossed this works for group!

I should mention, this is thanks to @1anakin20 for his fix on the pi-rc project. @ @

Ooooo. Can't wait to test once I get back home.

@jurosic
Copy link

jurosic commented Oct 29, 2021

still cant get this to work on my rpi4 running raspbian lite, i have an antenna and i am standing next to mi radio but only white noise, there is a difference when i start/stop the broadcast, but no actual audio plays

@StefCoders
Copy link

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

@comicsansgreenki
Copy link

@StefCoders ooh nice! did this let you use a display output with the pi4 simultaneously?

@StefCoders
Copy link

StefCoders commented Aug 22, 2023

Nope, headless pi and ssh..

@Salisito
Copy link
Author

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

@StefCoders what else did you do to make work PiFmRds? Which repository did you use? Thanks in advance

@StefCoders
Copy link

I just used this one. Nothing else.

@crisdash96
Copy link

this Soultion witch not working pifmrds fm transmitter

Put the cable in pin Numbers 6

@Salisito
Copy link
Author

Hi all,
It's been a long time since this issue was reported. Has someone achieved to make work PiFmRds in a RPI4?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests