adafruit / FreqShow

Raspberry Pi & PiTFT-based RTL-SDR frequency scanning and display tool.
MIT License
144 stars 67 forks source link

IndexError: index out of bounds #4

Closed rjamesy closed 9 years ago

rjamesy commented 9 years ago

Hi,

I am running this software on a RP2, and also via a monitor. I removed the lines:

os.putenv('SDL_VIDEODRIVER', 'fbcon') os.putenv('SDL_FBDEV' , '/dev/fb1') os.putenv('SDL_MOUSEDRV' , 'TSLIB') os.putenv('SDL_MOUSEDEV' , '/dev/input/touchscreen')

and it loads the splash screen on the monitor then it crashes with the following error:

Detached kernel driver Found Rafael Micro R820T tuner Traceback (most recent call last): File "freqshow.py", line 103, in fscontroller.current().render(screen) File "/home/pi/FreqShow/views.py", line 364, in render self.render_spectrogram(screen.subsurface(spect_rect)) File "/home/pi/FreqShow/views.py", line 471, in render_spectrogram y = freqs[i] IndexError: index out of bounds

Any ideas ?

Thanks for your help in advance.

Richard

tdicola commented 9 years ago

Oh that's a side effect of how the spectrogram rendering works, it maps one bucket of radio FFT results to a pixel on the screen. If there are more pixels than there are samples, then it will fail with this error. You can fix this though by changing this config in freqshow.py:

SDR_SAMPLE_SIZE = 1024  # Number of samples to grab from the radio.  Should be
                        # larger than the maximum display width.

Bump it up from 1024 to a value that's larger than your screen width, like 2048.

MatejKovacic commented 8 years ago

This is working, however, when I try to run freqshow on VNC console, it doesn't work. Spectrogram is displayed on physical monitor instead of VNC console.

Any idea how to solve this?