Fix/android blackscreen and pad mapping #371
Closed
FlipperDan
wants to merge 2 commits from
FlipperDan/punktfunk:fix/android-blackscreen-and-pad-mapping into main
pull from: FlipperDan/punktfunk:fix/android-blackscreen-and-pad-mapping
merge into: :main
:main
:worktree-worktree-web-stale-assets
:worktree-keep-host-audio-parity
:worktree-standby-sink-investigation
:worktree-security-review-fixes
:worktree-abr-dscp-default
:worktree-abr-control-loop
:worktree-abr-transmission-plane
:worktree-pyrowave-forces-auto
:worktree-web-console-native-identity
:worktree-abr-encode-downdriver
:worktree-gamescope-exclusive-panel-off
:worktree-bitrate-picker
:worktree-fix-mic-tap-format-abort
:worktree-release-0313-recut
:ci-skia-download-retry
:worktree-audio-devnode-orphans
:worktree-gamescope-rebuild-keeps-hdr
:worktree-gamescope-idled-handback
:worktree-hevc-idr-storm-coalesce
:worktree-gamestream-pad-heartbeat
:worktree-steam-prelaunch-latch
:worktree-release-0312-prep
:worktree-firewall-program-scoped-rules
:worktree-blackscreen-data-plane-source-ip
:worktree-fix-frozen-local-ip
:worktree-android-pad-mapping-regression
:worktree-android-console-extra-keys
:worktree-data-plane-firewall-and-delivery-truth
:worktree-android-gamepad-ui-and-corner
:worktree-android-pad-hid-remap
:worktree-gamestream-xbox-hid-parity
:worktree-release-next-prep
:worktree-win-client-installer
:worktree-kwin-vout-enable-repair
:worktree-wp4-install-script
:docs-wp2-to-main
:worktree-docs-wp0-wp1-anti-drift
:worktree-kwin-vout-failed-permanent
:worktree-android-asc-hdr-dataspace
:worktree-console-controllers-page
:worktree-gamepad-probe-stack
:worktree-agents-md-setup
:worktree-android-skia-console
:worktree-android-asc-presenter
:worktree-win-teardown-abort
:worktree-audio-hires-default-on
:worktree-console-ui-aa
:worktree-pr270-review-fixes
:worktree-console-ui-overhaul
:worktree-hires-audio-pcm
:worktree-audio-stutter-fixes
:worktree-ds-pad-sink-pro-audio
:worktree-console-diagnostics
:worktree-ds-inhibit-storm
:worktree-security-review-2026-08-15-fixes
:worktree-pairing-friendly-device-name
:worktree-shield-select-back-quit
:worktree-android-canary-open-testing
:fix-host-cer-alias-null-key
:worktree-azure-trusted-signing
:worktree-audio-soft-limit-gain
:worktree-gamescope-exclusive-dpms
:fix/playnite-launcher-resolve
:worktree-macos-mic-rebuild-loop
:worktree-hyprland-cursor-mode-negotiation
:worktree-hd2-idle-recording-default
:worktree-steam-art-root-windows
:worktree-android-aaudio-shield-silence
:worktree-unpair-all-button
:worktree-appletv-present-depth
:worktree-av1-level-sentinel
:worktree-nix-plugin-runner-resolve
:worktree-release-0280
:worktree-console-plugin-update-all
:worktree-flatpak-skia-099-pin
:worktree-debian-ubuntu-support
:worktree-wowlan-support
:worktree-decky-shortcut-dup
:worktree-vk-level-gate-clamp
:worktree-edition-2024
:worktree-win-sleep-blockers
:worktree-rt-gpu-priority-defaults
:worktree-black-stream-fixes
:worktree-edid-lock-toggle
:worktree-gate-double-arm-fix
:chore/rust-safety-programme
:worktree-console-pinned-profile-library
:worktree-blackscreen-fixes
:build/web-silence-rollup-directive-warnings
:worktree-android-console-visual-refresh
:worktree-nixos-capped-compositor-exe-denied
:worktree-release-0270
:worktree-dm-helper-diagnosis
:worktree-gamescope-pin-bump-nobara
:worktree-notes-capsysnice-correction
:worktree-bazzite-docs-warning
:worktree-kwin-capability-identification
:worktree-gamescope-rpm-deb-builddeps
:worktree-pyrowave-wire-dead-code
:worktree-release-0260
:worktree-cursor-composite-hardening
:worktree-library-settings-origin-split
:worktree-native-decode-m0
:worktree-july-rpm-and-cursor
:worktree-presenter-cadence-wp1
:worktree-decky-brand-name
:worktree-win-amd-decoder-order
:worktree-stall-ride-through
:fix/pad-audio-wasapi-module-path
:feat/android-pad-audio
:worktree-adl-emul-probe
:worktree-haptics-m12-dry
:worktree-haptics-m9-richfb
:worktree-haptics-m11-settings
:worktree-apple-store-screenshots
:worktree-decky-slim-rework
:worktree-appstore-copy
:worktree-haptics-m10-wire
:worktree-haptics-m8-proto
:worktree-haptics-m7-windows
:worktree-haptics-m6-presenter
:worktree-wire-mtu-resilience
:worktree-haptics-m5-android
:worktree-haptics-m4-apple
:worktree-haptics-m3-rumble-engine
:worktree-android-presenter-023-triage
:worktree-vdisplay-resume-recovery
:worktree-kwin-vout-demirror
:fix/web-console-sweep
:fix/windows-web-console-lifecycle
:chore/windows-rerender-semantics
:fix/pf-encode-phase8
:fix/pf-encode-phase7
:feat/cursor-channel
:feat/desktop-mouse-mode
:feat/plugin-kit
:fix/network-split-standing-latency
:fix/windows-msix-arm64-and-manifest
:fix/encode-medium-tier
:fix/encode-rfi-taint-and-oob
:fix/encode-init-leak-and-twin-drift
:fix/encode-teardown-uaf
:feat/pyrowave-windows
:fix/ubuntu-2404-host-deb
:fix/ios-archive-provisioning
:merge/first-frame-latency
:feat/shared-clipboard-v2
:feat/apple-live-activities-widgets
:debug/touch-finger-logging
:feat/shared-clipboard
:midstream-resize
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What & Why
1. Black screen on initial stream probe (
crates/punktfunk-core)TARGET_PROBE_BANDWIDTH_BPS), and immediately requests an IDR keyframe if the startup probe fails to complete.2. DualSense Bluetooth button mapping and input source routing (
clients/android)AXIS_BRAKE/AXIS_GAS) asPadButtons.NATIVE, preserving standard face buttons (✕/○/□/△).0x13d/ 317) toBTN_TOUCHPADand Mute button (0x13e/ 318) toBTN_MISC1(triggering client microphone toggle).MainActivitygamepad event checks (isFromSource(SOURCE_GAMEPAD) || isFromSource(SOURCE_JOYSTICK) || Gamepad.isPad(dev)) so Bluetooth gamepad buttons delivered underSOURCE_KEYBOARDorSOURCE_JOYSTICKby Fire OS are not dropped.Gamepad.isSonyPadto prevent Xbox controllers from ever matching Sony layouts.SOURCE_KEYBOARD. The previous checks dropped these events and erroneously applied straight-through shift heuristics.User-facing fact changed?
n/a (Bug fixes in Android client streaming probe and Bluetooth gamepad input routing; no docs, CLI flags, ports, or config schemas changed).
Thanks @FlipperDan — the diagnosis here is good, and all three problems are real ones that nobody had spotted. They're now fixed on
mainas #379 (the probe) and #380 (the pad mapping). What changed is where each fix lands, not whether it was worth making:The probe. The 2 Gbps target really is too high, and your read of why is right. Rather than a
cfg!(target_os = "android")default, #379 derives it fromstream_cap_kbps × 2(capped at the old 2 Gbps). The ABR already clamps any measured ceiling to that cap, so everything the burst measures abovecap / 0.7was being discarded anyway — the height was pure bufferbloat. Deriving it fixes webOS and every other constrained client at once, and it can't cap the wired Shield / Wi-Fi 6E clients that genuinely have the capacity (a flat 200 Mbps would have, on exactly the high modes).The keyframe on probe end. Kept essentially as you wrote it — right place, right emitter, funnelled through the coalescer. The guard is widened to compare against
frames_completedsnapshotted at the burst's leading edge instead of against 0, so it also covers a mid-session "Test connection" that kills a running stream.The pad mapping. The one to flag for next time:
0x13d/0x13eareBTN_THUMBL/BTN_THUMBR— L3 and R3 — in the standard Linux mapping. They only mean touchpad and mute inside the straight-through report order a driverless pad enumerates in, which is whatPadButtons.GENERIC_SONYis. Resolving them abovepadMap(dev)(and adding them toSONY_MODERN) costs both stick clicks on every Xbox pad, Switch Pro, 8BitDo, Steam Deck andhid-playstationDualSense, and puts the mic toggle on R3. #380 puts the two rows insideGENERIC_SONYand nowhere else.Same idea behind the source-routing fix: widening
isPadonvendorIdcatches those vendors' keyboards and mice too (0x045Eis Microsoft's VID for Sculpt keyboards and Arc mice), which routes a keyboard's arrow keys into the D-pad and takes away a remote's Back as the way out of a stream. #380 widens to the device but only forKeyEvent.isGamepadButtonkeycodes, which is exactly the set that can't be anything else.Two more worth knowing:
correct()'sgenericKeyCodeguard is what keeps the tables from touching a pad that already works, so it needs to stay; andBTN_MISC1is the wire's misc/QAM bit —Sc2Deviceputs a Steam Controller 2's QAM button on it — so the mic toggle is gated on the pad actually having a mute button, or QAM would mute people's mics.Closing this in favour of the two merged PRs.
Pull request closed