psieg / Lightpack

Lightpack and Prismatik open repository

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prismatik not lighting up the LEDs (No screens with widgets found)

manorit2001 opened this issue · comments

This is built with latest master on git and tried with the specified tag as well but it doesn't seem to work

Attached Logs:
Prismatik.0.log

Screen resolution:
3440x1440

I have had this working when I was on a 1080p monitor and I can see the LEDs sometimes lighting up as well but as soon as I switch to screen grabber mode now with the new monitor, something goes wrong and I can't make the other modes also work after that somehow. Not sure what is happening as soon as I shift to the grabbing mode.

@psieg any inputs as to why this can occur?

Does it work if you bulid from the 5.11.2.31 commit (5044e21)?
Master switched to Qt6 recently and Qt6 uses different coordinates for high DPI displays.

I only have Windows available to test, what we are missing is fixing the coordinate system here:

if (screen.rect.intersects(grabWidgets[k]->rect())) {

Can you try copying the logic from here:

QPoint offset = widget->frameGeometry().topLeft() - widget->screen()->geometry().topLeft();

before comparing the widget rect with the screen rect?
#574 has some more details, in particular https://doc.qt.io/qt-6/highdpi.html

Or maybe X11 has an equivalent to what Desktop Duplication does, so we don't need to do coordinates math:

HMONITOR widgetMonitor = MonitorFromWindow(reinterpret_cast<HWND>(widget->winId()), MONITOR_DEFAULTTONULL);

The problem is first I want to understand that even if that doesn't work, why are the other methods also failing? ( The moodlamp one for e.g )

With the version you mentioned (5.11.2.31), I think things seem to work fine now, However, I have faced issues with that as well. Trying to understand why, so I had to delete the ~/.Prismatik directory as well somehow, don't know why but after doing that, it started working.. otherwise just changing the Prismatik binary hadn't working... do you know any reason as to how this could've happened?

Your log contains these two lines:
void GrabManager::initLedWidgets(int) Grabbing 0 LEDs!
static QVariant SettingsScope::Settings::valueMain(const QString&) "Adalight/NumberOfLeds" = QVariant(QString, "0")

Possibly something screws up this field / the device configuration when running into this no screens found thing the first time, or this isn't a problem with scaling after all.

My guess is that that also breaks Moodlight, because the Moodlight successfully writes an empty buffer to the device:
bool LedDeviceAdalight::writeBuffer(const QByteArray&) Hex: ""

To verify, it would help if you could upload the log when you run the master build for the first time (backup your config folder first ;) )

Please try the build from the coordinates_x11 branch as well, hopefully that fixes it, but I didn't have a linux system available to test.

To verify, it would help if you could upload the log when you run the master build for the first time (backup your config folder first ;) )

How can I enabled the debug logs that time? I recall that I have to increase the debugLevel in ~/.Prismatik/main.conf to get the debug logs.

user@user-inspiron7572:pts/2->/home/user/Projects/Lightpack/Software/bin (0) git:(coordinates_x11)
> ./Prismatik                                                                                                                                                                                                                                                                                                                                  <<<
/home/user/Projects/Lightpack/Software/bin/main.conf
Unportable version
mkdir /home/user/.Prismatik
Configuration directory: /home/user/.Prismatik
00:04:52:485 Debug: Prismatik: 5.11.2.31 rev. cd4d5880
00:04:52:485 Debug: Build with Qt verison: 5.15.12
00:04:52:485 Debug: Qt version currently in use: 5.15.12
00:04:52:485 Debug: Running on: "Manjaro Linux"
00:05:05:735 Debug: 2288 1224
00:05:05:775 Debug: 2924 0
00:05:05:838 Debug: 2867 0
00:05:05:852 Debug: 2294 0
00:05:05:922 Debug: 1720 0
00:05:05:937 Debug: 1146 0
00:05:05:947 Debug: 573 0
00:05:05:967 Debug: 0 0
00:05:06:010 Debug: 0 0
00:05:06:020 Debug: 0 1224
00:05:26:649 Debug: 2288 1224
00:05:26:660 Debug: 2576 1224
00:05:26:665 Debug: 2864 1224
00:05:26:670 Debug: 3152 1224
00:05:26:712 Debug: 2924 1338
00:05:26:729 Debug: 2924 1235
00:05:26:743 Debug: 2924 1132
00:05:26:772 Debug: 2924 1029
00:05:26:781 Debug: 2924 926
00:05:26:800 Debug: 2924 823
00:05:26:846 Debug: 2924 720
00:05:26:863 Debug: 2924 617
00:05:26:875 Debug: 2924 514
00:05:26:888 Debug: 2924 411
00:05:26:923 Debug: 2924 308
00:05:26:953 Debug: 2924 205
00:05:26:963 Debug: 2924 102
00:05:26:973 Debug: 2924 0
00:05:26:988 Debug: 3297 0
00:05:27:026 Debug: 3154 0
00:05:27:040 Debug: 3011 0
00:05:27:048 Debug: 2868 0
00:05:27:091 Debug: 2725 0
00:05:27:104 Debug: 2582 0
00:05:27:113 Debug: 2439 0
00:05:27:122 Debug: 2296 0
00:05:27:135 Debug: 2152 0
00:05:27:182 Debug: 2008 0
00:05:27:189 Debug: 1864 0
00:05:27:197 Debug: 1720 0
00:05:27:208 Debug: 1576 0
00:05:27:246 Debug: 1432 0
00:05:27:256 Debug: 1288 0
00:05:27:263 Debug: 1144 0
00:05:27:270 Debug: 1001 0
00:05:27:328 Debug: 858 0
00:05:27:337 Debug: 715 0
00:05:27:343 Debug: 572 0
00:05:27:349 Debug: 429 0
00:05:27:355 Debug: 286 0
00:05:27:361 Debug: 143 0
00:05:27:373 Debug: 0 0
00:05:27:433 Debug: 0 0
00:05:27:449 Debug: 0 102
00:05:27:462 Debug: 0 205
00:05:27:475 Debug: 0 308
00:05:27:490 Debug: 0 411
00:05:27:525 Debug: 0 514
00:05:27:534 Debug: 0 617
00:05:27:542 Debug: 0 720
00:05:27:549 Debug: 0 823
00:05:27:559 Debug: 0 926
00:05:27:609 Debug: 0 1029
00:05:27:614 Debug: 0 1132
00:05:27:619 Debug: 0 1235
00:05:27:629 Debug: 0 1338
00:05:27:676 Debug: 0 1224
00:05:27:696 Debug: 288 1224
00:05:27:704 Debug: 576 1224
00:05:27:711 Debug: 864 1224
00:05:37:166 Warning: QWizard::field: No such field 'isLightpack'
00:05:40:903 Debug: 2288 1224
00:05:40:914 Debug: 2576 1224
00:05:40:919 Debug: 2864 1224
00:05:40:923 Debug: 3152 1224
00:05:40:951 Debug: 2924 1338
00:05:40:960 Debug: 2924 1235
00:05:40:975 Debug: 2924 1132
00:05:41:008 Debug: 2924 1029
00:05:41:024 Debug: 2924 926
00:05:41:042 Debug: 2924 823
00:05:41:056 Debug: 2924 720
00:05:41:061 Debug: 2924 617
00:05:41:084 Debug: 2924 514
00:05:41:089 Debug: 2924 411
00:05:41:094 Debug: 2924 308
00:05:41:102 Debug: 2924 205
00:05:41:129 Debug: 2924 102
00:05:41:135 Debug: 2924 0
00:05:41:141 Debug: 3297 0
00:05:41:147 Debug: 3154 0
00:05:41:156 Debug: 3011 0
00:05:41:207 Debug: 2868 0
00:05:41:215 Debug: 2725 0
00:05:41:224 Debug: 2582 0
00:05:41:269 Debug: 2439 0
00:05:41:277 Debug: 2296 0
00:05:41:286 Debug: 2152 0
00:05:41:311 Debug: 2008 0
00:05:41:343 Debug: 1864 0
00:05:41:351 Debug: 1720 0
00:05:41:363 Debug: 1576 0
00:05:41:409 Debug: 1432 0
00:05:41:422 Debug: 1288 0
00:05:41:434 Debug: 1144 0
00:05:41:468 Debug: 1001 0
00:05:41:485 Debug: 858 0
00:05:41:505 Debug: 715 0
00:05:41:512 Debug: 572 0
00:05:41:519 Debug: 429 0
00:05:41:538 Debug: 286 0
00:05:41:546 Debug: 143 0
00:05:41:577 Debug: 0 0
00:05:41:583 Debug: 0 0
00:05:41:590 Debug: 0 102
00:05:41:596 Debug: 0 205
00:05:41:601 Debug: 0 308
00:05:41:670 Debug: 0 411
00:05:41:679 Debug: 0 514
00:05:41:687 Debug: 0 617
00:05:41:694 Debug: 0 720
00:05:41:700 Debug: 0 823
00:05:41:708 Debug: 0 926
00:05:41:763 Debug: 0 1029
00:05:41:777 Debug: 0 1132
00:05:41:782 Debug: 0 1235
00:05:41:803 Debug: 0 1338
00:05:41:811 Debug: 0 1224
00:05:41:823 Debug: 288 1224
00:05:41:853 Debug: 576 1224
00:05:41:864 Debug: 864 1224
00:05:46:280 Warning: QWizard::field: No such field 'isLightpack'
00:05:47:839 Warning: QWizard::field: No such field 'isLightpack'
00:06:09:809 Debug: pa_context_connect: OK
00:06:09:812 Debug: Start main event loop: lightpackApp.exec();
00:06:10:215 Warning: void GrabManager::onGrabApplyBlueLightReductionChanged(bool) could not create Blue Light Reduction client
[1]    1354284 illegal hardware instruction (core dumped)  ./Prismatik
git:(coordinates_x11)
user@user-inspiron7572:pts/2->/home/user/Projects/Lightpack/Software/bin (132) git:(coordinates_x11)
> ./Prismatik
/home/user/Projects/Lightpack/Software/bin/main.conf
Unportable version
Configuration directory: /home/user/.Prismatik
00:06:30:856 Debug: Prismatik: 5.11.2.31 rev. cd4d5880
00:06:30:856 Debug: Build with Qt verison: 5.15.12
00:06:30:856 Debug: Qt version currently in use: 5.15.12
00:06:30:856 Debug: Running on: "Manjaro Linux"
00:06:31:659 Debug: pa_context_connect: OK
00:06:31:663 Debug: Start main event loop: lightpackApp.exec();
00:06:32:192 Warning: void GrabManager::onGrabApplyBlueLightReductionChanged(bool) could not create Blue Light Reduction client
[1]    1356925 illegal hardware instruction (core dumped)  ./Prismatik
git:(coordinates_x11)
user@user-inspiron7572:pts/2->/home/user/Projects/Lightpack/Software/bin (132) git:(coordinates_x11)
>

I see some flaky results..

logs.txt

Indeed, not sure if core dump crashes are related or not. This looks like the stdout log, I think we'd need the log file to understand what exactly is happening (with the maximum debug level, 3 - there's indeed DebugLevel=3 in the main.conf).

same issue. Any fix?