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

LedFx lagging with WLED #173

Closed
1 task done
NessLange opened this issue Feb 19, 2022 · 18 comments
Closed
1 task done

LedFx lagging with WLED #173

NessLange opened this issue Feb 19, 2022 · 18 comments
Labels
bug Something isn't working stale Items without activity in the last 30 days triage Needs review + triage

Comments

@NessLange
Copy link

What happened?

I have now installed LedFx and I can run the web interface successfully (since you told me how to clear trashed configs). Next problem that has arose:

Lights are eventually bugged only reacting with a huge delay.

For the the first couple of seconds it responds pretty smoothly but after some time the movement becomes really jagged.

It strikes me as LedFx has some connectivity issues because other synchronizations like Prismatik or Hyperion are stable over a long period. Effects send from WLED are passed through immediately anyhow.

In order to fix the issue I tried adding the Esp-device with UDP instead of e131, but by doing so lights are just turned off no matter what effect I choose. Also I experimented with different wifi spots, but no recover there.

I've got no error message that I can present to you guys so yeah.

Install Method

Install via pip

What version of LedFx?

0.10.7

What browsers are you seeing the problem on?

Safari

Relevant log/trace output

No response

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@NessLange NessLange added bug Something isn't working triage Needs review + triage labels Feb 19, 2022
@NatasFX
Copy link

NatasFX commented Feb 20, 2022

did you tried to change "Refresh Rate" on wled device config?

image
Lowering this number might help.

also, what type of led and how much of them are you controlling?

@NessLange
Copy link
Author

Thanks for the advice. I tinkered with all these settings for a bunch of time, but nothing really helped. Only thing I noticed was after hitting submit, the reaction was at it best for a very few seconds, but sooner or later the effects were displayed with a huge lag/ delay. Such a pity because the short moments it worked fluently it was damn impressive to watch. In general I think LedFx really is prone to errors, since changing one setting oftentimes fails the light to light up at all, so I got to restart the whole thing again. Even then sometimes it wouldn't start, so I had to clear the config. For example here are some messages that I received, only for changing some things on the web device:

Loading configuration file from /Users/niklaskurz/.ledfx Loading default presets from /usr/local/lib/python3.9/site-packages/ledfx Started webinterface at http://0.0.0.0:8888

Then it operated quietly until after changing some stuff...

[ERROR ] aiohttp.server : Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request resp = await self._request_handler(request) File "/usr/local/lib/python3.9/site-packages/sentry_sdk/integrations/aiohttp.py", line 123, in sentry_app_handle reraise(*_capture_exception(hub)) File "/usr/local/lib/python3.9/site-packages/sentry_sdk/_compat.py", line 54, in reraise raise value File "/usr/local/lib/python3.9/site-packages/sentry_sdk/integrations/aiohttp.py", line 113, in sentry_app_handle response = await old_handle(self, request) File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle resp = await handler(request) File "/usr/local/lib/python3.9/site-packages/ledfx/api/__init__.py", line 26, in handler return await method( File "/usr/local/lib/python3.9/site-packages/ledfx/api/device.py", line 49, in put device = self._ledfx.devices.create( File "/usr/local/lib/python3.9/site-packages/ledfx/utils.py", line 559, in create _config = _cls.schema()(_config) File "/usr/local/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 272, in __call__ return self._compiled([], data) File "/usr/local/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict return base_validate(path, iteritems(data), out) File "/usr/local/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping raise er.MultipleInvalid(errors) voluptuous.error.MultipleInvalid: value must be at most 200 for dictionary value @ data['e131_Packet_Priority'] [ERROR ] aiohttp.server : Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request resp = await self._request_handler(request) File "/usr/local/lib/python3.9/site-packages/sentry_sdk/integrations/aiohttp.py", line 125, in sentry_app_handle transaction.set_http_status(response.status) AttributeError: 'NoneType' object has no attribute 'status'

I really have no clue what's going on there I only can guess maybe a clash between WLED and LedFx. Or totally differently the uploading format (e131) simply is not appropriate because with Prismatik and UDP I get about 25 fps consistently. By the way for answering your primarily question: I'm occupying 149 LED's of a 567 pixel long WS2812b strip.

@NatasFX
Copy link

NatasFX commented Feb 22, 2022

The error you pointed happens some times to me, but i can just ignore it because i doesn't stops working after that.

In WLED configuration, do you have set 567 leds to control?

@NessLange
Copy link
Author

Quite frightening to face these errors though. I have set pixel count to 149 same as in WLED settings, albeit more LED's are connected to the strip. I feel like the problem is independent of the count since for lowered pixels the delay happens as well. Maybe it's the way I installed LedFx or WLED?

@NatasFX
Copy link

NatasFX commented Feb 23, 2022

Did you check cpu usage on ledfx? How much cores your cpu have?

@NessLange
Copy link
Author

I'm equipped with Quad-Core Intel Core i5. Using LedFx around 45% of the Cpu are used and 20% for python beneath. However in the activity monitor it shows about 85% of the whole system are inactive. I dare say the performance of my PC is sufficient, for other applications it's just enough. I insist on some odd connectivity issues. I could try running other sound-reactive projects (like the one of Scott) and see if that works.

@NessLange
Copy link
Author

NessLange commented Feb 23, 2022

So I checked the project of Scott (it's quite a different setup but fairly comparable) and it worked quite smoothly. Only the scroll effects was lagging a little but not as worse as in LedFx. I inspected the messages sent in the console again and found something strange in my eye:

[INFO] ledfx.effects : Effect Scroll config updated to {'background_color': 'black', 'mirror': True, 'color_lows': 'red', 'color_mids': 'green', 'color_high': 'blue', 'decay': 0.97, 'brightness': 1.0, 'flip': False, 'threshold': 0.0, 'blur': 3.0, 'speed': 5}. [INFO] ledfx.effects.audio : Activating AudioReactiveEffect. [INFO] ledfx.effects : Effect Scroll activated. [INFO] ledfx.effects.audio : Audio Input Devices: [INFO] ledfx.effects.audio : [0] MacBook Pro Mikrofon [INFO] ledfx.effects.audio : Found audio device under index: 0 [INFO] ledfx.effects.audio : [2] ZoomAudioDevice [INFO] ledfx.effects.audio : Audio source opened. [INFO] ledfx.utils : W is WLED compatible: WLED [INFO] ledfx.utils : W powered on: False [INFO] ledfx.utils : Turning WLED device W on. [INFO] ledfx.devices.e131 : sACN activating universe 1 [INFO] ledfx.devices.e131 : sACN sender started. [INFO] ledfx.config : Saving configuration file to /Users/niklaskurz/.ledfx [INFO] ledfx.api.websocket : Websocket connected. [INFO] ledfx.api.websocket : Starting sender [INFO] ledfx.api.websocket : Websocket subscribing to event device_update with filter {'device_id': 'w'} [INFO] ledfx.api.websocket : Connection closed by client. [INFO] ledfx.api.websocket : Stopping sender [INFO] ledfx.api.websocket : Closed connection

Is it normal the connected is closed when I'm about to activate an effect?

@NatasFX
Copy link

NatasFX commented Feb 23, 2022

I'm equipped with Quad-Core Intel Core i5. Using LedFx around 45% of the Cpu are used and 20% for python beneath. However in the activity monitor it shows about 85% of the whole system are inactive. I dare say the performance of my PC is sufficient, for other applications it's just enough. I insist on some odd connectivity issues. I could try running other sound-reactive projects (like the one of Scott) and see if that works.

Well, python is mostly single-threaded, i dont know the code underneath ledfx deals with this, but FFT is quite a computational hungry task. You could use cpulimit to let only one core assigned for ledfx, watch if this core reaches 100% usage and if your problem still occurs and both of these are true, chances are your cpu can't handle this task. If that's the case you're lucky, there is a rewrite of ledfx going on that is faster.

About the log you pasted, well, i dont know haha, seems to me that wled is aborting the connection, which is quite weird. you could check if there's any other ledfx instance running. do you have any weirdness controlling wled by your phone?

@NessLange
Copy link
Author

NessLange commented Feb 24, 2022

Yea, I know some computations can grill the entire PC, but I'm sure mine is cool enough (at least I can trace the FFT graph on LedFx in realtime) I rather believe it is indeed an interrupted connection to WLED for whatever reason. WLED itself and other applications accessing on it are running with ease. I guess I'll wait until these programming GOATS will program even better programs that are even easier to use. Thank you for your help

@ViFi-connected
Copy link

Try updating WLED. I had the same issue, but it seems that the WLED team recently made some changes which fixed it.

@NessLange
Copy link
Author

Thank you for the information. I've installed newest WLED on my esp8266 (ver. 0.13.0-b7) via Web-installer however I am facing the same issues. What's your version and installation method?

@ViFi-connected
Copy link

I am using esp32 and compile the software myself. I have no idea which change resolved the issue for me, but they just released new version today (v0.13.1 "Toki").

@stale
Copy link

stale bot commented Apr 15, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Items without activity in the last 30 days label Apr 15, 2022
@tulayha
Copy link

tulayha commented Apr 23, 2022

Having a similar lag issue with latest updates too running ledfx and wled currently

@stale stale bot removed the stale Items without activity in the last 30 days label Apr 23, 2022
@stale
Copy link

stale bot commented May 30, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Items without activity in the last 30 days label May 30, 2022
@not-matt
Copy link
Member

Working on a new version of LedFx which addresses the performance issues. Slow work to rewrite it from the ground up in a new language, but stay tuned :)

@Jtupz
Copy link

Jtupz commented Sep 4, 2023

Hi, I am facing the same issues here....any word on an update?

@espilioto
Copy link

I know that what I'm about to describe is not related to this issue, but I'll just drop it here since unfortunately it was the most relevant google result to my problem.

LedFx seemed to lag a few ms when reacting to most music/sounds, but not by the same amount every time.
Imagine first feeling the bass then seeing the effect fully "being there" (depending on the effect of course).
I tried v1, v2 beta, installer, portable, tested with both esp8266 and esp32; yet nothing changed.
The device debug showed at most 20-30ms ping so my router being a piece of garbage was ruled out.

The fix was to clamp the frequencies to something like 30Hz to 8kHz.
Since most consumer speakers won't reach that low/high you won't be able to hear what your leds are reacting to and will probably feel that something is off.
Those numbers worked for me, but they mostly depend on the gear you got and probably your (lack of) room calibration.
I'm sure it will be awesome when set per device, but unfortunately can't test it yet.

That's all, really love the project guys, appreciate ya! <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale Items without activity in the last 30 days triage Needs review + triage
Projects
None yet
Development

No branches or pull requests

7 participants