RanzQ / hyperion-audio-effects

Hyperion audio effects dev kit using Gstreamer
MIT License
47 stars 8 forks source link

IndexError: list index out of range #11

Open SiiXFX opened 9 years ago

SiiXFX commented 9 years ago

I'm using Raspbian with Hyperion and a WS2801 LED Strip. The LED's with Hyperion working fine, but with the audio effects i'm getting this error:

AL lib: alsa_open_capture: Could not open capture device 'default': No such file or directory

(python:2636): GStreamer-CRITICAL **: _gst_util_uint64_scale: assertion 'denom != 0' failed
Traceback (most recent call last):
  File "/home/pi/hyperion_music/hyperion-audio-effects-master/effects/spectrum_dump.py", line 308, in on_message
    self.callback(magnitudes)
  File "/home/pi/hyperion_music/hyperion-audio-effects-master/effects/vumeter.py", line 89, in receive_magnitudes
    self.update_leds()
  File "/home/pi/hyperion_music/hyperion-audio-effects-master/effects/vumeter.py", line 128, in update_leds
    left = self.mag_to_idx(self.magnitudes[0])
IndexError: list index out of range

Edit: Okay.. I get this error only with the vumeter effect. If I'm selecting the color_spectrum only this error appears:

AL lib: alsa_open_capture: Could not open capture device 'default': No such file or directory

And in the GUI I can only see the color spectrum but it's not changing when I play music. Also the color spectrum is not on the LED's.

RanzQ commented 9 years ago

There's some problem with your Gstreamer setup. First test gstreamer without python: gst-launch-1.0 audiotestsrc ! audioconvert ! autoaudiosink, if that works you should hear a beep. That IndexError is caused by the same problem.

Also this thread might have something Pi related: https://github.com/RanzQ/hyperion-audio-effects/issues/9

But you should be aware that this is too heavy to run on the Pi, at least the color spectrum is, the vu meter might be possible.

frostworx commented 8 years ago

any chance that error is caused by python3 where python2 should work/be used? thanks a lot for hyperion-audio-effects, @RanzQ! I recently switched to hyperion, found your project quickly and it works excellent here (~amd64 gentoo) :}

RanzQ commented 8 years ago

@frostworx I haven't used python3 (like ever) so not sure if some methods should be replaced for that. However, the error descbribed in this issue is due to some gstreamer / alsa / rpi config problem.

Resaltare commented 8 years ago

I agree this isn't a hyperion audio related issue. Had a similar issue when loopback wasn't set properly (modprobe snd-aloop not set on startup)

Resaltare commented 8 years ago

Actually, the IndexError: list index out of range error may be due to to hyperion audio not managing well asymetrical leds conf. For instance with different amounts of leds on left/right sides or with asymetrical corner leds conf. As vumeter.py for instance will arbitrarily set self.height to len(self.leds_left), if more leds are present on the left side, range error will occur on right side.