Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions docs/source/about/advanced_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,18 @@ output_name
.. Tip:: To find the name of the appropriate values follow these instructions.

**Linux**
.. code-block:: bash
During Sunshine startup, you should see the list of detected monitors:

xrandr --listmonitors
.. code-block:: text

Example output: ``0: +HDMI-1 1920/518x1200/324+0+0 HDMI-1``
Info: Detecting connected monitors
Info: Detected monitor 0: DVI-D-0, connected: false
Info: Detected monitor 1: HDMI-0, connected: true
Info: Detected monitor 2: DP-0, connected: true
Info: Detected monitor 3: DP-1, connected: false
Info: Detected monitor 4: DVI-D-1, connected: false

You need to use the value before the colon in the output, e.g. ``0``.
You need to use the value before the colon in the output, e.g. ``1``.

.. Todo:: macOS

Expand Down
7 changes: 4 additions & 3 deletions src/platform/linux/x11grab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ namespace platf {
int monitor = 0;
for (int x = 0; x < output; ++x) {
output_info_t out_info { x11::rr::GetOutputInfo(xdisplay.get(), screenr.get(), screenr->outputs[x]) };
if (out_info && out_info->connection == RR_Connected) {
if (out_info) {
if (monitor++ == streamedMonitor) {
result = std::move(out_info);
break;
Expand Down Expand Up @@ -761,7 +761,7 @@ namespace platf {
return {};
}

BOOST_LOG(info) << "Detecting connected monitors"sv;
BOOST_LOG(info) << "Detecting monitors"sv;

x11::xdisplay_t xdisplay { x11::OpenDisplay(nullptr) };
if (!xdisplay) {
Expand All @@ -775,7 +775,8 @@ namespace platf {
int monitor = 0;
for (int x = 0; x < output; ++x) {
output_info_t out_info { x11::rr::GetOutputInfo(xdisplay.get(), screenr.get(), screenr->outputs[x]) };
if (out_info && out_info->connection == RR_Connected) {
if (out_info) {
BOOST_LOG(info) << "Detected monitor "sv << monitor << ": "sv << out_info->name << ", connected: "sv << (out_info->connection == RR_Connected);
++monitor;
}
}
Expand Down
14 changes: 11 additions & 3 deletions src_assets/common/assets/web/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -560,9 +560,17 @@ <h1 class="my-4">Configuration</h1>
v-model="config.output_name"
/>
<div class="form-text">
xrandr --listmonitors<br />
Example output:
<pre> 0: +HDMI-1 1920/518x1200/324+0+0 HDMI-1</pre>
During Sunshine startup, you should see the list of detected monitors, e.g.:<br />
<br />
<pre style="white-space: pre-line;">
Info: Detecting connected monitors
Info: Detected monitor 0: DVI-D-0, connected: false
Info: Detected monitor 1: HDMI-0, connected: true
Info: Detected monitor 2: DP-0, connected: true
Info: Detected monitor 3: DP-1, connected: false
Info: Detected monitor 4: DVI-D-1, connected: false
</pre>
You need to use the value before the colon in the output, e.g. <b>1</b>.
</div>
</div>
</div>
Expand Down