-
-
Notifications
You must be signed in to change notification settings - Fork 973
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
Sunshine Reads Incorrect Monitor Index #221
Comments
What is the output of And please paste your config file as well. |
Hey, thanks for the reply! I will include that info for you now. I took some logs as well (one left at default which picks the wrong monitor and one with the "wrong" monitor index selected, 3, outputting to the correct monitor). xrandr output xrandr --listmonitors
Monitors: 4
0: +*XWAYLAND0 2560/700x1440/400+2560+1080 XWAYLAND0
1: +XWAYLAND1 2560/600x1440/340+0+1080 XWAYLAND1
2: +XWAYLAND2 2560/600x1440/340+5120+1080 XWAYLAND2
3: +XWAYLAND3 1920/600x1080/340+640+0 XWAYLAND3 Config file cat /usr/local/sunshine/config/sunshine.conf
sunshine_name = EmpokNor
nv_preset = default
amd_coder = auto
upnp = disabled
gamepad = x360
qp = 22
nv_rc = auto
hevc_mode = 0
dwmflush = enabled
min_log_level = 2
amd_quality = default
origin_web_ui_allowed = lan
vt_software = auto
vt_realtime = enabled
key_rightalt_to_key_win = disabled
origin_pin_allowed = pc
resolutions = [
352x240,
480x360,
858x480,
1280x720,
1920x1080,
2560x1080,
3440x1440,
1920x1200,
3860x2160,
3840x1600,
2560x1440
]
nv_coder = auto
fps = [10,30,60,90,120]
vt_coder = auto
amd_rc = auto
output_name = 3 |
|
Yeah, that is what it's supposed to do, I agree. But when I set output to 3, it selects 0 and streams that screen. Conversely, if I select monitor 0 (or leave the field in the web UI blank not specifying a monitor) Sunshine streams monitor 3, the HDMI connected 1080p monitor. |
Can confirm the issue on an Arch host, I have 2 monitors and Sunshine is swapping their indexes.
By default (index 0), Sunshine streams the HDMI monitor. |
This issue is stale because it has been open for 90 days with no activity. Comment or remove the stale label, otherwise this will be closed in 10 days. |
This issue was closed because it has been stalled for 10 days with no activity. |
Can confirm that there is something off:
Choosing 0 results in streaming 1, 1 results in monitor 2 and specifying 2 streams monitor 0. |
I have exactly the same issue with 2 monitors. Selecting monitor 0 in Sunshine actually streams monitor 1 and vice versa.
xrandr reports monitor order as seen by X11, while Sunshine uses KMS instead of X11. Is it possible that KMS and X11 use different monitor order? |
It would be nice if the ID was used instead of a number. With a dummy + a desktop monitor that can be on or off, the output number can change. |
Agree. Using some unique ID would be better than monitor index. Unfortunately port names like https://unix.stackexchange.com/questions/584088/how-can-i-get-stable-video-output-names Probably the best way would be to use monitor identifiers (serial numbers) from EDID. For instance, they are displayed in KDE Plasma settings. On my system they are:
|
Do you know if there is any workaround for now? If I can be of any help, I'm here with the same bug
|
Same issue, arch linux host |
I don't think you can guarantee that monitors detected by all capture methods use the index as reported by xrandr --list-monitors. This is just the x11 order. |
Also, xrandr --list-monitors only gives you connected monitors but since #1071 the index covers all ports not just connected |
I encountered this as well. The order change coincided with switching from X11/VAAPI to NVFBC/NVENC. The nvidia based setup's order is inconsistent with xrandr. I've been having fun battling my streaming setup. My goal is a virtual KVM setup for my work laptop, where it's just a window on my personal workstation. Originally my laptop was set to "discrete graphics" in the BIOS, and sunshine would only do X11 with software encoding despite running the NVIDIA driver. I switched to "hybrid graphics", and then sunshine would do KMS/NVENC on the built-in display. I wanted higher resolution, though, so I got an HDMI EDID dummy plug and attached it to a dock. Sunshine would then only do X11/VAAPI on the external dummy display. Today I just found a driver patch to enable NVFBC, and now NVFBC/NVENC is working on my dummy external display. As painful as it was to get working, the NVENC experience is buttery smooth with no CPU load. |
this issue remains. I have monitors in the following configuration: and sunshine reports that they are numbered like this:
but this doesn't match the numbers I need to use in the sunshine config at all – there, the mapping is:
and
I'm using NixOS 24.05.20240121.612f972 (Uakari) with X11. |
@sersorrel The monitor numbers come from different capture subsystems (X11 vs Wayland vs NvFBC vs KMS). The intent is for them to be the same but it is not always possible. What capture method is being used on your system? |
KMS, I think. |
I have an issue where it only shows 2 monitors connected but there are 3. The numbers are swapped around, and selecting 0 and 2 give the wrong monitor when connected. (It says that 0 is disconnected in Sunshine GUI, see code below) And when I select monitor 1, 3, or 4, and connect from moonlight it displays all 3 displays in a zoomed out view. (See screenshot) Running Ubuntu 22.04 LTS.
|
I have a laptop with intel+nvidia with an extra monitor. Using Kubuntu 22.04.
In Shunsine GUI:
I can only see one screen, always the main one (that's the laptop panel) if I set the "Monitor number" field to empty or I was trying to cast the secondary screen only, but entering other value in the "Monitor number" field (1,2...) results in casting all displays in a zoomed out view, just like in @KnoBuddy comment. |
Regarding to my previous comment, I kept incrementing the index just for testing, and the second screen (only) was casted using index 4, which makes no sense to me. |
I am having the exact same issue.
According to Sunshine I need to stream monitor 7, but if I set it to 7 in configuration page Sunshine wouldn't start at all. |
Yeah I just started getting this too. I have two monitors, on 1 and 2, preferring 1. They both show as connected:true If I set it to 0 it will stream (but just a blank screen + audio) If I set it to anything other than monitor 0 I get an error that monitor wasn't detected. |
I'm having this exact same issue. I just want sunshine to use the 2nd display only but it shows them all in a zoomed out view. Have you found a workaround? Edit: Selecting monitor 0 enables my second (HDMI) display.. weird now I just gotta figure out how to match the resolution
|
Same issue here, i have two DP monitors but only one is detected. POP_OS 22.04 |
That text is only a (misleading) example. Check the log file for the actual output. (There is a PR to improve the text. It is indeed confusing.) |
It seems this issue hasn't had any activity in the past 90 days. If it's still something you'd like addressed, please let us know by leaving a comment. Otherwise, to help keep our backlog tidy, we'll be closing this issue in 10 days. Thanks! |
Still a problem. |
Describe the Bug
When running Sunshine, even though my primary display shows as index 0, if I leave the Monitor Number blank or input index number 0, Sunshine always picks my HDMI connected display, which is not my primary. I have to cycle through index numbers and restart the service until I find the correct monitor even though the index number for my primary DisplayPort connected display still shows as monitor 0 in xrandr.
Expected Behavior
Sunshine should select the monitor at index 0 by default.
Additional Context
I am running 4 connected displays, 1 HDMI and 3 DisplayPort. The index number for my primary display always shows index 0 even though Sunshine picks the HDMI display, which can be any index number from 1-3 in xrandr.
Sunshine Host Operating System and Version
Fedora 36 KDE Plasma
Architecture
x86_64
Sunshine Version
0.14.0
GPU Type
AMD
GPU Model
Radeon RX 6700XT
GPU Driver/Mesa Version
Mesa 23.0.0-git (using gloriousegroll copr repo)
Capture Method (Linux Only)
Not sure, whatever the default for a Fedora/Wayland install would be
The text was updated successfully, but these errors were encountered: