<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: GRESON PARICHHA</title>
    <description>The latest articles on DEV Community by GRESON PARICHHA (@greson_parichha_de21491a1).</description>
    <link>https://dev.to/greson_parichha_de21491a1</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4272164%2F7ed33b42-ced1-4512-961e-4de30f7171c1.jpg</url>
      <title>DEV Community: GRESON PARICHHA</title>
      <link>https://dev.to/greson_parichha_de21491a1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/greson_parichha_de21491a1"/>
    <language>en</language>
    <item>
      <title>How I Built a Zero-App Local Wi-Fi PC Trackpad &amp; 120 FPS Screen Mirror in Python</title>
      <dc:creator>GRESON PARICHHA</dc:creator>
      <pubDate>Sun, 29 Nov 2026 11:22:04 +0000</pubDate>
      <link>https://dev.to/greson_parichha_de21491a1/how-i-built-a-zero-app-local-wi-fi-pc-trackpad-120-fps-screen-mirror-in-python-27p1</link>
      <guid>https://dev.to/greson_parichha_de21491a1/how-i-built-a-zero-app-local-wi-fi-pc-trackpad-120-fps-screen-mirror-in-python-27p1</guid>
      <description>&lt;p&gt;Most remote mouse and screen-mirror tools make a surprisingly simple task painful: they ask you to install a bloated mobile companion app, sit through banner ads, sign into a cloud relay account, or tolerate choppy VNC polling over your own home Wi-Fi.&lt;/p&gt;

&lt;p&gt;While building &lt;a href="https://getpcdeck.com/" rel="noopener noreferrer"&gt;PCDeck&lt;/a&gt;, I wanted the opposite workflow: launch one lightweight desktop host on Windows or Linux, scan a QR code from Safari or Chrome on any phone or tablet, and immediately get a zero-app trackpad, keyboard, 60/120 FPS screen mirror, audio stream, and camera bridge over local LAN.&lt;/p&gt;

&lt;p&gt;Here is a breakdown of the architecture and the five engineering tricks that keep latency sub-frame over ordinary Wi-Fi.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Browser-First QR Pairing Over Local Wi-Fi
&lt;/h2&gt;

&lt;p&gt;Instead of shipping separate iOS and Android binaries, PCDeck runs a local Python server powered by &lt;strong&gt;FastAPI&lt;/strong&gt; and &lt;strong&gt;Uvicorn&lt;/strong&gt; right on your PC. Scanning the LAN QR code opens a mobile-tuned web client directly in the phone's browser—no App Store download, no cloud account, and no external relay server touching your input or pixels.&lt;/p&gt;

&lt;p&gt;Once connected, dedicated WebSocket channels isolate traffic by latency profile:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;/ws&lt;/code&gt; for pointer deltas, multi-touch gestures, keyboard events, and media shortcuts&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/ws/screen&lt;/code&gt; for paced screen frames and resolution/FPS feedback&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/ws/audio&lt;/code&gt; for low-latency PCM audio streaming&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/ws/cam&lt;/code&gt; for using a mobile camera as a &lt;a href="https://getpcdeck.com/use-iphone-as-webcam-windows/" rel="noopener noreferrer"&gt;phone webcam for Windows&lt;/a&gt; with zero watermarks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because the UI is pure HTML5/Canvas/WebSockets, the exact same host also works as a &lt;a href="https://getpcdeck.com/browser-pc-remote/" rel="noopener noreferrer"&gt;browser PC remote&lt;/a&gt; from another laptop or tablet on the same network.&lt;/p&gt;

&lt;h2&gt;
  
  
  5 Engineering Tricks for Sub-Frame Latency
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Fast Win32 GDI Capture + Stride-Based Dirty-Frame Skipping
&lt;/h3&gt;

&lt;p&gt;High-level Python screenshot wrappers allocate too many intermediate objects for 60–120 FPS streaming. On Windows, PCDeck captures directly via Win32 GDI &lt;code&gt;BitBlt&lt;/code&gt; (with &lt;code&gt;CAPTUREBLT&lt;/code&gt; so layered windows and cursors are preserved) and &lt;code&gt;GetDIBits&lt;/code&gt;, keeping raw capture overhead around &lt;strong&gt;~1.4 ms&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Before touching an encoder, we inspect a strided NumPy slice of the frame buffer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;sample&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;raw_np&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Comparing this sub-sampled plane against the previous frame catches static desktops in microseconds. When nothing on screen changes, encoding and network transmission are skipped completely, dropping idle CPU usage below &lt;strong&gt;0.5%&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Adaptive Dual-Chroma JPEG Encoding
&lt;/h3&gt;

&lt;p&gt;Text editors, terminals, and IDE windows look blurry under standard &lt;code&gt;4:2:0&lt;/code&gt; chroma subsampling, especially on colored syntax highlighting. At the same time, &lt;code&gt;4:4:4&lt;/code&gt; encoding wastes bandwidth during fast video playback or window dragging.&lt;/p&gt;

&lt;p&gt;PCDeck dynamically switches chroma subsampling per frame based on the current adaptive quality target:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Quality &amp;gt;= 88&lt;/strong&gt;: &lt;code&gt;4:4:4&lt;/code&gt; chroma subsampling for razor-sharp code and UI text&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fast motion / lower quality&lt;/strong&gt;: &lt;code&gt;4:2:0&lt;/code&gt; chroma subsampling for smaller payloads and sustained frame rates&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Client-Paced In-Flight ACK (Queue Depth = 1)
&lt;/h3&gt;

&lt;p&gt;Pushing frames from the server as fast as a loop can encode them is the fastest way to cause Wi-Fi bufferbloat: TCP queues build up, and suddenly your trackpad or screen mirror lags half a second behind reality.&lt;/p&gt;

&lt;p&gt;PCDeck enforces strict client pacing. The browser sends a tiny &lt;code&gt;a&lt;/code&gt; (ACK) message over &lt;code&gt;/ws/screen&lt;/code&gt; as soon as a frame finishes decoding/rendering, keeping the server's in-flight queue depth capped at &lt;strong&gt;1 frame&lt;/strong&gt;. If Wi-Fi momentarily slows down, old frames are dropped at the source instead of piling up in socket buffers.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. WebAudio AudioWorklet Phase-Locked Loop (PLL)
&lt;/h3&gt;

&lt;p&gt;Streaming Windows loopback audio to a mobile browser without crackles or drift requires handling clock skew between the PC sound card and the phone's DAC.&lt;/p&gt;

&lt;p&gt;Instead of naive &lt;code&gt;AudioBufferSourceNode&lt;/code&gt; scheduling, PCDeck streams PCM chunks into a custom WebAudio &lt;code&gt;AudioWorklet&lt;/code&gt; ring buffer governed by a gentle Phase-Locked Loop:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;TARGET_BUFFER_MS = 100&lt;/code&gt; keeps latency tight while absorbing Wi-Fi jitter&lt;/li&gt;
&lt;li&gt;Above &lt;code&gt;135 ms&lt;/code&gt; buffer fill, playback rate gently nudges up to &lt;code&gt;1.012x&lt;/code&gt; to drain excess latency smoothly without audible pitch pops or glitches&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. Sub-Tick Win32 SendInput Scrolling &amp;amp; Kinetic Momentum
&lt;/h3&gt;

&lt;p&gt;Standard Windows mouse wheels fire coarse &lt;code&gt;WHEEL_DELTA = 120&lt;/code&gt; notches, which makes phone trackpad scrolling feel jerky. PCDeck feeds fractional wheel increments directly into Win32 &lt;code&gt;SendInput&lt;/code&gt; using &lt;code&gt;SMOOTH_WHEEL_STEP = 24&lt;/code&gt; (1/5th of a legacy notch), paired with client-side kinetic touch momentum so two-finger trackpad flicks feel native.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try It Out
&lt;/h2&gt;

&lt;p&gt;PCDeck's core local trackpad, keyboard, media remote, browser file transfer, and standard screen/webcam tools are free, with an optional &lt;strong&gt;$3.99 one-time Pro upgrade&lt;/strong&gt; unlocking 60/120 FPS mirroring and custom HUD layouts.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Official Website&lt;/strong&gt;: &lt;a href="https://getpcdeck.com/" rel="noopener noreferrer"&gt;https://getpcdeck.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Windows (Microsoft Store)&lt;/strong&gt;: &lt;a href="https://apps.microsoft.com/detail/9P4BK16LBGLS" rel="noopener noreferrer"&gt;https://apps.microsoft.com/detail/9P4BK16LBGLS&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Source &amp;amp; Releases (GitHub)&lt;/strong&gt;: &lt;a href="https://github.com/greson719/pcdeck" rel="noopener noreferrer"&gt;https://github.com/greson719/pcdeck&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>windows</category>
      <category>webdev</category>
      <category>python</category>
      <category>linux</category>
    </item>
  </channel>
</rss>
