ahodges9 / LedFx

LedFx is a network based LED effect controller with support for advanced real-time audio effects! LedFx can control multiple devices and works great with cheap ESP8266 nodes allowing for cost effectvice syncronized effects across your entire house!
MIT License
385 stars 91 forks source link

How do you set up audio? #43

Closed omorio closed 4 years ago

omorio commented 5 years ago

I am running "scottlawsonbc audio-reactive-led-strip" firmware on a NodeMCU esp8266 board and I followed the installation guide. I can get nonreactive effects like "Gradient" to work seamlessly. But whenever I select a reactive effect like "Energy", nothing happens. I'm on a mac, maybe that's the problem? I'm totally new to all of this so sorry for the (maybe) stupid question, but how do I get audio input to work? I'm sure I should provide more info, but I don't know what to provide so just tell me what and I'll provide it.

spattinson commented 4 years ago

Same issue here on Linux. I can see ledfx is recording audio in pavucontrol (volume controller). I run with -vv option and i can see that the packets are sent to the strip, no light show. There are some config items in audio.py. I had to change the device index to 4 to pick up the correct input. Tried changing the min volume. I am using ESP32 with https://github.com/Aircoookie/WLED, I have also use scottlawsonbc audio-reactive-led-strip, similar result. Scott LAwsons audio visualizer (https://github.com/scottlawsonbc/audio-reactive-led-strip/blob/master/python/visualization.py) works fine.

spattinson commented 4 years ago

Some update on my situation, yours maybe different though. I can see in the audio mixer/volume control that "ALSA plugin python3.6" is recording audio and the level bar is moving around the half way mark indicating that LedFx is receiving audio. I can see in wireshark that the UDP packets are looking like the strip is being sent all zeros when an audio reactive effect is used:

0000   30 ae a4 c1 8d 64 78 24 af b3 69 eb 08 00 45 00
0010   01 0c cc ce 40 00 40 11 e8 5b c0 a8 01 ad c0 a8
0020   01 b9 a9 f9 1e 61 00 f8 c6 e5 00 00 00 00 01 00
0030   00 00 02 00 00 00 03 00 00 00 04 00 00 00 05 00
0040   00 00 06 00 00 00 07 00 00 00 08 00 00 00 09 00
0050   00 00 0a 00 00 00 0b 00 00 00 0c 00 00 00 0d 00
0060   00 00 0e 00 00 00 0f 00 00 00 10 00 00 00 11 00
0070   00 00 12 00 00 00 13 00 00 00 14 00 00 00 15 00
0080   00 00 16 00 00 00 17 00 00 00 18 00 00 00 19 00
0090   00 00 1a 00 00 00 1b 00 00 00 1c 00 00 00 1d 00
00a0   00 00 1e 00 00 00 1f 00 00 00 20 00 00 00 21 00
00b0   00 00 22 00 00 00 23 00 00 00 24 00 00 00 25 00
00c0   00 00 26 00 00 00 27 00 00 00 28 00 00 00 29 00
00d0   00 00 2a 00 00 00 2b 00 00 00 2c 00 00 00 2d 00
00e0   00 00 2e 00 00 00 2f 00 00 00 30 00 00 00 31 00
00f0   00 00 32 00 00 00 33 00 00 00 34 00 00 00 35 00
0100   00 00 36 00 00 00 37 00 00 00 38 00 00 00 39 00
0110   00 00 3a 00 00 00 3b 00 00 00
spattinson commented 4 years ago

https://github.com/ahodges9/LedFx/issues/40 fixes it add one line to effects.py