### Install moreland with ./install.sh Source: https://github.com/adiimanav/moreland/blob/master/docs/05-daemon.md Runs the installer script. It requires no root and writes only to $HOME, placing the binary at ~/.local/bin/moreland and a systemd user unit at ~/.config/systemd/user/moreland.service. The installer does not build the APK; it checks whether the app is installed and prints the commands if not. ```bash ./install.sh ``` -------------------------------- ### Clone and install moreland Source: https://github.com/adiimanav/moreland/blob/master/README.md Clones the repository and runs the install script, which installs the binary to ~/.local/bin and a systemd user unit. No root required. ```bash git clone https://github.com/adiimanav/moreland.git moreland && cd moreland ./install.sh ``` -------------------------------- ### Start moreland service and follow logs Source: https://github.com/adiimanav/moreland/blob/master/docs/05-daemon.md Enables and starts the user service immediately, then follows its logs. The unit is PartOf=graphical-session.target, so it starts and stops with the session. It requires a running compositor because hyprctl must find the instance and the daemon connects to Wayland as a capture client. ```bash systemctl --user enable --now moreland.service journalctl --user -u moreland -f ``` -------------------------------- ### Install and Enable Service Source: https://github.com/adiimanav/moreland/blob/master/docs/README.md Commands to install the Moreland software and enable the user-level systemd service. ```bash ./install.sh systemctl --user enable --now moreland.service ``` -------------------------------- ### Install system prerequisites Source: https://github.com/adiimanav/moreland/blob/master/docs/00-system-survey.md Installs essential packages including Vulkan drivers, Android udev rules for ADB access, and Wayland utilities. ```bash sudo pacman -S --needed vulkan-radeon android-udev wayland-utils ``` -------------------------------- ### Build and Install Android App Source: https://github.com/adiimanav/moreland/blob/master/docs/README.md Commands to build the Android decoder application using Gradle and install it via ADB. ```bash cd android && ANDROID_HOME=/opt/android-sdk ./gradlew assembleRelease adb install -r app/build/outputs/apk/release/app-release.apk ``` -------------------------------- ### Automatic Resolution Scaling Examples Source: https://github.com/adiimanav/moreland/blob/master/README.md Examples of how Moreland automatically scales tablet panel sizes to match the default width cap. ```text 2880x1800 (16:10) -> 1920x1200 2560x1440 (16:9) -> 1920x1080 1280x800 -> 1280x800 (already below the cap) ``` -------------------------------- ### Install host dependencies on Arch/EndeavourOS Source: https://github.com/adiimanav/moreland/blob/master/README.md Installs required packages for the host: Rust, GStreamer with VA-API plugin, libva, Android tools, and Wayland utilities. Use on Arch-based distributions. ```bash sudo pacman -S --needed rust gstreamer gst-plugins-base gst-plugins-good \ gst-plugin-va libva android-tools android-udev wayland-utils ``` -------------------------------- ### labwc: start with headless output and run moreland Source: https://github.com/adiimanav/moreland/blob/master/docs/COMPATIBILITY.md Commands to start labwc with a headless output, list it with wlr-randr, and run moreland with the required --output-name flag. The output persists and is not managed by the daemon. ```bash WLR_HEADLESS_OUTPUTS=1 labwc # or set it in your session/login script wlr-randr # lists it, usually as HEADLESS-1 moreland --output-name HEADLESS-1 ``` -------------------------------- ### Run Moreland end to end Source: https://github.com/adiimanav/moreland/blob/master/docs/04-android-app.md Runs the moreland binary for 20 seconds. It creates the virtual output, installs the adb forward, launches the app, then captures, encodes, streams, and reports round-trip statistics. The virtual output is an RAII guard and is removed on exit unless --keep-output is passed. ```bash ./target/release/moreland --seconds 20 ``` -------------------------------- ### Verify package installation via ADB Source: https://github.com/adiimanav/moreland/blob/master/docs/04-android-app.md Checks whether the com.moreland.display package is installed on the device. ```bash adb shell pm list packages com.moreland.display ``` -------------------------------- ### Install dependencies for Arch, Fedora, and Debian/Ubuntu Source: https://github.com/adiimanav/moreland/blob/master/docs/COMPATIBILITY.md Install the required dependencies for the moreland project on Arch-based, Fedora, and Debian/Ubuntu systems. The Arch line is verified; the Fedora and Debian/Ubuntu lines are best-effort and untested. For Debian/Ubuntu, ensure GStreamer is 1.22 or newer. ```bash # Arch / EndeavourOS / Manjaro — verified sudo pacman -S --needed rust gstreamer gst-plugins-base gst-plugins-good \ gst-plugin-va libva libva-utils android-tools \ android-udev wayland-utils ``` ```bash # Fedora — UNVERIFIED sudo dnf install rust cargo gstreamer1-plugins-base gstreamer1-plugins-good \ gstreamer1-plugins-bad-free libva libva-utils android-tools \ wayland-utils ``` ```bash # Debian / Ubuntu — UNVERIFIED, check GStreamer is 1.22+ sudo apt install rustc cargo gstreamer1.0-plugins-base \ gstreamer1.0-plugins-good gstreamer1.0-plugins-bad \ libva2 vainfo adb wayland-utils ``` -------------------------------- ### Run moreland and manage service Source: https://github.com/adiimanav/moreland/blob/master/README.md Starts moreland in the foreground, enables the systemd user service to run at login, and tails the logs. ```bash moreland # foreground systemctl --user enable --now moreland.service # on login journalctl --user -u moreland -f # logs ``` -------------------------------- ### Wayland Debug Output for stream_virtual_output_with_description Source: https://github.com/adiimanav/moreland/blob/master/docs/06-plasma-backend.md Example of WAYLAND_DEBUG=1 output showing a well-formed request and the subsequent failure response from the compositor. ```text -> zkde_screencast_unstable_v1@3.stream_virtual_output_with_description( stream@5, "moreland", "Moreland tablet monitor", 1920, 1200, 1.0000, 2) <- zkde_screencast_stream_unstable_v1@5.failed, ("Could not find output") ``` -------------------------------- ### Check for capture protocol support on KWin Source: https://github.com/adiimanav/moreland/blob/master/docs/COMPATIBILITY.md Commands to verify whether KWin implements the ext-image-copy-capture-v1 protocol. The first command searches for the protocol globals in wayland-info output, and the second searches for the interface name in installed binaries. Both return empty output, indicating the protocol is not implemented. ```console $ wayland-info | grep -E 'image_copy_capture|image_capture_source' $ grep -rl ext_image_copy_capture_manager_v1 /usr/lib/ /usr/bin/ $ ``` -------------------------------- ### Sideload APK on MIUI/HyperOS Source: https://github.com/adiimanav/moreland/blob/master/README.md Pushes the APK to the tablet's Download folder to bypass MIUI's ADB install restriction. Then install manually from the Files app. ```bash adb push app/build/outputs/apk/release/app-release.apk /sdcard/Download/ ``` -------------------------------- ### ADB install failure error message Source: https://github.com/adiimanav/moreland/blob/master/docs/04-android-app.md The exact error message when adb install fails on a MIUI/HyperOS tablet due to user restriction. ```text INSTALL_FAILED_USER_RESTRICTED: Install canceled by user ``` -------------------------------- ### Daemon source file layout Source: https://github.com/adiimanav/moreland/blob/master/docs/05-daemon.md File layout of the daemon crate and related files. The daemon loop, CLI, and signal handling live in main.rs; tracker.rs is the ADB host:track-devices client; session.rs manages one streaming session with RAII scoping; output.rs provides a virtual output guard per compositor. Also includes usage.txt, the systemd unit, and the installer script. ```text crates/daemon/ src/main.rs daemon loop, CLI, signal handling src/tracker.rs ADB host:track-devices client src/session.rs one streaming session, RAII-scoped src/output.rs virtual output guard, per-compositor src/usage.txt systemd/moreland.service install.sh ``` -------------------------------- ### Uninstall Android application Source: https://github.com/adiimanav/moreland/blob/master/docs/REVERT.md Remove the sideloaded Android application and the installer APK file from the device. ```bash adb uninstall com.moreland.display adb shell rm -f /sdcard/Download/moreland.apk ``` -------------------------------- ### ADB track-devices protocol exchange Source: https://github.com/adiimanav/moreland/blob/master/docs/05-daemon.md Shows the ADB protocol exchange for tracking device state changes. The daemon sends a host:track-devices request with a 4-digit hex length prefix, receives OKAY, and then gets repeated device list updates with a 4-digit hex length prefix. ```text -> 0012host:track-devices <- OKAY <- 0016ABCD1234device (repeated on every change) ``` -------------------------------- ### Verify Plasma backend prerequisites and protocol Source: https://github.com/adiimanav/moreland/blob/master/docs/06-plasma-backend.md Run these commands to check for the KDE backend grant, update the desktop entry cache, and verify the availability of the zkde_screencast protocol. ```bash scripts/moreland-doctor.sh # reports the grant under "KDE backend prerequisites" kbuildsycoca6 --noincremental # after any change to the desktop entry wayland-info | grep zkde_screencast # empty for an undeclared client; that is the gate working ``` -------------------------------- ### Build the Android app with Gradle wrapper Source: https://github.com/adiimanav/moreland/blob/master/docs/04-android-app.md Builds the release APK using the pinned Gradle wrapper. Requires ANDROID_HOME set to /opt/android-sdk. Output is app/build/outputs/apk/release/app-release.apk (~2 MB). ```bash cd android ANDROID_HOME=/opt/android-sdk ./gradlew assembleRelease # -> app/build/outputs/apk/release/app-release.apk (~2 MB) ``` -------------------------------- ### Create and configure a headless Hyprland output Source: https://github.com/adiimanav/moreland/blob/master/docs/01-capture.md Creates a headless output named 'moreland' and configures it with a 1920x1200@60 resolution at position 1920,0. The explicit name avoids unpredictable auto-generated names like HEADLESS-2. ```bash hyprctl output create headless moreland hyprctl keyword monitor "moreland,1920x1200@60,1920x0,1" ``` -------------------------------- ### moreland CLI usage options Source: https://github.com/adiimanav/moreland/blob/master/docs/05-daemon.md Command-line usage for the moreland daemon. Default behavior watches for the tablet and streams whenever it is plugged in. Options include --once for a single session, --seconds to stop after a duration and print latency statistics, --stats to print statistics on exit, --max-width to cap auto-detected width, --native to use full panel resolution, --width and --height (both required together) to pin an explicit size, and --bitrate to set the bitrate. ```text moreland watch for the tablet; stream whenever plugged in moreland --once stream one session, then exit moreland --seconds 15 stop after 15 s, print latency statistics moreland --stats print latency statistics on exit moreland --max-width 2400 cap the auto-detected width moreland --native stream the tablet's full panel resolution moreland --width 2400 --height 1500 pin an explicit size (both required) moreland --bitrate 30000 ``` -------------------------------- ### Wayland protocols verified with wayland-info Source: https://github.com/adiimanav/moreland/blob/master/docs/00-system-survey.md Output of wayland-info listing available Wayland protocols. Confirms ext_output_image_capture_source_manager_v1, ext_image_copy_capture_manager_v1, zwp_linux_dmabuf_v1, zwlr_virtual_pointer_manager_v1, zwp_virtual_keyboard_manager_v1, and zwlr_screencopy_manager_v1 (legacy fallback, unused). ```text ext_output_image_capture_source_manager_v1 v1 wl_output -> capture source ext_image_copy_capture_manager_v1 v1 frame copies, damage-aware zwp_linux_dmabuf_v1 v5 zero-copy buffers zwlr_virtual_pointer_manager_v1 v2 touch return path (no root) zwp_virtual_keyboard_manager_v1 v1 zwlr_screencopy_manager_v1 v3 legacy fallback, unused ``` -------------------------------- ### Run moreland-doctor.sh to check compatibility Source: https://github.com/adiimanav/moreland/blob/master/README.md Run this script to check your machine's compositor, capture protocol, VA-API encoder, and ADB link. It reports what blocks you. The distribution is not the deciding factor; the compositor is. ```bash ./scripts/moreland-doctor.sh ``` -------------------------------- ### Create virtual monitor stream with zkde_screencast_unstable_v1 Source: https://github.com/adiimanav/moreland/blob/master/docs/06-plasma-backend.md Shows how KRDP uses the Plasma screencast protocol to create a virtual output and obtain its PipeWire node ID in one call. The request is createVirtualMonitorStream on the Screencasting object, and the node ID is delivered via the created signal. ```cpp d->request = d->m_screencasting.createVirtualMonitorStream( vm->name, vm->size, vm->dpr, Screencasting::Metadata); connect(d->request, &ScreencastingStream::created, this, [this](uint nodeId) { setNodeId(nodeId); }); ``` -------------------------------- ### Benchmark and verify encode-probe commands Source: https://github.com/adiimanav/moreland/blob/master/docs/02-encode.md Commands to run the encode-probe benchmark with defaults, sweep a parameter (e.g., --rate-control vbr --target-usage 3), and capture a bitstream then verify it decodes with gst-launch-1.0 and ffprobe. ```bash # benchmark with defaults ./target/release/encode-probe moreland --frames 300 # sweep a parameter ./target/release/encode-probe moreland --rate-control vbr --target-usage 3 # capture a bitstream and check it decodes ./target/release/encode-probe moreland --frames 300 --out /tmp/out.h264 gst-launch-1.0 filesrc location=/tmp/out.h264 ! h264parse ! avdec_h264 ! fakesink ffprobe -show_entries stream=profile,width,height,has_b_frames /tmp/out.h264 ``` -------------------------------- ### Moreland CLI Usage and Options Source: https://github.com/adiimanav/moreland/blob/master/README.md Lists the available command-line arguments for controlling the Moreland streaming daemon, including resolution, bitrate, and output naming. ```text moreland watch for the tablet; stream whenever plugged in moreland --once stream one session, then exit moreland --seconds 15 stop after 15 s and print latency statistics --max-width cap the auto-detected width [default: 1920] --native stream at the tablet's full panel resolution --width --height pin an explicit resolution (both required) --fps virtual output refresh rate [default: 90] --bitrate H.264 target bitrate [default: 20000] --position x offset of the virtual output [default: 0] --position-y y offset of the virtual output [default: 1080] default sits below a primary at 0x0, no taller than 1080px; override either axis to fit your layout --output-name name of the virtual output [default: moreland] required on labwc, which cannot create one and must be pointed at an existing headless output --show-cursor composite the mouse cursor into the stream ``` -------------------------------- ### Verification and benchmark commands Source: https://github.com/adiimanav/moreland/blob/master/docs/01-capture.md Commands to enumerate outputs, benchmark zero-copy capture, and perform visual checks using the capture-probe utility. ```bash # enumerate outputs ./target/release/capture-probe # benchmark zero-copy capture ./target/release/capture-probe moreland --dmabuf --frames 180 # visual check (shm only — DMA-BUF pixels are never CPU-mapped) ./target/release/capture-probe moreland --shm --frames 30 --png /tmp/frame.png ``` -------------------------------- ### Architecture Overview Source: https://github.com/adiimanav/moreland/blob/master/docs/README.md A visual representation of the data flow from Hyprland to the Android device, highlighting the zero-copy DMA-BUF path and USB transport. ```text Hyprland ──hyprctl IPC──▶ virtual output "moreland" @ 1920x1200x60 │ ext_output_image_capture_source_manager_v1 + ext_image_copy_capture_manager_v1 (damage-driven) ▼ DMA-BUF on amdgpu/renderD129 ← zero copy │ vapostproc XR24 -> NV12 (in-GPU) ▼ vah264enc — VBR, no B-frames, target-usage 3 │ [u32 len][u64 pts][Annex-B] ▼ host 127.0.0.1:27183 ──adb forward──▶ localabstract:moreland │ USB 2.0 bulk ▼ Kotlin app: LocalServerSocket → MediaCodec async → SurfaceView ``` -------------------------------- ### Project code layout Source: https://github.com/adiimanav/moreland/blob/master/docs/04-android-app.md Directory tree showing the Android app and daemon source files, with notes on pinned Gradle version and file purposes. ```text android/ settings.gradle.kts build.gradle.kts gradle.properties gradle/wrapper/ pinned Gradle 8.11.1 app/build.gradle.kts app/src/main/AndroidManifest.xml app/src/main/res/values/styles.xml app/src/main/java/com/moreland/display/ Protocol.kt wire format, mirrors crates/protocol VideoStream.kt socket, MediaCodec, ack writer DisplayActivity.kt fullscreen surface host crates/daemon/ src/hyprland.rs virtual output RAII guard src/main.rs end-to-end orchestration and measurement ``` -------------------------------- ### Low-latency MediaFormat keys (standard and Qualcomm) Source: https://github.com/adiimanav/moreland/blob/master/docs/04-android-app.md Two attempts to enable low-latency decoding. The standard key is API 30+ and may be ignored because this device declares no low-latency feature; the Qualcomm vendor extension is the fallback and is ignored if unknown, so setting it costs nothing. ```kotlin format.setInteger(MediaFormat.KEY_LOW_LATENCY, 1) // API 30+ format.setInteger("vendor.qti-ext-dec-low-latency.enable", 1) // Qualcomm ``` -------------------------------- ### Run transport verification commands Source: https://github.com/adiimanav/moreland/blob/master/docs/03-transport.md Commands to run unit tests and benchmark the transport probe at production-rate pacing and maximum sustainable throughput. ```bash cargo test -p protocol # production-rate pacing, verified byte-exact against the device ./target/release/transport-probe --frames 600 # maximum sustainable throughput ./target/release/transport-probe --frames 1500 --flood ``` -------------------------------- ### Project file structure Source: https://github.com/adiimanav/moreland/blob/master/docs/01-capture.md Overview of the source code organization within the crates/capture directory. ```text crates/capture/ src/lib.rs required globals, VIRTUAL_OUTPUT_NAME src/discovery.rs global and output enumeration src/dmabuf.rs GBM allocation, dev_t -> render node resolution src/shm.rs memfd buffers (bring-up path) src/session.rs persistent capture session, both buffer modes src/bin/capture_probe.rs verification and benchmark harness ``` -------------------------------- ### Push APK to tablet via ADB Source: https://github.com/adiimanav/moreland/blob/master/docs/04-android-app.md Stages the release APK on the tablet's /sdcard/Download directory for sideloading. Requires the APK to be built first. ```bash adb push app/build/outputs/apk/release/app-release.apk /sdcard/Download/moreland.apk ``` -------------------------------- ### KWin virtual output creation failure in screencastmanager.cpp Source: https://github.com/adiimanav/moreland/blob/master/docs/06-plasma-backend.md This snippet shows the code in `src/plugins/screencast/screencastmanager.cpp` where `createVirtualOutput` is called, followed by a failed attempt to find the output. ```cpp auto output = kwinApp()->outputBackend()->createVirtualOutput(name, description, size, scale); streamOutput(stream, workspace()->findOutput(output), mode); // -> null ``` -------------------------------- ### Verify Plasma backend with plasma-probe and kscreen-doctor Source: https://github.com/adiimanav/moreland/blob/master/docs/06-plasma-backend.md Commands to verify the Plasma backend: plasma-probe shows the PipeWire node and object serial, while kscreen-doctor -o lists outputs including the virtual monitor. ```console $ plasma-probe name moreland pipewire node 85 object serial 1586 $ kscreen-doctor -o Output: 1 Virtual-moreland enabled Geometry: 1920,0 1920x1200 Output: 2 eDP-1 enabled Geometry: 0,0 1746x982 ``` -------------------------------- ### Hyprland: create, configure, and remove headless output Source: https://github.com/adiimanav/moreland/blob/master/docs/COMPATIBILITY.md Commands to create a headless output named 'moreland', set its mode and position, and remove it. Hyprland accepts an explicit name, making the result deterministic. ```bash hyprctl output create headless moreland hyprctl keyword monitor "moreland,1920x1200@60,1920x0,1" hyprctl output remove moreland ``` -------------------------------- ### Capture protocol object flow Source: https://github.com/adiimanav/moreland/blob/master/docs/01-capture.md Shows the object flow for ext-image-copy-capture-v1: creating a source from a wl_output, creating a session, and creating frames. The session and buffer pool are created once and reused; only one frame can be in flight at a time. ```text ext_output_image_capture_source_manager_v1 .create_source(wl_output) -> ext_image_capture_source_v1 ext_image_copy_capture_manager_v1 .create_session(source, options) -> ext_image_copy_capture_session_v1 events: buffer_size, shm_format, dmabuf_device, dmabuf_format, done .create_frame() -> ext_image_copy_capture_frame_v1 attach_buffer(wl_buffer); damage_buffer(...); capture() events: transform, damage, presentation_time, ready | failed ``` -------------------------------- ### Remove project directory Source: https://github.com/adiimanav/moreland/blob/master/docs/REVERT.md Deletes all source, documentation, and build output, including local settings files. ```bash rm -rf "$REPO" ``` -------------------------------- ### Declare Wayland interface in desktop entry Source: https://github.com/adiimanav/moreland/blob/master/docs/COMPATIBILITY.md Desktop entry configuration to declare the zkde_screencast_unstable_v1 interface, required for a client to bind to the privileged protocol. The Exec path must be absolute; otherwise, the request is silently denied. ```ini X-KDE-Wayland-Interfaces=zkde_screencast_unstable_v1 ``` -------------------------------- ### Sway: create output Source: https://github.com/adiimanav/moreland/blob/master/docs/COMPATIBILITY.md Command to create a headless output in Sway. The output is named automatically (HEADLESS-N), so the daemon must diff the output list to learn the name. ```bash swaymsg create_output ``` -------------------------------- ### Verify clean revert Source: https://github.com/adiimanav/moreland/blob/master/docs/REVERT.md Run these commands to confirm that Moreland components, services, and files have been successfully removed. ```bash hyprctl monitors all | grep -c moreland # 0 systemctl --user list-units | grep -c moreland # 0 adb devices -l # empty (after tablet step) ls "$REPO" # No such file or directory ``` -------------------------------- ### labwc: resize and position headless output with wlr-randr Source: https://github.com/adiimanav/moreland/blob/master/docs/COMPATIBILITY.md Command to set a custom mode and position for the headless output on labwc. The daemon does not resize or move the output, so you must match the aspect ratio yourself. ```bash wlr-randr --output HEADLESS-1 --custom-mode 1920x1200@60 --pos 0,1080 ``` -------------------------------- ### Remove phantom monitor and ADB forwards Source: https://github.com/adiimanav/moreland/blob/master/docs/REVERT.md Use these commands if the daemon was hard-killed and left behind a phantom monitor or active ADB forwards. ```bash hyprctl output remove moreland adb forward --remove-all ``` -------------------------------- ### Full revert commands Source: https://github.com/adiimanav/moreland/blob/master/docs/REVERT.md Execute these commands in order to remove the Moreland project components, stray processes, and associated system configurations. ```bash # 1. compositor state hyprctl output remove moreland # 2. stray test processes pkill -x kitty # 3. future stages (harmless if not yet installed) systemctl --user disable --now moreland.service 2>/dev/null rm -f ~/.config/systemd/user/moreland.service systemctl --user daemon-reload adb uninstall com.moreland.display 2>/dev/null adb forward --remove-all 2>/dev/null # 4. adb server adb kill-server # 5. project tree rm -rf "$REPO" # 6. packages — consider keeping vulkan-radeon sudo pacman -Rns android-udev ``` -------------------------------- ### Inspect KWin screencast plugin for virtual output symbol Source: https://github.com/adiimanav/moreland/blob/master/docs/COMPATIBILITY.md Command to search the KWin screencast plugin binary for the virtual output request symbol. The output shows the mangled C++ symbol for the virtualOutputScreencastRequested method, indicating the protocol supports virtual output creation. ```console $ strings -a /usr/lib/qt6/plugins/kwin/plugins/screencast.so | grep -i virtualoutput _ZN4KWin21ScreencastV1Interface32virtualOutputScreencastRequestedEPNS_... ``` -------------------------------- ### Remove system packages Source: https://github.com/adiimanav/moreland/blob/master/docs/REVERT.md Uninstall project-related packages using pacman. Note that vulkan-radeon is a system driver and should generally be kept. ```bash sudo pacman -Rns vulkan-radeon android-udev ``` -------------------------------- ### Paced at 60 fps — production measurement output Source: https://github.com/adiimanav/moreland/blob/master/docs/03-transport.md Output of the production-case measurement: a synthetic frame stream paced at 60 fps over adb forward to a netcat sink. Shows 16.5 Mbps throughput, write() latency in the sub-millisecond range, and byte-exact delivery. ```text rate 60.00 fps, 16.5 Mbps write() min 0.018 / median 0.064 / p95 0.116 / max 0.250 ms sent 20,575,057 bytes received 20,575,057 bytes on device status byte-exact ``` -------------------------------- ### Terminate kitty process Source: https://github.com/adiimanav/moreland/blob/master/docs/REVERT.md Use pkill with the -x flag to match the exact process name. Avoid -f to prevent killing the invoking shell. ```bash pkill -x kitty # -x matches the exact process name, not command lines ``` -------------------------------- ### Transport crate layout Source: https://github.com/adiimanav/moreland/blob/master/docs/03-transport.md Shows the file structure of the protocol and transport crates, including the ADB wrapper, framed sender, and probe binary. ```text crates/protocol/ src/lib.rs wire types, encode/decode, unit tests crates/transport/ src/adb.rs adb CLI wrapper, RAII forward guard src/lib.rs framed Sender, TCP_NODELAY, vectored writes src/bin/transport_probe.rs benchmark with device-side verification ``` -------------------------------- ### Move workspace to monitor Source: https://github.com/adiimanav/moreland/blob/master/docs/REVERT.md Command to manually move a workspace to a specific monitor if windows are displaced. ```bash hyprctl dispatch moveworkspacetomonitor 3 eDP-1 ``` -------------------------------- ### Uninstall Moreland components Source: https://github.com/adiimanav/moreland/blob/master/README.md Use these commands to disable the systemd service, remove local binaries and configuration files, and uninstall the Android application. ```bash systemctl --user disable --now moreland.service rm -f ~/.local/bin/moreland ~/.config/systemd/user/moreland.service adb uninstall com.moreland.display ``` -------------------------------- ### Proposed crates/capture directory structure Source: https://github.com/adiimanav/moreland/blob/master/docs/06-plasma-backend.md The directory structure for the capture crate, showing the integration of the new plasma backend alongside existing and future implementations. ```text crates/capture/src/ lib.rs trait FrameSource { fn next_frame(&mut self) -> Result } ext/ existing ext-image-copy-capture — Hyprland/wlroots, still the default plasma/ NEW zkde_screencast + PipeWire — KDE, no dialog, virtual output included portal/ LATER ScreenCast/RemoteDesktop + PipeWire — GNOME, sandboxed fallback ``` -------------------------------- ### Disable and remove daemon service Source: https://github.com/adiimanav/moreland/blob/master/docs/REVERT.md Stop the user service, remove binary and configuration files, and refresh the systemd and KWin service caches. ```bash systemctl --user disable --now moreland.service rm -f ~/.config/systemd/user/moreland.service rm -f ~/.local/bin/moreland rm -f ~/.local/share/applications/moreland.desktop systemctl --user daemon-reload command -v kbuildsycoca6 >/dev/null && kbuildsycoca6 --noincremental ``` -------------------------------- ### Clean Rust build artifacts Source: https://github.com/adiimanav/moreland/blob/master/docs/REVERT.md Navigate to the repository and remove build artifacts using cargo clean. ```bash cd "$REPO" cargo clean ``` -------------------------------- ### Failure log: Address already in use Source: https://github.com/adiimanav/moreland/blob/master/docs/04-android-app.md Log output showing the failure when the stream's lifetime is tied to the surface's. Two instances compete for the process-wide socket name; the stale one wins, causing a confusing broken pipe on the host. ```text W Moreland: accept loop error: Address already in use (x6) I Moreland: host connected I Moreland: stream 1920x1200@60 video/avc W Moreland: session ended: The surface has been released ``` -------------------------------- ### Verify virtual output removal Source: https://github.com/adiimanav/moreland/blob/master/docs/REVERT.md Command to verify the virtual output is no longer present, expecting a count of 0. ```bash hyprctl monitors all | grep -c moreland # expect 0 ``` -------------------------------- ### Verify benchmark file deletion Source: https://github.com/adiimanav/moreland/blob/master/docs/REVERT.md Confirm the removal of the throughput-benchmark file from the tablet. ```bash adb shell ls -la /data/local/tmp/usbtest.bin # expect: No such file ``` -------------------------------- ### Encoder crate structure Source: https://github.com/adiimanav/moreland/blob/master/docs/02-encode.md Shows the layout of the encoder crate: src/lib.rs for pipeline construction and push/pull API, and src/bin/encode_probe.rs for the concurrent capture->encode benchmark. ```text crates/encoder/ src/lib.rs pipeline construction, push/pull API src/bin/encode_probe.rs concurrent capture->encode benchmark ``` -------------------------------- ### Identify Connected DRM Devices Source: https://github.com/adiimanav/moreland/blob/master/README.md Use this bash command to determine which GPU your panel is connected to by checking the status of DRM devices in sysfs. ```bash for s in /sys/class/drm/card*-*/status; do [ "$(cat "$s")" = connected ] && echo "$(basename "$(dirname "$s")")" done ``` -------------------------------- ### Repository Layout Source: https://github.com/adiimanav/moreland/blob/master/docs/README.md The directory structure of the Moreland repository. ```text crates/ capture/ Wayland virtual output + DMA-BUF frame capture encoder/ VAAPI H.264 encode (stage 2) transport/ adb forward + framed socket (stage 3) protocol/ shared wire types (stage 3) daemon/ detection and lifecycle (stage 5) android/ Kotlin decoder app (stage 4) systemd/ user service units (stage 5) docs/ ``` -------------------------------- ### Clean up leftover device-side sink Source: https://github.com/adiimanav/moreland/blob/master/docs/03-transport.md Commands to manually clear the device-side sink and ADB forwards if a probe run is interrupted. ```bash adb shell "pkill -f 'nc -l'; rm -f /data/local/tmp/moreland-sink.bin" adb forward --remove-all ``` -------------------------------- ### Kill ADB server Source: https://github.com/adiimanav/moreland/blob/master/docs/REVERT.md Terminate the background ADB server running on TCP port 5037. ```bash adb kill-server ``` -------------------------------- ### Verify ADB removal Source: https://github.com/adiimanav/moreland/blob/master/docs/REVERT.md Confirm that USB debugging is disabled and the ADB interface is removed by checking device lists and USB product IDs. ```bash adb devices -l # expect an empty list lsusb | grep -i xiaomi # expect 2717:ff40 (MTP only), not ff48 (MTP + ADB) ``` -------------------------------- ### Negotiated Buffer Allocation Result Source: https://github.com/adiimanav/moreland/blob/master/docs/01-capture.md Displays the specific format, modifier, and device path negotiated for buffer allocation. ```text format XR24 (opaque; alpha is meaningless here) modifier 0x0200000000000901 AMD GFX9 tiled, no DCC device /dev/dri/renderD129 ``` -------------------------------- ### kscreen-doctor output listing Source: https://github.com/adiimanav/moreland/blob/master/docs/06-plasma-backend.md The output of `kscreen-doctor` showing that the virtual output is created but remains in a disabled state. ```text Output: 1 Virtual-vtest disabled connected Modes: 1920x1200@60 ``` -------------------------------- ### Recovery from device loss log output Source: https://github.com/adiimanav/moreland/blob/master/docs/05-daemon.md Log output showing recovery from device loss (e.g., killing the ADB server). The stream breaks, the tracker reconnects, and streaming resumes without intervention. ```text streaming to ABCD1234 removed output moreland session ended: sending frame: Broken pipe (os error 32) device tracker lost: reading ADB length; reconnecting device ABCD1234 connected streaming to ABCD1234 <- resumed with no intervention removed output moreland session ended cleanly shutting down ``` -------------------------------- ### Post-SIGTERM residue check output Source: https://github.com/adiimanav/moreland/blob/master/docs/05-daemon.md Output after SIGTERM, confirming no residue: no monitors and no ADB forwards remain. ```text monitors with moreland: 0 adb forwards: [] ``` -------------------------------- ### Round-trip measurement output Source: https://github.com/adiimanav/moreland/blob/master/docs/04-android-app.md Output from a 15-second run at 1920x1200@60 with continuous damage on the virtual output, showing frames captured, sent, acks received, bytes sent, and round-trip latency statistics. ```text frames captured 901 (60.07 fps) frames sent 900 acks received 898 (99.8%; two still in flight at exit) bytes sent 28.4 MB (15.1 Mbps) round trip: host send -> device render -> host ack min 19.54 ms median 24.52 ms p95 34.17 ms max 57.29 ms ``` -------------------------------- ### Generate continuous damage on virtual output Source: https://github.com/adiimanav/moreland/blob/master/docs/02-encode.md Runs a loop printing the current Unix timestamp to keep the virtual output continuously damaged, avoiding the idle path during measurements. ```bash hyprctl dispatch exec "[workspace 3 silent] kitty sh -c 'while true; do date +%s.%N; done'" ``` -------------------------------- ### Keep netcat sink alive with sleep Source: https://github.com/adiimanav/moreland/blob/master/docs/03-transport.md Fix for the netcat bug that caused false success: holds stdin open so nc does not quit on EOF. Used with adb forward to keep the sink alive. ```shell sleep 3600 | nc -l -p PORT > sink ``` -------------------------------- ### View device diagnostics with adb logcat Source: https://github.com/adiimanav/moreland/blob/master/docs/04-android-app.md Filters logcat output to show only messages tagged 'Moreland' from the device. ```bash adb logcat -s Moreland ``` -------------------------------- ### Remove shared Android SDK components Source: https://github.com/adiimanav/moreland/blob/master/docs/REVERT.md Optional cleanup of Android SDK components. Only perform this if you are certain no other projects rely on these specific versions. ```bash # only if you are sure rm -rf /opt/android-sdk/platforms/android-34 /opt/android-sdk/build-tools/34.0.0 ``` -------------------------------- ### Data flow: LocalServerSocket to SurfaceView Source: https://github.com/adiimanav/moreland/blob/master/docs/04-android-app.md Shows the data flow from the abstract Unix socket to the SurfaceView, including the per-frame acknowledgement. The host connects via `adb forward tcp:27183 localabstract:moreland`, so traffic never touches Android's TCP stack or `netd`. ```text LocalServerSocket("moreland") abstract Unix socket -> StreamHeader configure decoder -> MediaCodec (async, low-latency) hardware H.264 -> SurfaceView direct render -> ack per rendered frame device -> host, 8 bytes ``` -------------------------------- ### Automatic detection log output Source: https://github.com/adiimanav/moreland/blob/master/docs/05-daemon.md Log output from automatic device detection. Shows the sequence of INFO messages when a device is found and a virtual output is created. ```text INFO moreland: watching for devices INFO moreland: device ABCD1234 connected INFO moreland::session: virtual output moreland at 1920x1200@60 INFO moreland::session: streaming to ABCD1234 ``` -------------------------------- ### Remove the virtual output Source: https://github.com/adiimanav/moreland/blob/master/docs/01-capture.md Removes the headless output named 'moreland'. ```bash hyprctl output remove moreland ``` -------------------------------- ### GStreamer H.264 Encoding Pipeline Source: https://github.com/adiimanav/moreland/blob/master/docs/02-encode.md The GStreamer pipeline configuration for processing DMA-BUF video frames into an H.264 Annex-B bitstream. ```text appsrc video/x-raw(memory:DMABuf), format=DMA_DRM, drm-format=XR24:0x0200000000000901 -> vapostproc XR24 tiled -> NV12, in-GPU -> capsfilter video/x-raw(memory:VAMemory), NV12 -> vah264enc VBR, no B-frames, target-usage 3 -> h264parse config-interval=-1 -> capsfilter byte-stream / au -> appsink ``` -------------------------------- ### Flood — maximum sustainable throughput output Source: https://github.com/adiimanav/moreland/blob/master/docs/03-transport.md Output of the flood test measuring maximum sustainable throughput. Reports an apparent 40.4 MB/s due to buffering, an effective 27.86 MB/s (223 Mbps) including drain, and byte-exact reception. ```text written 51.5 MB in 1.27 s (40.4 MB/s apparent — this is buffering) effective 27.86 MB/s (223 Mbps) including drain received 51,494,876 bytes byte-exact ``` -------------------------------- ### Clear Gradle caches Source: https://github.com/adiimanav/moreland/blob/master/docs/REVERT.md Remove shared Gradle caches. Note that this action will affect all Gradle projects on the machine. ```bash rm -rf ~/.gradle/caches ~/.gradle/wrapper # affects all Gradle projects ``` -------------------------------- ### VAAPI encoder capabilities on renderD129 Source: https://github.com/adiimanav/moreland/blob/master/docs/00-system-survey.md Output of a VAAPI capability probe on renderD129. Confirms H.264/HEVC encode+decode, 4096x4096 max picture size, CBR/VBR/CQP rate control, l0=1/l1=0 (no B-frames), 32 quality levels, and rolling intra-refresh modes. The l0=1/l1=0 limitation is load-bearing: it prevents B-frames, which is desirable for low latency. ```text H.264 Constrained Baseline / Main / High encode + decode HEVC Main / Main10 encode + decode Max picture size 4096x4096 Rate control CBR / VBR / CQP EncMaxRefFrames l0=1, l1=0 EncQualityRange 32 levels EncIntraRefresh rolling column / rolling row / P-frame ``` -------------------------------- ### Remove ADB authorization keys Source: https://github.com/adiimanav/moreland/blob/master/docs/REVERT.md Deletes host-side ADB keys. This forces re-authorization for all devices and affects all ADB clients on the machine. ```bash rm -f ~/.android/adbkey ~/.android/adbkey.pub # only if you mean it ``` -------------------------------- ### Remove specific crate sources Source: https://github.com/adiimanav/moreland/blob/master/docs/REVERT.md Manually remove specific crate sources from the cargo registry. Note that these are shared across all Rust projects. ```bash rm -rf ~/.cargo/registry/src/*/wayland-protocols-0.32.13 rm -rf ~/.cargo/registry/src/*/gbm-0.18.0 ``` -------------------------------- ### Clear ADB port forwards Source: https://github.com/adiimanav/moreland/blob/master/docs/REVERT.md Explicitly remove all active ADB port forwards. ```bash adb forward --remove-all ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.