User avatar
PeterO
Posts: 5884
Joined: Sun Jul 22, 2012 4:14 pm

GL ES with FFT: Any Problems ? Works on PI2

Thu May 01, 2014 7:06 pm

Before I go any further with a project I though I would ask if anyone has had any problems using openGLES and the GPU FFT functions in the same application ?

PeterO
Last edited by PeterO on Sat Feb 07, 2015 4:23 pm, edited 3 times in total.
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
PeterO
Posts: 5884
Joined: Sun Jul 22, 2012 4:14 pm

Re: GL ES with FFT: Any Problems ?

Sat May 03, 2014 9:54 pm

I guess no one else has tried this because first indications are that it is totally broken :-(

Running hello_fft while an openGLES application is running stops the openGLES application dead, and it won't run again until the PI is rebooted.
And until the reboot the fft won't work again either ! This is really very disappointing :(

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
PeterO
Posts: 5884
Joined: Sun Jul 22, 2012 4:14 pm

Re: GL ES with FFT: Any Problems ?

Sun May 04, 2014 7:33 pm

I'm getting help from Andrew Holme (author of the gpu_fft code) and things are looking promising :-)

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
PeterO
Posts: 5884
Joined: Sun Jul 22, 2012 4:14 pm

Re: GL ES with FFT: Any Problems ?

Sat May 10, 2014 2:32 pm

Just a quick update... Thanks to Andrew and dom this is now working :-) I believe some uber-gpu-foo was used to fix the problems :-)

Now I can get on with my code :-)

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
hanzelpeter
Posts: 74
Joined: Mon Jul 09, 2012 11:56 am

Re: GL ES with FFT: Any Problems ?

Sun May 11, 2014 12:30 pm

Can you write where was the problem?

User avatar
PeterO
Posts: 5884
Joined: Sun Jul 22, 2012 4:14 pm

Re: GL ES with FFT: Any Problems ?

Sun May 11, 2014 1:25 pm

hanzelpeter wrote:Can you write where was the problem?
Sorry I don't know what the problems were other then it was something to do with the mailbox code in the firmware and the cache configuration for the fft.

Image

That is a 1024 point FFT being computed and displayed 20 times a second. Input data is currently comming from a 96kHz wav file until I get the alsa sound recording code developed.
Next task is a waterfall display in the bottom half of the screen.

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
PeterO
Posts: 5884
Joined: Sun Jul 22, 2012 4:14 pm

Re: GL ES with FFT: Any Problems ?

Sun May 11, 2014 5:25 pm

And now with a waterfall dispaly as well :-)

http://www.peteronion.org.uk/PiPics/pipan1.mpeg
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
AndyD
Posts: 2334
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: GL ES with FFT: Any Problems ?

Sun May 11, 2014 9:31 pm

PeterO wrote:And now with a waterfall dispaly as well :-)

http://www.peteronion.org.uk/PiPics/pipan1.mpeg
That's cool!

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5537
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: GL ES with FFT: Any Problems ?

Mon May 12, 2014 11:09 pm

PeterO wrote:Just a quick update... Thanks to Andrew and dom this is now working :-) I believe some uber-gpu-foo was used to fix the problems :-)
The uber-gpu-foo should now be in rpi-update firmware.

User avatar
PeterO
Posts: 5884
Joined: Sun Jul 22, 2012 4:14 pm

Re: GL ES with FFT: Any Problems ?

Tue May 13, 2014 2:31 pm

My plan was to drive this display from a 96kHz I2S audio ADC, but now that I've looked at I2S suport I see the state of the I2S drivers is so poor that the whole thing is now looking unworkable.

Why people think it is acceptable to produce I2S hardware for which users have to build custom kernels is beyond me. I though those days were long past :-(

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
PeterO
Posts: 5884
Joined: Sun Jul 22, 2012 4:14 pm

Re: GL ES with FFT: Any Problems ?

Wed May 14, 2014 9:01 am

Actually, having run rpi-update last evening I can now successfully capture 96kHz audio from my USB soundcard so there is no need to mess about with the broken I2S sub-sysytem.
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
PeterO
Posts: 5884
Joined: Sun Jul 22, 2012 4:14 pm

Re: GL ES with FFT: Any Problems ?

Wed May 14, 2014 10:33 pm

http://www.peteronion.org.uk/PiPics/pipan2.mpeg

Real time display using 96kHz sampling from a USB soundcard... And not even overclocked !

PeterO
G0DZB
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5537
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: GL ES with FFT: Any Problems ?

Wed May 14, 2014 11:05 pm

PeterO wrote:Real time display using 96kHz sampling from a USB soundcard... And not even overclocked !
I like it!
Years ago I remember eavesdropping pager messages with this sort of equipment. I wonder if people even use pagers now...

KenT
Posts: 758
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
Contact: Website

Re: GL ES with FFT: Any Problems ?

Thu May 15, 2014 6:43 am

I wondered if you have a callsign, now I think I know what FFT and waterfalls are for. Hopefully psk and RTTY will be supported. :-)

Ken
M0GBP
PeterO wrote:http://www.peteronion.org.uk/PiPics/pipan2.mpeg

Real time display using 96kHz sampling from a USB soundcard... And not even overclocked !

PeterO
G0DZB
Pi Presents - A toolkit to produce multi-media interactive display applications for museums, visitor centres, and more
Download from http://pipresents.wordpress.com

KenT
Posts: 758
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
Contact: Website

Re: GL ES with FFT: Any Problems ?

Thu May 15, 2014 6:48 am

dom wrote:
PeterO wrote:Real time display using 96kHz sampling from a USB soundcard... And not even overclocked !
I like it!
Years ago I remember eavesdropping pager messages with this sort of equipment. I wonder if people even use pagers now...
Twitchers do, pagers have better coverage than mobile phones. That, the internet, and digital photography have changed the face of twitching in the last few years.
Pi Presents - A toolkit to produce multi-media interactive display applications for museums, visitor centres, and more
Download from http://pipresents.wordpress.com

User avatar
PeterO
Posts: 5884
Joined: Sun Jul 22, 2012 4:14 pm

Re: GL ES with FFT: Any Problems ?

Thu May 15, 2014 8:45 am

KenT wrote:I wondered if you have a callsign, now I think I know what FFT and waterfalls are for. Hopefully psk and RTTY will be supported. :-)
Ken
M0GBP
Ken,

I've got no plans at the monent to do anything other than a panadapter. It still needs to have a graticule and axis labels, then USB interface to radio to read the center frequency, then mouse control for manual scaling etc.

TBH for narrow band data mode decoding I think it is better (and easier) to use the demodulated and filtered audio from the radio than to start from raw broadband I/Q signals.

PeterO
G0DZB
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
PeterO
Posts: 5884
Joined: Sun Jul 22, 2012 4:14 pm

Re: GL ES with FFT: Any Problems ? (not any more!)

Fri May 16, 2014 9:01 am

Graticule added to graph, and improved spectum calculation that uses all of the available I/Q samples rather than throwing 3/4 of them away. Result is better S/N due to some averaging over 4 transforms. Still some work to do in that area including trying overlapping transforms.

Next is some axis labels.

http://www.peteronion.org.uk/PiPics/PiPan2.png

PeterO
G0DZB
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
PeterO
Posts: 5884
Joined: Sun Jul 22, 2012 4:14 pm

Re: GL ES with FFT: Any Problems ? (not any more!)

Tue May 20, 2014 10:22 pm

utube of latest version http://youtu.be/0IZxzm4R1bo
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
PeterO
Posts: 5884
Joined: Sun Jul 22, 2012 4:14 pm

Re: GL ES with FFT: Any Problems ? (not any more!)

Mon Jun 02, 2014 8:57 am

Yesterday I decided the time had come for a major "code refactoring" to more cleanly separate the alsa,rig control,fft,and opeGLES into theor own source files. I also started to review the code, clean out dead "experimental" code and improve comments. All working towards the first release of the source code.

Then I spent some time on IM with the Fun Cube Dongle developer trying to get that to work reliably on the RPI. It's pretty close to working but it seems 192kHz sampling pushes the USB system just over the edge of it's capabilities. But we've not given up hope yet.

Latest version has rig control via hamlib libraries and mouse contol of a set of cross hairs. Clicking the left mouse button retunes the radio to put the signals under the cross-hairs into the reciever passband.

PeterO
G0DZB
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

ovadaflame
Posts: 42
Joined: Fri Feb 14, 2014 7:21 pm

Re: GL ES with FFT: Any Problems ?

Thu Jun 26, 2014 2:26 pm

PeterO wrote:
Image

That is a 1024 point FFT being computed and displayed 20 times a second. Input data is currently comming from a 96kHz wav file until I get the alsa sound recording code developed.
Next task is a waterfall display in the bottom half of the screen.

PeterO
Was this display produced w/ OpenGL?

User avatar
PeterO
Posts: 5884
Joined: Sun Jul 22, 2012 4:14 pm

Re: GL ES with FFT: Any Problems ? (not any more!)

Thu Jun 26, 2014 3:40 pm

Yes, all the graphics are produced using openGL ES
http://www.youtube.com/watch?v=0IZxzm4R1bo
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
deltalimablahblah²
Posts: 33
Joined: Sat Dec 22, 2012 5:33 pm

Re: GL ES with FFT: Any Problems ? (not any more!)

Wed Sep 03, 2014 7:47 am

Hi Peter.

Since I had a first Pi (about 2012?!) I'm waiting for a pan adapter like this. I tried to build Pappsdr on Raspian. Since now w/o any success. Ether software starts with FFT, but no sound. Or sound works, but no FFT ???.

Pappradio (a low budged SDR frontend) has I/Q out for soundcards. So I'm very interested in your pan adapter soft. Where can I get the code? Is it free/os code? My goal: to use FFT as pan adapter and write my own "cat software" to control the Pappradio.
Next Problem: sound. But is another page of the book ;).

Glad to hear (read) from you.

User avatar
PeterO
Posts: 5884
Joined: Sun Jul 22, 2012 4:14 pm

Re: GL ES with FFT: Any Problems ? (not any more!)

Sun Sep 07, 2014 4:06 pm

I've not been doing much with this for a couple of months.... But to day I made a change to the top part of the display....
http://youtu.be/TnDgFKHmjHc
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
PeterO
Posts: 5884
Joined: Sun Jul 22, 2012 4:14 pm

Re: GL ES with FFT: Any Problems ? (not any more!)

Thu Sep 11, 2014 8:50 pm

Added some filtering to the recovered signal, now looks a lot cleaner and should be easier to decode!

Image

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
deltalimablahblah²
Posts: 33
Joined: Sat Dec 22, 2012 5:33 pm

Where to get the source?

Fri Oct 10, 2014 10:11 am

Hi Peter. This looks very promising for a SWL (and for other man with hf receivers). Question again: where can we get the code? Are you willing to share it? Is it GPL'ed open source?

73 de Marco

Return to “OpenGLES”