jahnf / Projecteur

Linux Desktop Application for the Logitech Spotlight device (and similar devices) - Digital Laser Pointer
MIT License
379 stars 33 forks source link

Builds with Qt 5.8 do not work & Device detection issue on Hyperbola Linux #26

Closed ralessi closed 4 years ago

ralessi commented 5 years ago

Note: This is more a feedback from experience than an issue report.

When I plug a second screen in the VGA port of my X200, Projecteur works perfectly.

Otherwise, I had to struggle a bit to figure out how to make Projecteur work with a second HDMI screen plugged in the DisplayPort provided by the dock station of the X200. The only scenario that works is the following:

  1. Before launching Projecteur itself, disable the second screen, so that Projecteur sees it as "not connected" when it is launched.
  2. Launch Projecteur.
  3. After that, enable the second screen. If the spotlight doesn't show, select the appropriate screen in the settings of Projecteur.

The same scenario applies with so-called DisplayLink screens which are plugged in USB ports.

Otherwise, the spotlight shows, but it is limited to a small area stuck at the top left corner of the selected screen. This may be related to https://github.com/jahnf/Projecteur/issues/22#issue-455355175.

jahnf commented 5 years ago

Thanks for the description. Definitely something to put into the future Readme/Troubleshooting or Wiki page. I did not have that issue on my setup with Notebook Screen + Additional 4K Monitor - unfortunately - so it's hard to find the issue. I am still thinking about how to make sure that most of the countless different setups (Linux Distro, Monitors, Window Managers, Graphic Drivers, Different Qt versions....) are working.

ralessi commented 5 years ago

Yes, the different parameters seem way too intricate. At first, I thought that Projecteur may not work with USB DisplayLink. But I was wrong. Does your Notebook have a VGA output as mine or something like DisplayPort or HDMI? My current impression is that difficulties arise when trying to connect VGA output to something more advanced (as DVI, HDMI and the like). But again, I may be wrong!

jahnf commented 5 years ago

My notebook has a (mini) DisplayPort output. I did test with that and a multi-monitor setup within a VirtualBox. The tricky part with the overlay window is that different window managers behave differently when setting the overlay windows size and/or set it to full screen + additional window flags to have no title bar etc... (via the Qt API) - I discovered the way that it works now (hopefully for most setups) basically by trial and error :) - also the order seems very important e.g. something like: resizing the window, hiding the window, placing it on the other screen and resizing it to the screens resolution...

ralessi commented 5 years ago

In addition to that, I also discovered that (at least on my side, that is: awesome wm + compton for transparency), Projecteur does not show the spotlight unless the user select the appropriate screen at least one time. So in case no external monitor is connected, it is not possible to select, say, "screen 1" and switch back to "screen 0" because there is no "screen 1" to select. But this could be easily solved by editing Projecteur.conf and setting screen= to 1 under [General]. This way, Projecteur shows "screen 1" as "not connected", and one is able to apply the scenario described above. Now I think I can operate Projecteur in any situation!

jahnf commented 4 years ago

....awesome wm + compton for transparency), Projecteur does not show the spotlight unless the user select the appropriate screen at least one time. So in case no external monitor is connected, it is not possible to select, say, "screen 1" and switch back to "screen 0" because there is no "screen 1" to select. But this could be easily solved by editing Projecteur.conf and setting screen= to 1 under [General]....

@ralessi Does this issue still exist with the latest version from develop? (The screen should now switched automatically depending on where the cursor is)

ralessi commented 4 years ago

Does this issue still exist with the latest version from develop? (The screen should now switched automatically depending on where the cursor is)

I just built this version, but I can't get it to work: the screen selection dropdown menu is gone and "device connected" is set to "false". I still can move the mouse pointer, but that's all about it.

Did I miss something? I'm quite sure I did!

ralessi commented 4 years ago

I just built this version, but I can't get it to work: the screen selection dropdown menu is gone and "device connected" is set to "false". I still can move the mouse pointer, but that's all about it.

Correction: after rebooting, "device connected" shows "true". But no screen selection dropdown, and no spotlight either. Is it required to have a second screen connected for this version of Projecteur to work?

jahnf commented 4 years ago

But no screen selection dropdown, and no spotlight either. Is it required to have a second screen connected for this version of Projecteur to work?

No, the screen is now automatically set, depending on where the mouse cursor is. (Edit: The setting is still there but it should not be necessary to set by the user) So it seems the issue with your configuration is that as you described it: you have to set the screen at least once (back and forth) ... Could you try your trick with the screen setting in the config? (Edit: i.e. setting the screen to 1 or higher in the config before starting like you described in previous posts)

jahnf commented 4 years ago

Please give it a try with

ralessi commented 4 years ago

I just tested once 0.6-alpha.61 successfully (actually from 567f415 which came through git pull) with these udev rules:

# Rule for USB Receiver
SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c53e", MODE="660", GROUP="spotlight-device", ENV{USB_HUB_TYPE}="046d:c53e"

# Rule when connected via Bluetooth
# Updated rule, thanks to Torsten Maehne (https://github.com/maehne)
SUBSYSTEMS=="input", ATTRS{name}=="SPOTLIGHT*", MODE="660", GROUP="spotlight-device"

Should I rather use the new 55-spotlight.rules in which no user group is specified? I will test both versions extensively tomorrow.

jahnf commented 4 years ago

Perfect, so the issue seems to be resolved. Did I understand that correctly?

With the commit you are referring to, You are building from the feature/libusb-integration branch. Why so? Is that on purpose? That branch is currently just a test and play branch for future use of talking via USB to the device directly. If you like an up to date version, you should build from develop. From this branch the next release version will be created.

You can try if the newer rules file works you. But if the current installed one works for you it's not important.

ralessi commented 4 years ago

Perfect, so the issue seems to be resolved. Did I understand that correctly?

Unfortunately, not quite. I just rebuilt Projecteur from [14d59c5]. (Sorry, I didn't pay attention earlier.) Here's what happens:

  1. With the new udev rules, the device is simply not detected. It may be detected occasionally, but that does not changes anything.
  2. With the previous udev rules, it is detected but the spotlight shows one time out of three or so, meaning that I have to quit Projecteur and relaunch it several times for the spotlight to finally appear.
jahnf commented 4 years ago

@ralessi We should sperate this in two things:

  1. Does the "spotlight" effect now work for you? (test Button) In the issue you said you had problems with screens and settings and the spotlight not showing.
  2. The detection of the spotlight device... What Linux Distro + Version are you running? Which Window Managers , Desktop and Versions.
ralessi commented 4 years ago

@ralessi We should sperate this in two things:

  1. Does the "spotlight" effect now work for you? (test Button) In the issue you said you had problems with screens and settings and the spotlight not showing.

Unfortunately not with 0.6-alpha.61 [14d59c5]. I would roughly say that the spotlight appears one time out of three. Hitting the test button makes a kind of empty rectangle appear very sneakily on the upper left corner of the screen.

  1. The detection of the spotlight device... What Linux Distro + Version are you running? Which Window Managers , Desktop and Versions.

Hyperbola GNU/Linux which is based on Archlinux. I use awesome-wm + compton for transparency, which worked very well conjointly with Projecteur 0.6-alpha.5 [da9de7b].

jahnf commented 4 years ago

well up to 19f46bfa01b167f7860d30913efdb00ea4aba22b (https://github.com/jahnf/Projecteur/commits/develop) all versions should behave the same as 0.6-alpha.5 - up to that commit there were no changes for screens and screen settings.

And sorry that I can't help you there, since I have no way to reproduce it :disappointed:

For your problem about detection of the device: thats something with udev and the rules... make sure you dont't have conflicting rules. Do you have a spotlight rules file in different location for example? (e.g. one from a binary package and one that you yourself put somewhere..)

ralessi commented 4 years ago

well up to 19f46bfa01b167f7860d30913efdb00ea4aba22b (https://github.com/jahnf/Projecteur/commits/develop) all versions should behave the same as 0.6-alpha.5 - up to that commit there were no changes for screens and screen settings.

I didn't find this commit in the log.

And sorry that I can't help you there, since I have no way to reproduce it :disappointed:

Maybe some future version will work? One never knows. Meanwhile, I will keep the version that works for me, which has become almost indispensable to me! I also tested it under mate-wm, but no avail.

For your problem about detection of the device: thats something with udev and the rules... make sure you dont't have conflicting rules. Do you have a spotlight rules file in different location for example? (e.g. one from a binary package and one that you yourself put somewhere..)

No, I compile Projecteur from source every time and always copy the rule file to /etc/udev/rule.d

jahnf commented 4 years ago

It seems to be a problem with the Qt version you have... Hyperbola has Qt 5.8. I just reproduced the problem with Qt 5.8. Qt 5.8 is a strange version to have in a distribution. Qt 5.9 is an LTS version. Maybe its only Qt 5.8 - I have to try with 5.7 - I know 5.9 works and 5.11 and 5.12

ralessi commented 4 years ago

It seems to be a problem with the Qt version you have... Hyperbola has Qt 5.8. I just reproduced the problem with Qt 5.8. Qt 5.8 is a strange version to have in a distribution. Qt 5.9 is an LTS version. Maybe its only Qt 5.8 - I have to try with 5.7 - I know 5.9 works and 5.11 and 5.12

That is quite some progress, thank you for looking into this! Maybe I could ask the maintainers of Hyperbola to update 5.8 to 5.9 as they are prone to follow LTS versions.

jahnf commented 4 years ago

So it's definitly Qt5.8 - 5.7 works... 5.9 works...

Yes the Qt5.8 is especially strange for a distribution, calling itself long-term distribution :smile:

But you can always download precompiled binaries from Qt and build projecteur against that: https://download.qt.io/archive/qt/ For example https://download.qt.io/archive/qt/5.12/5.12.5/qt-opensource-linux-x64-5.12.5.run (5.12 is also an LTS release)

No, I compile Projecteur from source every time and always copy the rule file to /etc/udev/rule.d

If the "old" rules file works for you, you should use that file. The "new" rules files with uaccess works on all my machines. And seems to work for other users also. Maybe Hyperbola Linux has also a strange udev version ?? :wink:

ralessi commented 4 years ago

So it's definitly Qt5.8 - 5.7 works... 5.9 works...

Now the culprit is known.

Yes the Qt5.8 is especially strange for a distribution, calling itself long-term distribution :smile:

Hyperbola is joung, maintained by a very small numbers of volunteers, that's why strange things still may be found now and then around the corner!

But you can always download precompiled binaries from Qt and build projecteur against that: https://download.qt.io/archive/qt/ For example https://download.qt.io/archive/qt/5.12/5.12.5/qt-opensource-linux-x64-5.12.5.run (5.12 is also an LTS release)

Good advice, I will do that!

No, I compile Projecteur from source every time and always copy the rule file to /etc/udev/rule.d Well the "old" rules file works for you, you should use that file. The "new" rules files with uaccess works on all my machines. And seems to work for other users also. Maybe Hyperbola Linux has also a strange udev version ?? :wink:

One never knows! Thanks again for your help!

ralessi commented 4 years ago

I have no idea as to whether this helps or not, but compiling the latest projecteur with Qt 5.8/Hyperbola return this message in the end:

/usr/lib/libQt5Network.so.5.8.0: warning : EVP_CipherFinal is often misused, please use EVP_CipherFinal_ex and EVP_CIPHER_CTX_cleanup

jahnf commented 4 years ago

Thank for the info, but that message seems to be coming directly from Qt itself and some dependencies it uses (EVP_CipherFinal is something from openssl). QNetwork module is not related to screen issue. I decided to put a warning about NOT to use Qt 5.8 in the README.md and build instructions. I see no point in investigating further towards Qt 5.8, since all other Qt versions don't have this problem (5.7 up the current version work). And as I mentioned earlier, Qt 5.8 is a strange version to see in the field, since 5.9 is an LTS release and there is already another LTS release out there with 5.12.

ralessi commented 4 years ago

I decided to put a warning about Qt 5.8 in the README.md and build instructions. I see no point in investigating further towards Qt 5.8, since all other Qt versions don't have this problem (5.7 up the current version work). And as I mentioned earlier, Qt 5.8 is a strange version to see in the field, since 5.9 is an LTS release and there is already another LTS release out there with 5.12.

Thank you. I mistakenly thought that this issue was still being looked into, but I understand that there is no point in investigating it further.

I will ask the maintainers of Hyperbola if they can update Qt 5.8 to 5.9 or 5.12. Meanwhile I will build Projecteur myself with an updated version of Qt.

Many thanks again!

jahnf commented 4 years ago

I mistakenly thought that this issue was still being looked into

I adjusted the title, so others know with one look what the actual outcome of this long issue is :) I will close this issue as soon as I updated the README for the upcoming version 0.6.

Many thanks again!

You're very welcome.

ralessi commented 4 years ago

I just tried to build Projecteur with Qt 5.12.5 which I installed following your advice. But when I try to launch Projecteur from the command line, I get this error message. What did I miss?

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

Quit
jahnf commented 4 years ago

Can you try to start GUI tools that come with that Qt 5.12.5 (e.g. Qt/Tools/QtCreator/bin/qtcreator or Qt/5.12.5/gcc_64/bin/qdbusviewer) (from the command line); Do they show the same error?

If yes then I guess the pre-built-binaries from Qt are having some issues with the libraries on your system. (You could try Qt 5.7 or Qt 5.9 then) (https://forum.qt.io/topic/93247/qt-qpa-plugin-could-not-load-the-qt-platform-plugin-xcb-in-even-though-it-was-found)

Edit: Out of interest: any specific reason to use Hyperbola Linux? If you prefer Arch Linux there is Manjaro-Linux and many others.

ralessi commented 4 years ago

Can you try to start GUI tools that come with that Qt 5.12.5 (e.g. Qt/Tools/QtCreator/bin/qtcreator or Qt/5.12.5/gcc_64/bin/qdbusviewer) (from the command line); Do they show the same error?

Yes, both showed the same error...

If yes then I guess the pre-built-binaries from Qt are having some issues with the libraries on your system. (You could try Qt 5.7 or Qt 5.9 then) (https://forum.qt.io/topic/93247/qt-qpa-plugin-could-not-load-the-qt-platform-plugin-xcb-in-even-though-it-was-found)

Well, I tried 5.7 and 5.9 but no avail. I guess that's about it! I will ask the maintainers of Hyperbola if they can update Qt5 and wait for their answer for I think I can't do anything by myself at this point.

Edit: Out of interest: any specific reason to use Hyperbola Linux? If you prefer Arch Linux there is Manjaro-Linux and many others.

Actually there are two: free software and stability. Additionally, at least in my opinion, the developers made very good decisions, such as the adoption of openrc, libressl, etc. Anyway, I will find a way to follow Projecteur!

jahnf commented 4 years ago

Well, I tried 5.7 and 5.9 but no avail. I guess that's about it! I will ask the maintainers of Hyperbola if they can update Qt5 and wait for their answer for I think I can't do anything by myself at this point.

no avail = didn't work either?

You can still build Qt yourself :smile: - but that can be quiet an adventure in itself. Anyway please let me know when you had any success or progress.

Is it okay for you if I close this issue?

ralessi commented 4 years ago

no avail = didn't work either?

Exactly, I get the same error over and over... As to building Qt, I will not venture into this!

Yes, helas for me, this issue can be closed :-( I will keep you posted, meanwhile, thanks a lot again!

ralessi commented 4 years ago

Let us see what happens: https://issues.hyperbola.info/index.php?do=details&task_id=1480

ralessi commented 4 years ago

Now I am totally confused!

I just compiled the latest Projecteur (0.6-alpha.75 [7586960]) and it worked out of the box, that is not one time out of three, but every time.

One (unrelated I think) issue that remains is about the zoom: when dual-screen is enabled and the screens are set to display different areas, the magnifier superimposes the two different screens and makes them as one. Of course, this does not happen if the two screens are set to display one single identical area.

Well, the breaking news is that the latest Projecteur seems to work on Hyperbola + Qt 5.8! I will do some further testing tomorrow and try to confirm this.

ralessi commented 4 years ago

Again, with 0.6-alpha.78 [b6bbc32], I confirm that the issue reported here about Qt 5.8 is completely gone. Projecteur definitely works with Qt 5.8.

Don't you think it might be useful to do a bisect to try to identify a possible offending commit between the first version known not to work (bad) and [7586960] (good)?

I enjoy very much working with this version Projecteur!

jahnf commented 4 years ago

Glad to hear it works and the project is used. Most likely what made it work also with Qt 5.8 is this change: ece578167183de4b22168a83b411fba9c2d67544

ralessi commented 4 years ago

Good to know it has been spotted! A missing command to make a window top level?

By the way, do you experience the same that I do with the magnifier when the two screens are set to display different areas?

jahnf commented 4 years ago

By the way, do you experience the same that I do with the magnifier when the two screens are set to display different areas?

No on my multi-monitor setups and when I attach an additional monitor/tv/whatever to my notebook it works fine. What do you mean by "two screens to display different areas"? Just a regular two monitor setup?

ralessi commented 4 years ago

By the way, do you experience the same that I do with the magnifier when the two screens are set to display different areas?

No on my multi-monitor setups and when I attach an additional monitor/tv/whatever to my notebook it works fine. What do you mean by "two screens to display different areas"? Just a regular two monitor setup?

Yes, a regular two-monitor setup in which, for example, you have your personal notes on your laptop and the slides for an audience on monitor 2. What I am experiencing under such a configuration is that the magnifier, say on monitor 2, displays magnified two images superimposed: that of monitor 2 and that of monitor 1, with increased darkness over the two and a pixelized text.

If the magnifier is disabled, then everything is fine.

This does not happen if I configure my two-monitor setup so as to display the same image on both monitors: then the magnifier works perfectly.

EDIT: Well, this happens at least with Qt 5.8, as you know well!

jahnf commented 4 years ago

What I am experiencing under such a configuration is that the magnifier, say on monitor 2, displays magnified two images superimposed: that of monitor 2 and that of monitor 1

I can't reproduce that, sounds very stange , any chance that you could make a screenshot of that?

ralessi commented 4 years ago

Might it be another Qt 5.8 only related issue? ;-)

Here is a screenshot.

projecteur

jahnf commented 4 years ago

@ralessi Please give it a try with branch feature/wayland-zoom-support, besides changes for Wayland there are also changes in there that might fix your zoom issue.

ralessi commented 4 years ago

@ralessi Please give branch feature/wayland-zoom-support a try, there is also changes in there that might fix your zoom issue.

Yes, I confirm that this issue is gone. Now I can enjoy all of the features of Projecteur.

I intend to submit a package for Hyperbola when 0.7 is ready, thank you very much for the help and your excellent work!