Bug 487938 - Valve Index VR headset display can't be leased without having to re-plug its power and then reboot: kwin_wayland[1295]: kwin_wayland_drm: Can't lease connector: No suitable crtc available
Summary: Valve Index VR headset display can't be leased without having to re-plug its ...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: platform-drm (other bugs)
Version First Reported In: 6.0.5
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-02 21:18 UTC by Jonathan
Modified: 2024-07-10 17:32 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.1.0
Sentry Crash Report:


Attachments
"journalctl --follow" running during SteamVR start after step 3 (headset display visible in xrandr) (3.82 KB, text/x-log)
2024-06-02 21:18 UTC, Jonathan
Details
SteamVR vrcompositor logfile showing failed lease attempt of VR headset display (7.62 KB, text/plain)
2024-06-02 21:19 UTC, Jonathan
Details
successfull vrcompositor logfile after rebooting after having re-plugged the headset during last boot (11.07 KB, text/plain)
2024-06-02 21:20 UTC, Jonathan
Details
xrandr output compared before and after re-plugging power of the headset on initial boot (4.24 KB, text/plain)
2024-06-02 21:21 UTC, Jonathan
Details
xrandr after rebooting and having re-plugged power to the headset during last boot (2.20 KB, text/plain)
2024-06-02 21:22 UTC, Jonathan
Details
drm_info saved before SteamVR is confirmed working (116.18 KB, text/plain)
2024-06-03 10:57 UTC, Jonathan
Details
drm_info saved before SteamVR is confirmed NOT working (116.00 KB, text/plain)
2024-06-03 10:58 UTC, Jonathan
Details
drm_info after re-plugging headset but not rebooting the PC => SteamVR fails to find it (116.18 KB, text/plain)
2024-06-03 18:07 UTC, Jonathan
Details
journalctl --user-unit plasma-kwin_wayland --boot 0 => after re-plugging headset but not rebooting the PC (3.97 KB, text/plain)
2024-06-03 18:11 UTC, Jonathan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan 2024-06-02 21:18:00 UTC
Created attachment 170070 [details]
"journalctl --follow" running during SteamVR start after step 3 (headset display visible in xrandr)

SUMMARY
I have to re-plug the Valve Index VR headset and then reboot my system every time I want to use SteamVR

STEPS TO REPRODUCE
1. Start PC - VR Headset is not recognized in xrandr
2. Start SteamVR - get error "Failed to connect to headset display" and SteamVR is unable to detect the display - same as xrandr
3. Unplug the power connector of the headset and plug it back in after waiting a few seconds - the headset is now recognized in xrandr
(re-starting SteamVR still yields the same error as before)
4. Reboot PC
5. VR Headset is immediately recognized in xrandr without any replugging
6. SteamVR starts up just fine and I can play VR games.



OBSERVED RESULT
If I did not re-plug the VR headset on the previous boot it is not recognized on the current boot and even after replugging it it can't be leased until I reboot.

EXPECTED RESULT
I would expect the VR headset to connect to SteamVR every time and be "lease-able" after every boot or at least after re-plugging the headset (without having to reboot).

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.1
Kernel Version: 6.9.3-2-cachyos-lto (64-bit) (issue also reproducible on regular arch kernel and zen-kernel)
Graphics Platform: Wayland
Processors: 24 × 13th Gen Intel® Core™ i7-13700K
Memory: 62.5 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 3090 Ti/PCIe/SSE2

ADDITIONAL INFORMATION
In the attached Journal this message shows up:
Jun 02 10:24:45 linuxjoni04 kwin_wayland[1295]: kwin_wayland_drm: Can't lease connector: No suitable crtc available
What does "crtc" or this entire message mean?
Comment 1 Jonathan 2024-06-02 21:19:41 UTC
Created attachment 170071 [details]
SteamVR vrcompositor logfile showing failed lease attempt of VR headset display
Comment 2 Jonathan 2024-06-02 21:20:41 UTC
Created attachment 170073 [details]
successfull vrcompositor logfile after rebooting after having re-plugged the headset during last boot
Comment 3 Jonathan 2024-06-02 21:21:39 UTC
Created attachment 170074 [details]
xrandr output compared before and after re-plugging power of the headset on initial boot
Comment 4 Jonathan 2024-06-02 21:22:31 UTC
Created attachment 170075 [details]
xrandr after rebooting and having re-plugged power to the headset during last boot
Comment 5 Zamundaaa 2024-06-03 01:23:28 UTC
Please attach the output of drm_info when leasing doesn't work, and when it would work
Comment 6 Jonathan 2024-06-03 10:57:04 UTC
Created attachment 170084 [details]
drm_info saved before SteamVR is confirmed working
Comment 7 Jonathan 2024-06-03 10:58:05 UTC
Created attachment 170085 [details]
drm_info saved before SteamVR is confirmed NOT working
Comment 8 Zamundaaa 2024-06-03 17:37:05 UTC
The first problem, it not being detected by SteamVR at all, seems to be a hardware or driver issue. It reports
> 640x480@59.94 nhsync nvsync 
as the only supported mode on the headset and it claims that it's a normal display:
> "non-desktop" (immutable): range [0, 1] = 0
I've had that happen before on AMD as well, where it would fail to read the EDID with the correct information, so it might be a problem with the headset in general. It only happened very rarely though, and went away at some point, so it could be worth making a bug report to NVidia about it anyways.

For the second problem, could you also attach the output for after you power cycle it in the state where it isn't detected as a VR headset? The output of
> journalctl --user-unit plasma-kwin_wayland --boot 0
afterwards could also be helpful

Because I just now saw it:
> What does "crtc" or this entire message mean?
A CRTC generates an image that can be shown on a display (or the same one on multiple displays, in mirroring mode). The message means that KWin couldn't find a free one for the headset display to turn it on
Comment 9 Jonathan 2024-06-03 18:07:26 UTC
Created attachment 170105 [details]
drm_info after re-plugging headset but not rebooting the PC => SteamVR fails to find it
Comment 10 Jonathan 2024-06-03 18:11:13 UTC
Created attachment 170106 [details]
journalctl --user-unit plasma-kwin_wayland --boot 0   => after re-plugging headset but not rebooting the PC
Comment 11 Jonathan 2024-06-03 18:15:03 UTC
I haven't started SteamVR before getting this journalctl output - is that ok or should I get it after trying SteamVR?

Thank you for your assistance!
Comment 12 Zamundaaa 2024-06-03 18:43:20 UTC
That's okay. I think I see what the issue is, shouldn't be hard to fix
Comment 13 Bug Janitor Service 2024-06-03 19:15:19 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5823
Comment 14 Zamundaaa 2024-06-05 13:20:05 UTC
Git commit a16765721499be729a07c8a9844b99a247eb67dc by Xaver Hugl.
Committed on 05/06/2024 at 13:12.
Pushed by zamundaaa into branch 'master'.

backends/drm: enable pipelines for VR headsets

Otherwise, the pipeline state from an earlier hotplug scenario can leave
the pipeline disabled and without a CRTC, which means leasing the output
will fail
FIXED-IN: 6.1.0

M  +2    -0    src/backends/drm/drm_gpu.cpp

https://invent.kde.org/plasma/kwin/-/commit/a16765721499be729a07c8a9844b99a247eb67dc
Comment 15 Zamundaaa 2024-06-05 13:31:12 UTC
Git commit 2334f4eaafe8c8a2e8fdf1cefbdc19dd0b62a030 by Xaver Hugl.
Committed on 05/06/2024 at 13:22.
Pushed by zamundaaa into branch 'Plasma/6.1'.

backends/drm: enable pipelines for VR headsets

Otherwise, the pipeline state from an earlier hotplug scenario can leave
the pipeline disabled and without a CRTC, which means leasing the output
will fail
FIXED-IN: 6.1.0
(cherry picked from commit a16765721499be729a07c8a9844b99a247eb67dc)

M  +2    -0    src/backends/drm/drm_gpu.cpp

https://invent.kde.org/plasma/kwin/-/commit/2334f4eaafe8c8a2e8fdf1cefbdc19dd0b62a030
Comment 16 Jonathan 2024-06-26 17:35:12 UTC
It's a lot better now, thank you very much for your quick fix!!

I still sometimes get the weird state where I can't use the headset just like before:
│   │   │   └───640x480@59.94 nhsync nvsync 
and
│   │       ├───"non-desktop" (immutable): range [0, 1] = 0
but after power cycling the headset it now works immediately, without needing to reboot.
And it also feels like it works more often right on boot, although I think it might be related with removing power from the headset overnight or similar.
If I understood correctly I should open a report for this remaining issue on Nvidia's side?

I'm now on:
KDE Plasma Version: 6.1.0
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.2
Kernel Version: 6.9.6-3-cachyos-lto (64-bit)
Comment 17 Zamundaaa 2024-07-10 17:32:47 UTC
> If I understood correctly I should open a report for this remaining issue on Nvidia's side?
Yes