Hyperion as UDP listener?

  • Hi,


    I am trying to get led data into hyperion (I'd like to visualize music with ledfx).


    Can Hyperion receive UDP data? I can't find a UDP port in the documentation so I think this is not supported but I wanted to ask here first before giving up.


    Thanks!

    • Official Post

    Dermac Currently Hyperion can receive data via Protobuf, Flatbuffer protocols and via JSON-API.
    As far as I get it, you can send Images, which will then be mapped to the LEDs.
    But I guess LedFx is already preparing the individual color to LED mappings for a device...

    As LedFx is Python, you might want to check, if you could reuse some code from here using the ProtoBuf protocol.

    • Official Post

    Hi

    I found it interesting to feed LedFx via UDP.
    Therefore I retrofitted the UPD Listener from Hyperion Classic to Hyperion NG.
    You can add it as a custom effect.


    Extract the zip file in the "custom-effects" folder (in a standard installation you find it in the user's home and .hyperion directory)

    Restart Hyperion

    Now you can add a new "UDP RGB Stream Listener" effect




    In Led-FX configure a corresponding FXMatrix device (the UDP device, I was not able to configure, LedFX had errors...)



    Now start a Effect in LedFx.

    Note: It is a Proof-of-concept and a development version.

  • I can't seem to load the effect into my Hyperion.


    When I restart Hyperion after copying the files, the log contains:


    Code
    2021-08-26T20:54:54.719Z [hyperiond EFFECTFILES] (ERROR) File does not exist: /.hyperion/custom-effectsschema//udpRGBListener.schema.json


    The problem seems to be the / after "schema". Where does the path come from? Couldn't find it in your files.

    • Official Post

    steveniclas Couple of questions:

    a) Could you share which version (it should be alpha10) and on which platform you are running?

    b) It would be beneficial, if you can share a complete Debug log after a restart (enable Debug log and then restart hyperion)
    Share the "Copy to Clipboard" output.

    c) What does the following create as an output

    ls -la ~/.hyperion/*

    If you are not running alpha10 then b and c are not required, but an update.
    Thank you!

  • Lord-Grey Thanks for your help!


    It took me some time, but after updating to alpha10 (I was using alpha9), I can successfully create effects with your schema.


    The HyperionVisualizer I mentioned doesn't really work though, as it updates the lights like once every 10 seconds. I'll try using LedFx next and keep this thread updated about how's it going.


    Pardon the question (I'm a web developer and all this is very new to me), but wouldn't it be easier to just take the audio signal from the stream that comes with HDMI/USB anyway?

    • Official Post

    wouldn't it be easier to just take the audio signal

    This would be the better option, but require someone to write a Audio-Grabber which would map to LEDs.

    Therefore the easiest option was to map the stream via an effect just to have the scenario running. This workaround of course comes with some downsides, as you cannot easily control the input or network stream in case of failures.

    Try LedFx. For me it worked instantaneously and you can have an update rate of 60Hz.

    (Which I do not think is required…)


    Btw. We are still looking for Web-Developer support…

  • So I installed LedFX and set up a new device.

    Type: FXMatrix

    IP Adress: 192.168.178.65:8090 (the one I use to open Hyperion.ng)

    Port: 21328 (the same port set inside your UDP_RGB_Stream-Effect)

    Width: 300
    Height: 1


    And set Audio Input to "Stereo Mix".


    The LEDs don't light up. Error log shows this:

    Code
    ledfx.core : Exception in core event loop: Exception in callback Device.clear_frame()
    Traceback (most recent call last):
    File "asyncio\events.py", line 80, in _run
    File "devices\__init__.py", line 130, in clear_frame
    File "C:\Program Files (x86)\LedFx\data\ledfx\devices\FXMatrix.py", line 40, in flush
    self._sock.sendto(bytes(udpData), (self._config['ip_address'], self._config['port']))
    socket.gaierror: [Errno 11001] getaddrinfo failed


    I don't have much time to spare tbh. What kind of web developer support are you looking for?

    • Official Post

    IP Adress: 192.168.178.65:8090 (the one I use to open Hyperion.ng)

    Give the pure IP Address or hostname of the device Hyperion is running on, i.e.

    IP Adress: 192.168.178.65

  • This brings me another step further. Now, when I pick an effect, like "Bar (reactive)", the LEDs light up red. But nothing else happens. They don't react to the sound.


    The "preview" inside of LedFx starts showing weird shapes now (not reacting to sound either, though). They keep flickering back and forth as shown in the attached screenshots 2-3 times per second:


    preview.png


    preview2.png

    • Official Post

    philblue1 You might want to explore, setting the rate in LED-FX


    Just adding a sleep will not reduce the incoming update traffic and the rpi still needs to process those records.
    It will just ensure that the updates will be queued.


    You could of course also reduce the output, but then I would suggest you check that a timeframe (corresponding to the given fps) has past since the last setColor.

    This would not avoid the load on the incoming processing, but avoids queueing plus limits the output.

  • @Lord-Grey thanks for the hint to explore the refresh rate, which made me interestingly confused and led me to a better solution. Still dirty though.


    besides that, i missed and mixed sth. The listener is eating up the CPU when started but not fed on both versions (LED-FX not connected),

    but only with my modified one the CPU usage goes down but with higher refresh rate from LED-FX.

    in data:

    LED-FX, CPU Load @RPi1

    refresh-rate, Listener, Listener_maxFPS100

    10, 100%, 90%,

    30, 100%, 80%,

    60, 100%, 70%,

    90, 100%, 55%,

    120, 100%, 55%,


    same song and effect of course.

    Not sure how this works in particular, but it does in sync and smooth (on refresh rate 60+).

    My guess is something around UDPSock.recvfrom(4500) is going wild especially while nothing is send to, but i am not that into python networking (and no time to get into) to know and for now i am okish with my solution till sbdy will fix this at the source.

  • Hi,

    is there a way to get this udp effect working on a Windows Hyperion 2.0.12 installation?
    I get the following error:

    Code
    2021-12-05T13:56:25.111Z [ EFFECTENGINE] (ERROR) ## ModuleNotFoundError: No module named '_socket'
    2021-12-05T13:56:25.124Z [ EFFECTENGINE] (ERROR) ## Traceback (most recent call last):
    2021-12-05T13:56:25.124Z [ EFFECTENGINE] (ERROR) ## File "<string>", line 2, in <module>
    2021-12-05T13:56:25.124Z [ EFFECTENGINE] (ERROR) ## File "socket.py", line 51, in <module>
    2021-12-05T13:56:25.124Z [ EFFECTENGINE] (ERROR) ## ModuleNotFoundError: No module named '_socket'
    2021-12-05T13:56:25.124Z [ EFFECTENGINE] (ERROR) ###### EXCEPTION END ######

    thx in advance

  • http://0.0.0.0:8888 ?


    regards pclin

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!