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

fast_host.py and slow_host.py don't work on Arch Linux #2

Open
efe3535 opened this issue Jul 21, 2022 · 5 comments
Open

fast_host.py and slow_host.py don't work on Arch Linux #2

efe3535 opened this issue Jul 21, 2022 · 5 comments

Comments

@efe3535
Copy link

efe3535 commented Jul 21, 2022

fast_host.py

------------- [ initialize ] -------------

Device not found... Connect device
Device Found!!
Setting device configuration...
ERROR: USBError occured. Re-connect the device...

---------------- [ end ] ----------------


------------- [ handshake ] -------------

ERROR: USBError occured. Re-connect the device...

---------------- [ end ] ----------------


------------- [ stream start ] -------------

Streaming started...
Traceback (most recent call last):
  File "/home/enginar/git-repos/stm32_tiny_monitor/host_python_scripts/fast_host/start_host.py", line 1, in <module>
    import fast_host
  File "fast_host.pyx", line 146, in init fast_host
    initialize()
  File "fast_host.pyx", line 141, in fast_host.initialize
    stream_out(usb_device)
  File "fast_host.pyx", line 101, in fast_host.stream_out
    img = Image.frombytes('RGB', (w, h), sct.grab(monitor).rgb)                 # <-- mss is way fater than pyautogui
  File "/usr/lib/python3.10/site-packages/mss/base.py", line 88, in grab
    return self._grab_impl(monitor)
  File "/usr/lib/python3.10/site-packages/mss/linux.py", line 446, in _grab_impl
    ximage = self.xlib.XGetImage(
  File "/usr/lib/python3.10/site-packages/mss/linux.py", line 191, in validate
    raise ScreenShotError(err, details=details)
mss.exception.ScreenShotError: XGetImage() failed
~/git-repos/stm32_tiny_monitor/host_python_scripts/f

slow_host.py

------------- [ initialize ] -------------

TinyMonitor Found... :)
Setting device configuration...
ERROR: USBError occured. Re-connect the device...

---------------- [ end ] ----------------


------------- [ handshake ] -------------

ERROR: USBError occured. Re-connect the device...

---------------- [ end ] ----------------


------------- [ stream start ] -------------

Streaming started...
Traceback (most recent call last):
  File "/home/enginar/git-repos/stm32_tiny_monitor/host_python_scripts/slow_host/host.py", line 144, in <module>
    initialize()
  File "/home/enginar/git-repos/stm32_tiny_monitor/host_python_scripts/slow_host/host.py", line 139, in initialize
    stream_out(usb_device)
  File "/home/enginar/git-repos/stm32_tiny_monitor/host_python_scripts/slow_host/host.py", line 99, in stream_out
    img = Image.frombytes('RGB', (w, h), sct.grab(monitor).rgb)                 # <-- mss is way fater than pyautogui
  File "/usr/lib/python3.10/site-packages/mss/base.py", line 88, in grab
    return self._grab_impl(monitor)
  File "/usr/lib/python3.10/site-packages/mss/linux.py", line 446, in _grab_impl
    ximage = self.xlib.XGetImage(
  File "/usr/lib/python3.10/site-packages/mss/linux.py", line 191, in validate
    raise ScreenShotError(err, details=details)
mss.exception.ScreenShotError: XGetImage() failed

@efe3535 efe3535 changed the title fast_host.py doesn't work on Arch Linux fast_host.py and slow_host.py don't work on Arch Linux Jul 21, 2022
@abhra0897
Copy link
Owner

That's weird. Unfortunately I don't have Arch Linux installed at this moment. I'll try to install it using virtual box and test the script.

Can you test on debian based system? Since I tested it only on Ubuntu/kubuntu

@efe3535
Copy link
Author

efe3535 commented Jul 22, 2022

When I have the time I'll give this a chance, thank you!

@abhra0897
Copy link
Owner

Hi, I'm just curious if you could solve this issue.

I found a github issue about similar problem: mozilla/iris#621

Apparently, if your system is using Wayland instead of X11, this problem might occur.

@efe3535
Copy link
Author

efe3535 commented Jan 31, 2023

Unfortunately I switched to a Mac a month ago, so I'm unable to reproduce the issue. I was using X11 at the time though.

@abhra0897
Copy link
Owner

No problem.. Thanks for the confirmation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants