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

hyperion-x11 crashing on UHD resolution #620

Closed
hkalle opened this issue Aug 27, 2019 · 3 comments
Closed

hyperion-x11 crashing on UHD resolution #620

hkalle opened this issue Aug 27, 2019 · 3 comments

Comments

@hkalle
Copy link

hkalle commented Aug 27, 2019

Hyperion-x11 is crashing after an arbitrary period of time, when activating hyperion-ng with an UHD resolution (3840x2160). Crash can not be reproduced under HD resolution (1920x1080).

My system set-up

  • Client: Manjaro Linux kernel 5.2.8.1 on AMD Ryzen 5 2400G with Radeon Vega Graphics × 4
  • Hyperion server: Raspberry PI 3b+, Raspbian Buster

Terminal Log
[d023552@HTPC ~]$ hyperion-x11 -f 20 -s 16 -a raspberrypi:19400
hyperion-x11:
Version : 1.0.0 (master (GitHub-d263a319/b1fa085d-1566743539) Git Remote: /var/tmp/pamac-build-d023552/hyperion.ng-git/hyperion.ng)
build time: Aug 25 2019 18:51:51
[hyperion-x11 X11GRABBER] Update of screen resolution: [0x0] to [3840x2160]
[hyperion-x11 X11GRABBER] Using XRender for grabbing
[hyperion-x11 X11GRABBER] Update output image resolution: [0x0] to [240x135]
[hyperion-x11 X11GRABBER] Capture interface is now enabled
[hyperion-x11 FLATBUFCONNECTION] Connecting to Hyperion: raspberrypi:19400
[hyperion-x11 X11GRABBER] Update of screen resolution: [3840x2160] to [3840x2160]
[hyperion-x11 X11GRABBER] Using XRender for grabbing
[hyperion-x11 X11GRABBER] Update output image resolution: [240x135] to [240x135]
[hyperion-x11 FLATBUFCONNECTION] Connected to Hyperion: raspberrypi:19400
Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt.
You must not let any exception whatsoever propagate through Qt code.
If that is not possible, in Qt 5 you must at least reimplement
QCoreApplication::notify() and catch all exceptions there.
[hyperion-x11 X11GRABBER] Unable to parse message

Additional information

  • hyperion-x11 also crashes after resume from standby
  • hyperion-x11 is grabbing screen incorrect after resolution change HD --> UHD
@hkalle hkalle changed the title hyperion-x11 crashing hyperion-x11 crashing on UHD resolution Aug 28, 2019
@hkalle
Copy link
Author

hkalle commented Oct 17, 2019

Thanks all!

With version GitHub-b51e67a0/5e559627-1568748826 hyperoin-x11 grabber runs stable with 4k resolution.

Issues remaining:

  • hyperion-x11 crashes after resuming from standby (for me more a feature, since I anyhow thought about deactivating LEDs before HTPC wakes-up for recording)
  • hyperion-x11 is grabbing screen incorrectly after resolution change HD --> UHD; seems that it continues to grab a 1920x1080 piece from the screen.

@tpmodding tpmodding added Bug needs investigation Further testing is required labels Jun 3, 2020
@m-seker
Copy link
Contributor

m-seker commented Jul 5, 2020

hyperion-x11 is grabbing screen incorrectly after resolution change HD --> UHD; seems that it continues to grab a 1920x1080 piece from the screen.

That's an interesting one. Yes, looking at the code, the grabber doesn't seem to take resolution changes into account.

https://github.com/hyperion-project/hyperion.ng/blob/master/libsrc/grabber/x11/X11Grabber.cpp

I see 2 possible ways to solve it :

  • Check windows size before grabbing every frame and act if it changes. This may not be a good idea for performance reasons.

https://stackoverflow.com/questions/60493878/x11-in-c-xgetwindowattributes-is-too-slow

  • Setup an event loop and listen for resize events.

https://stackoverflow.com/questions/16907491/how-to-use-xlib-to-listen-for-screen-resolution-changes-on-linux

That means creating a second thread for listening the events while we are grabbing the screen in the first thread. However, although X11 supports multiple threads (https://www.systutorials.com/docs/linux/man/3-XInitThreads/), it has some known issues in multi-threaded environments and is mostly discouraged to use.

Another solution would be getting the event from outside of the class (maybe even outside of the process) but that doesn't feel like a good solution.

@hkalle
Copy link
Author

hkalle commented Jul 6, 2020

For me it is working now, running an instance of hyperion.ng on both machines (HTPC = Manjaro Linux, hyperion harware & server = Raspberry Pi). Grabbing is taking place on HTPC and picture is forwarded via flatbuffer to raspberrypi. Hyperion.ng instance on HTPC is taking care of resolution changes.

Paulchen-Panther added a commit that referenced this issue Jul 12, 2020
* Detect resolution changes

* include Qt5Widgets

* find Qt5Widgets

Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
@Paulchen-Panther Paulchen-Panther added Waiting For Review and removed Bug needs investigation Further testing is required labels Jul 20, 2020
@hkalle hkalle closed this as completed Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants