hyperion-project / hyperion.ng

The successor to Hyperion aka Hyperion Next Generation
https://hyperion-project.org/
MIT License
3.06k stars 377 forks source link

Raspberry Pi 4 with Libreelec v19 / Kodi Matrix, no grabber is working #983

Open DaPeace opened 4 years ago

DaPeace commented 4 years ago

I am using the latest Testbuild from Milhouse from here https://forum.kodi.tv/showthread.php?tid=343068 I cant get the framebuffer-grabber nor anything else to work. I installed the alpha7 where the webif is not working and then i moved backwards in the releases till the webif was working. I ended up with alpha4. When i start hyperion_dispmanx i get the following error:

[hyperion-dispmanx DISPMANXGRABBER] <INFO> Display opened with resolution: 4x1053483292 [hyperion-dispmanx FLATBUFCONNECTION] <INFO> Connecting to Hyperion: 127.0.0.1:19400 [hyperion-dispmanx DISPMANXGRABBER] <ERROR> Snapshot failed: -1

I found some conversations here how to solve that but that did not help. I tried the fb-grabber too but there i get the right resolution but only a black picture on fb0.

Is there any solution on RPI4 to get the grabber running? I need hyperion to bypass the led-data via udp to a wled-esp8266.

Regards, DaPeace

SJoWie80 commented 2 years ago

@Paulchen-Panther thank you for your work, this has finally enabled me to use homemade ambient lightning on libreelec and RPI 4, like it was working before on my old RPI 2 on OSMC.

how did you install it? i don`t understand

markop159 commented 2 years ago

@SJoWie80 I built it myself. Here is the link of my built: https://filetransfer.io/data-package/TIJYXNLd#link I tried it on LibreElec and it is working fine for me but be advised that this is work in progress and it might not work for everyone.

emc02 commented 2 years ago

https://filetransfer.io/data-package/TIJYXNLd#link

Thanks for that, but howto install this on libreelec?

SJoWie80 commented 2 years ago

installed and working works great with one problem. if i restart libreelec. libreelec`s boot screen stays on/hanging (black screen with libreelec logo) kodi self starts but without the user interface. i need to deactivate the screen capture then restart in orde to pass the boot screen and then when everything is running i can reactivate screen capture.

morokomole commented 2 years ago

@SJoWie80 I added a delay to the hyperion.service to workaround this issue, seems if DRM grabber is active in hyperion settings during boot libreelec will as you said hang on the logo although the system is started

You can add this line ExecStartPre=/bin/sleep 30 if you want to try it , for me 30 seconds seems to work just fine

LibreELEC:~ # cat /storage/.config/system.d/hyperion.service
[Unit]
Description=Hyperion ambient light systemd service
After=network.target

[Service]
ExecStartPre=/bin/sleep 30
Environment=DISPLAY=:0.0
ExecStart=/storage/hyperion/bin/hyperiond --userdata /storage/hyperion/
TimeoutStopSec=2
Restart=always
RestartSec=10

[Install]
WantedBy=default.target
royka1 commented 2 years ago

@markop159 Would you please upload it elsewhere? It now requires a subscription of 9,- a month.

daniesteban commented 2 years ago

Is there a prevision to have a new version (nightly or stable) with this fix? I tried the version compiled by @markop159 but it fail starting in my osmc, maybe I did something wrong because I just replace the /usr/share folder. I could test it but I'm afraid I don't have the knowledge to compile it myself.

cyberius0 commented 2 years ago

markop159

Hi! Can you please re-upload this file to another file hoster, as this one is not free anymore. You could e.g. use https://filehorst.de/

Does your solution work with 4K or only 1080p?

rjousse18 commented 2 years ago

markop159

Hi! Can you please re-upload this file to another file hoster, as this one is not free anymore. You could e.g. use https://filehorst.de/

Does your solution work with 4K or only 1080p?

it seems it works only for 1080p for now

emmtte commented 2 years ago

Hi, interesting but not possible to test because impossible to download this : https://filetransfer.io/data-package/TIJYXNLd#link

daniesteban commented 2 years ago

@royka1 @cyberius0 @emmtte Luckily I still have it. I re-upload to another sharing platform, apparently with no expiration:

If someone manage to make it work in last OSMC I would really appreciate any guideline.

royka1 commented 2 years ago

@royka1 @cyberius0 @emmtte Luckily I still have it. I re-upload to another sharing platform, apparently with no expiration:

If someone manage to make it work in last OSMC I would really appreciate any guideline.

Thank you! Unfortunately I don't have OSMC, in the newest LibreELEC RR it does work however. I like the idea of OSMC but it's a small team that has a higher priority for their own Vero boxes. That's why I chose LibreELEC, for applications that needs to be installed I use docker. In Libreelec RR is also a working moonlight-qt which I use a lot.

Edit: When installed as service Kodi won't start, then I first need to stop hyperion, (systemctl stop hyperion, killall -9 kodi.bin) then it starts and after that I could run hyperion again. So I should workaround this with binding a key to start/stop hyperion

daniesteban commented 2 years ago

Thank you! Unfortunately I don't have OSMC, in the newest LibreELEC RR it does work however.

Thanks for the information. I used to use LibreELEC, a great OS, but I switched to OSMC some time ago because is more flexible, due to apt repositories, since is based on Debian. Nowadays I'm not using so complex things so I probably give it a chance again, because Hyperion working is quite important for me.

emmtte commented 2 years ago

Hi, I found with this DRM screen capture, hyperion use a lot of processor about 50%. When I deactivate DRM processor is 1%. How to deacativate capture when not in use or is it possible tell hyperion activate or deactive screen capture when kodi in sleep mode

BernhardSigl commented 2 years ago

i think the new download link is down, too.

psychofaktory commented 2 years ago

Here's another link to the version markop159 created: https://filehorst.de/d/ecshsbwG

tpmodding commented 2 years ago

https://hyperion-project.org/downloads/Hyperion-2.0.13-beta.1-Linux-armv7l.tar.gz here is a backup

emc02 commented 2 years ago

https://hyperion-project.org/downloads/Hyperion-2.0.13-beta.1-Linux-armv7l.tar.gz here is a backup

Can confirm that this works well on Pi4 with LE 10.0.2 Modification of /storage/.config/system.d/hyperion.service with [Service] ExecStartPre=/bin/sleep 30

was needed in order to prevent hang on boot.

Thanks for your help!

emc02 commented 2 years ago

After some more testing, I found that hyperion while watching netflix, prime or disney is not working. All LEDs are black and live video too. The DRM grabber disappears after some minutes of watching netflix from the menu in the hyperion web-interface. Stopping the playback and restarting hyperion service brings the DRM grabber back up. Other streams like youtube work well.

alexd321 commented 2 years ago

Same issue, not working with Netflix for me, as well as live TV via a Pi TV HAT (TV headend), totally black capture. Works for the menu when I stop playback.

Works for YouTube.

royka1 commented 2 years ago

Did you set the capturing hardware at DRM? TV does work correctly here with a usb dvb-c stick and tvheadend on libreelec 11

alexd321 commented 2 years ago

Yes DRM. I notice there is an update for LE, I will try installing that

emc02 commented 2 years ago

Did you set the capturing hardware at DRM? TV does work correctly here with a usb dvb-c stick and tvheadend on libreelec 11

Yes, capturing hardware is DRM, hyperionng works well in Menu and youtube videos, but not with netflix etc..

royka1 commented 2 years ago

Just checked, with Amazon it doesn't work here either, but with live TV (dvb-c stick) it does. Probably due to the protection. If you've got a LG tv with WebOS you could try to root it, they've build a grabber for that, I've read that that will work with Netflix etc. They've got a Discord

alexd321 commented 2 years ago

I can confirm that, after updating to LE 10.0.2, hyperion is working on a Pi Tv HAT via tvheadend, and it is working with BBC iPlayer and LE menus. Nothing during Netflix (black)

Thomasqqq commented 2 years ago

Also testet the beta and it is working on RPI 4, LE 10.0.2 with the internal grabber. A quick question, is it correct that the forwarder don't work? My RPI is not close to the tv, so I have an extra device, with Hyperion (libreelec version) installed.

I tried using the test function on my rpi4 with the beta version, and it working perfect with the forwarder but when play a movie, it do not show up on my sec. Device. On my sec. Device i dont have this beta installed. Maybe that is the issues?

emc02 commented 2 years ago

any news here?

MathijsG commented 2 years ago

I have the same issue with a Raspberry Pi 3 with local non-DRM video's as well.

When I do a screen grab from the Hyperion webinterface I only get this:

image

No further interface of Kodi shows up.

On LibreElec 9.X it was all fine and dandy.

Morphy99 commented 2 years ago

I can confirm that, after updating to LE 10.0.2, hyperion is working on a Pi Tv HAT via tvheadend, and it is working with BBC iPlayer and LE menus. Nothing during Netflix (black)

How are you finding SD DVB streams? The HD Channels appear to work OK but this is what the grabber see's with SD channels (mpeg2 704x576). image

EDIT: Actually, I'm also getting a green band on HD channels across the very top: image

alexd321 commented 2 years ago

I can confirm that, after updating to LE 10.0.2, hyperion is working on a Pi Tv HAT via tvheadend, and it is working with BBC iPlayer and LE menus. Nothing during Netflix (black)

How are you finding SD DVB streams? The HD Channels appear to work OK but this is what the grabber see's with SD channels (mpeg2 704x576). image

EDIT: Actually, I'm also getting a green band on HD channels across the very top: image

Same here. Have had for a while on DVB-T. Have avoided too green a bar on top by skipping a few rows

Morphy99 commented 2 years ago

@alexd321 I've been playing around with the transcoding settings in TVH and I've managed to find some settings which transcode the MPEG2 SD streams to a h264 resolution which hyperion likes. Means that all channels seem to play OK with hyperion at last! image image

alexd321 commented 2 years ago

@alexd321 I've been playing around with the transcoding settings in TVH and I've managed to find some settings which transcode the MPEG2 SD streams to a h264 resolution which hyperion likes. Means that all channels seem to play OK with hyperion at last! image image

@Morphy99 I get no feed at all after specifying this stream in TVH client I think expert mode might have made things more complicated: image

Did I miss something?

Morphy99 commented 2 years ago

Mines on expert too. I think you're on 4.2. I had to update TVH to the latest docker instead of le add-on. I think it's 4.3. Video codec needs to be set to h264 not mpeg2 as well. Mpeg2 is the only the source. I also had to set the height larger than 1080 for some reason. I doubled the existing 576.

emc02 commented 1 year ago

Really no solution here... 🙁

miloit commented 1 year ago

Anyone working on this?

dapuzz commented 1 year ago

Have you tried the 2.0.13 beta here? https://github.com/hyperion-project/hyperion.ng/issues/983#issuecomment-1106681712 I have again the DispmanX working in Kodi 19

Salokyn commented 1 year ago

Hello ! Any news about this issue. I've just installed Hyperion 2.0.15 and get only the "Framebuffer" grabber.

louisnichols commented 1 year ago

Hi all!

I am complete noob to the technicalities of all this and I may be talking complete rubbish here, but could it be that what is described at the link below might be helpful for the Hyperion use case, too? It's from OBS, but seems to solve a problem somewhat similar, and to my untrained ear it sounds like the underlying technologies are the same.

https://obsproject.com/forum/threads/experimental-zero-copy-screen-capture-on-linux.101262/

sachinss123 commented 1 year ago

Confirming that the file linked above works on LibreElec 11.0.3 with Kodi 20 Nexus. Need to add a 30 sec delay in the systemd service file to boot properly.

top4ek commented 1 year ago

Can confirm working beta DRM grabber on LE 11.0.3 and OSMC on RPi3 but with memory leak problem. 2.0.15 — doesn't work, only framebuffer option. As I see, no one works ATM on that problem.

louisnichols commented 1 year ago

@sachinss123 Is that on an RPi? I tried it and I only get capture of the GUI, not videos.

sachinss123 commented 1 year ago

Yes it is on Rpi 4. Have you selected the DRM grabber in Hyperion config? Also try different kinds of video types. In an earlier Hyperion build it couldn't capture the correct colours for H265 videos. Maybe something similar is happening at your end?

On Sun, 24 Sept, 2023, 19:27 louisnichols, @.***> wrote:

@sachinss123 https://github.com/sachinss123 Is that on an RPi? I tried it and I only get capture of the GUI, not videos.

— Reply to this email directly, view it on GitHub https://github.com/hyperion-project/hyperion.ng/issues/983#issuecomment-1732576028, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANHXPH55IFTIWHR2TIUPZ6DX4A33XANCNFSM4QPCWLUQ . You are receiving this because you were mentioned.Message ID: @.***>

rudihorn commented 1 year ago

So I finally got a Raspberry Pi 4 and have found a fix to get my project to work based on https://github.com/w23/obs-kmsgrab. It seems that drm_prime_fd_to_handle is the way to open a framebuffer and that gets rid of some platform specific code I had. I'll try patching things up the next few days so that a binary is published. I also found a few other issues in my code that should fix other issues I had. That way it should be possible to use this with the latest hyperion-ng. For more info see https://github.com/rudihorn/drm-vc4-grabber/pull/6.

rudihorn commented 1 year ago

Released as https://github.com/rudihorn/drm-vc4-grabber/releases/tag/v0.1.0, any feedback is welcome.

sachinss123 commented 1 year ago

Thanks! Can you guide how to install this? I copied the file to /hyperion/bin, and restarted hyperiond but I don't think anything changed.

Edit: Got it working. You have to run the grabber in the background with Hyperion running.

Feedback: This works much better than the previous DRM grabber on Kodi20, RPI4. It even captures those videos where the older grabber just showed diagonal lines. However, is there a setting to change the decimation of the image? I saw the CPU usage shoot up while using this vs. the older DRM grabber. CPU was ~30% compared to ~10% with the older grabber. The image in Hyperion's Live Video feed is a lot clearer which makes me assume that the decimation should be increased.

BUBUsnet commented 1 year ago

Released as https://github.com/rudihorn/drm-vc4-grabber/releases/tag/v0.1.0, any feedback is welcome.

Thanks, get this error on rpi4 (Raspbian 11) on self compiled and precompiled bin: thread` 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Sys(EOPNOTSUPP)', src/main.rs:173:61

top4ek commented 1 year ago

RPi3 latest OSMC.

thread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }', src/main.rs:185:53

Flatbuffers MUST be enabled in Hyperion configuration.

App itself must be run as root. Looks wonderfull, continue testing. Can grabber's resolution to be adjusted like with default screen grabber "Picture decimation" parameter?

sheggy012 commented 1 year ago

Released as https://github.com/rudihorn/drm-vc4-grabber/releases/tag/v0.1.0, any feedback is welcome.

Works perfectly so far. Thank you.

MPowed commented 1 year ago

works with pi4 and 1080p media. 4k media has issues. If player PRIME render method is "direct to plane" then the flatbuffers server closes and hyperion does not work. if I change that to "EGL" then my experience is 50/50, some vidoes do not play and some do with hyperion working

alexd321 commented 1 year ago

Thanks! Can you guide how to install this? I copied the file to /hyperion/bin, and restarted hyperiond but I don't think anything changed.

Edit: Got it working. You have to run the grabber in the background with Hyperion running.

Feedback: This works much better than the previous DRM grabber on Kodi20, RPI4. It even captures those videos where the older grabber just showed diagonal lines. However, is there a setting to change the decimation of the image? I saw the CPU usage shoot up while using this vs. the older DRM grabber. CPU was ~30% compared to ~10% with the older grabber. The image in Hyperion's Live Video feed is a lot clearer which makes me assume that the decimation should be increased.

Instructions are here I believe https://github.com/rudihorn/drm-vc4-grabber