<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Tailscale on 一页笔记</title><link>https://blog.qion7.tech/tags/tailscale/</link><description>Recent content in Tailscale on 一页笔记</description><generator>Hugo</generator><language>zh-Hans-CN</language><lastBuildDate>Tue, 01 Dec 2026 20:00:00 +0800</lastBuildDate><atom:link href="https://blog.qion7.tech/tags/tailscale/index.xml" rel="self" type="application/rss+xml"/><item><title>Windows 虚拟屏游戏串流指南：按会话自动切屏、异形屏适配与外网直连</title><link>https://blog.qion7.tech/posts/sunshine-vdd-tailscale-streaming/</link><pubDate>Tue, 01 Dec 2026 20:00:00 +0800</pubDate><guid>https://blog.qion7.tech/posts/sunshine-vdd-tailscale-streaming/</guid><description>用 Sunshine / 星核配合虚拟显示器（VDD）串流时，别再常驻扩展屏把任务栏弄乱了。分享原生按会话切屏、手机超宽屏自定义分辨率、修复 Switch 0Hz 报错与多场景码率参数。</description><content:encoded><![CDATA[<p>用 Sunshine（或社区增强版星核 StarCore）搭配 Moonlight 把家里的高性能 Windows 电脑串流到手机、平板或掌机上玩，最让人头疼的往往不是画质，而是<strong>显示器管理</strong>。</p>
<p>以前常见的野路子是装一个虚拟显示器（Virtual Display Driver, VDD），然后把它长期设为“扩展屏”甚至主屏。结果平时在电脑前办公时，鼠标经常莫名其妙飘到看不见的副屏里，窗口和任务栏也经常错位，体验非常割裂。</p>
<h2 id="正确姿势空闲零存在感连接才切换">正确姿势：空闲零存在感，连接才切换</h2>
<p>新版本 Sunshine 原生内置了非常成熟的显示设备管理能力，完全不需要额外叠第三方切屏脚本或常驻扩展屏：</p>
<div class="article-cards">
  <section class="article-card">
    <h3>旧做法：常驻双屏扩展</h3>
    <p>平时电脑桌面上挂着一块看不见的虚拟屏，窗口乱飘、任务栏错乱，退出串流后分辨率也经常收不回来。</p>
  </section>
  <section class="article-card">
    <h3>推荐做法：原生按会话切换</h3>
    <p>开启 <code>ensure_only_display</code> 与 <code>dd_config_revert_on_disconnect=enabled</code>。平时只亮物理屏；Moonlight 连上瞬间熄灭物理屏并独占虚拟屏；断连后自动恢复物理屏原生刷新率。</p>
  </section>
</div>
<div class="article-callout">
  <div class="article-callout-title">设备 ID 选型避坑</div>
  <p>在 <code>sunshine.conf</code> 里填写虚拟屏的 <code>output_name</code> 时，务必直接取自 Sunshine 启动日志（<code>Currently available display devices</code>）中实时识别的 <code>device_id</code>，不要硬抄旧的 <code>\\.\DISPLAY2</code> 编号，因为拔插显示器后编号会漂移。</p>
</div>
<h2 id="实测跑通的三个高价值细节">实测跑通的三个高价值细节</h2>
<ol class="article-steps">
  <li>
    <span class="article-step-num">1</span>
    <div>
      <strong>适配手机超宽屏：把精确比例写进 VDD 模式表</strong>
      很多全面屏手机接近 2:1 或 20:9，直接串流 16:9 左右黑边很宽。在 <code>vdd_settings.xml</code> 里补充贴合手机屏幕的分辨率（例如 <code>2560×1280</code>，记得先备份原 XML），再用管理员执行 <code>pnputil /restart-device ROOT\DISPLAY\0001</code> 重载驱动，手机端就能上下铺满、画质锐利。
    </div>
  </li>
  <li>
    <span class="article-step-num">2</span>
    <div>
      <strong>解决部分掌机客户端传 0Hz 导致的切屏失败</strong>
      某些非官方或掌机端 Moonlight（例如 Switch 版）连接时会向主机上报 <code>0Hz</code>，如果主机刷新率设成 <code>auto</code>，会直接触发 Windows 显示参数错误导致黑屏。把刷新率固定为 <code>60Hz</code>，并在 VDD 模式表里补全 <code>1280×720</code>（或用 <code>dd_mode_remapping</code> 将 720p 映射为 1080p 捕获），即可彻底解决。
    </div>
  </li>
  <li>
    <span class="article-step-num">3</span>
    <div>
      <strong>外网串流：Tailscale 组网 + 手机蜂窝实测</strong>
      宿主机与手机装好 Tailscale（Windows 代理工具里记得给 Tailscale 进程和网段放行直连），出门切到 5G 蜂窝网络，直接填电脑的 Tailscale IPv4 就能连回家里桌面。如果 NAT 穿透困难，配一台国内中转节点做 Peer Relay 也能稳定跑到 1080p / 60 FPS。
    </div>
  </li>
</ol>
<h2 id="不同网络与设备的推荐参数">不同网络与设备的推荐参数</h2>
<div class="article-table-wrap">
<table>
	<thead>
			<tr>
					<th>使用场景</th>
					<th>分辨率</th>
					<th>帧率</th>
					<th>码率建议</th>
					<th>备注</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>家用 Wi-Fi + 手机</td>
					<td><code>2560×1280</code></td>
					<td>60 FPS</td>
					<td>30 Mbps</td>
					<td>贴合手机比例，开启填充刘海但不拉伸，桌面缩放可调至 150%</td>
			</tr>
			<tr>
					<td>5G 蜂窝外网 + 手机</td>
					<td><code>1920×1080</code></td>
					<td>60 FPS</td>
					<td>15 Mbps</td>
					<td>经 Tailscale 组网，兼顾清晰度与移动网络抖动</td>
			</tr>
			<tr>
					<td>掌机客户端（如 Switch）</td>
					<td><code>1280×720</code></td>
					<td>60 FPS</td>
					<td>10 Mbps (HEVC)</td>
					<td>主机固定 60Hz 防 0Hz 参数报错</td>
			</tr>
	</tbody>
</table>
</div>
<details class="article-details">
  <summary>展开：从原版 Sunshine 迁移增强版 &amp; 异常黑屏自救提示</summary>
  <p>
    <strong>迁移避坑：</strong>如果要从原版 Sunshine 换到兼容增强版（如 StarCore），先把 <code>sunshine.conf</code>、<code>apps.json</code>、<code>sunshine_state.json</code> 和 <code>credentials/</code> 完整备份就能无损保留主机身份和已配对设备。注意卸载原版 MSI 时会顺手删掉共享服务名 <code>SunshineService</code> 和同名防火墙规则，卸载前先改名保护规则，装完新版本后重建服务指向新路径即可。<br><br>
    <strong>异常自救：</strong>如果某次测试新分辨率导致断开串流后物理屏幕没有自动亮起，人就在电脑前时直接按 <code>Win + P</code> 切回“仅电脑屏幕”，再去翻 <code>sunshine.log</code> 里的 <code>Desktop resolution</code> 与 <code>Capture size</code> 日志，不要盲目反复重连。
  </p>
</details>
]]></content:encoded></item></channel></rss>