Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moonlight new input protocol #45

Merged
merged 88 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
209f0d2
fix: resume stream without override devices, better behaviour on Moon…
ABeltramo Nov 5, 2023
f0532d7
refactor: basic split between Core and Moonlight
ABeltramo Jul 8, 2023
c4a0d4e
Committing clang-format changes
ABeltramo Jul 8, 2023
6c19590
AV1 support (#37)
ABeltramo Jul 25, 2023
b9886c2
feat: Allow use of multiple ENet channels
ABeltramo Jul 9, 2023
36dde95
feat: RTSP describe added required additional features
ABeltramo Jul 9, 2023
fd712dc
feat: uinput, proper fetch events + new Moonlight packets and structs
ABeltramo Jul 11, 2023
234ab54
feat: basic controller hot-plug logic, relies on mknod for Docker
ABeltramo Jul 12, 2023
4e42ee1
refactor: completely separated virtual inputs from Moonlight
ABeltramo Jul 29, 2023
1b3b009
fix: avoid fail to start when AV1 isn't supported
ABeltramo Jul 29, 2023
96913b5
feat: implemented joypad rumble support
ABeltramo Jul 30, 2023
ef37bfd
feat: implemented joypad trackpad support
ABeltramo Aug 5, 2023
90e1dad
feat: implemented joypad motion sensors
ABeltramo Aug 6, 2023
589c9a3
feat: added warning message when drm fails to get the primary node
ABeltramo Aug 9, 2023
e79d01f
Committing clang-format changes
ABeltramo Sep 3, 2023
0f2ca68
feat: added support for hot-plugging controllers and partial fake ude…
ABeltramo Sep 28, 2023
3aa59ea
Committing clang-format changes
ABeltramo Sep 28, 2023
6b21dff
feat: added fake-udev to docker container
ABeltramo Oct 14, 2023
553f7fd
feat: plugged fake udev implementation
ABeltramo Oct 15, 2023
cb9abbf
docs: new options
ABeltramo Oct 15, 2023
e69ccea
Committing clang-format changes
ABeltramo Oct 25, 2023
a605858
fix: tests after rebase
ABeltramo Nov 5, 2023
971bdbf
fix: correctly emulating PS pad
ABeltramo Nov 6, 2023
6d55015
feat: support for properly unplugging devices
ABeltramo Nov 6, 2023
ba80224
feat: better gyro support, attempt test via SDL
ABeltramo Nov 8, 2023
8be7a7a
Committing clang-format changes
ABeltramo Nov 8, 2023
0bb6e05
fix: compilation issue on clang
ABeltramo Nov 8, 2023
6a0aa31
Committing clang-format changes
ABeltramo Nov 8, 2023
a76e31f
fix: compilation issue on clang
ABeltramo Nov 8, 2023
c7686f0
Committing clang-format changes
ABeltramo Nov 8, 2023
2783f2f
docs: added docker hotplug explanation
ABeltramo Nov 12, 2023
83dd201
docs: added Moonlight new control packets
ABeltramo Nov 12, 2023
3f52d8a
fix: use different UDP ports for different users.
ABeltramo Nov 16, 2023
13a229a
Committing clang-format changes
ABeltramo Nov 16, 2023
9a47f4a
fix: pulseaudio cleanup sockets on startup and run as non-root
ABeltramo Nov 21, 2023
53116ef
fix: added support for Nvidia container toolkit
ABeltramo Nov 21, 2023
83aea8d
fix: moved rust code to a separate project, updated Docker image to u…
ABeltramo Nov 29, 2023
ea2de44
CI: install gst-wayland-display before building Wolf
ABeltramo Nov 29, 2023
0709ffc
CI: permission error on GA
ABeltramo Nov 29, 2023
6a7cf39
CI: typo
ABeltramo Nov 29, 2023
800c1f9
CI: using sudo to install the package
ABeltramo Nov 29, 2023
13d7fb1
CI: using sudo to install the package
ABeltramo Dec 15, 2023
a744ab3
fix: gstreamer docker image with new Ubuntu version
ABeltramo Jan 3, 2024
469109c
fix: Nintendo joypad, missing required flags
ABeltramo Jan 9, 2024
9280c45
fix: Nintendo joypad, swapped A/B, updated fuzz and flat with real de…
ABeltramo Jan 10, 2024
f54367f
fix: default entrypoint and CMD for gstreamer image
ABeltramo Jan 14, 2024
aaa96af
docs: updated dev environment setup and quickstart guide
ABeltramo Jan 14, 2024
ebefc77
feat: proper stacktrace on termination
ABeltramo Jan 20, 2024
9bceeb5
Committing clang-format changes
ABeltramo Jan 20, 2024
f2e7d21
fix: removed forced exception to test stacktraces
ABeltramo Jan 20, 2024
d2ff748
feat: better stacktrace using cpptrace
ABeltramo Jan 21, 2024
c372e73
fix: only use async-signal-safe functions in the shutdown_handler
ABeltramo Jan 22, 2024
dcf91e2
fix: open requires mode when creating the file
ABeltramo Jan 22, 2024
1841a7e
fix: open requires mode when creating the file
ABeltramo Jan 22, 2024
e241418
fix: optional exception handling tests
ABeltramo Jan 24, 2024
99ed7fe
fix: added Gamescope env fix for Intel GPUs
ABeltramo Jan 24, 2024
12e90b3
tests: added unit tests for joypads using SDL2
ABeltramo Jan 24, 2024
dcda93a
docs: quickstart update
ABeltramo Jan 24, 2024
eeec219
ci: testing out setup-sdl
ABeltramo Jan 24, 2024
fb032f9
ci: removing SDL tests from CI
ABeltramo Jan 24, 2024
131642e
ci: testing SDL on GA
ABeltramo Jan 24, 2024
0e3b945
ci: disabled SDL Joypad tests
ABeltramo Jan 24, 2024
005d462
fix: make sure to call future.set_value only once
ABeltramo Jan 26, 2024
e41a87a
fix: uinput set analog trigger when zero
cancrusher Jan 27, 2024
856805e
Merge branch 'fix-analog-trigger-zero' into dev-input-protocol
ABeltramo Jan 29, 2024
23bf059
fix: triggers implementation + Nintendo pad + tests
ABeltramo Jan 29, 2024
d5fc481
fix: rumble clamp values, added SDL test
ABeltramo Jan 30, 2024
4125963
fix: Nintendo capture button
ABeltramo Jan 30, 2024
8440fad
fix: better unhandled exceptions handling
ABeltramo Jan 31, 2024
8bef26f
fix: docker, log when exec fails and avoid double mounting initial de…
ABeltramo Feb 4, 2024
f5e3cdb
Committing clang-format changes
ABeltramo Feb 4, 2024
0aba499
fix: fake-udev use error code to signal fail on sending message
ABeltramo Feb 4, 2024
1dbb931
fix: updated defaults with latest hot-plug requirements
ABeltramo Feb 4, 2024
6367ec0
fix: startup path for fake-udev
ABeltramo Feb 4, 2024
f522776
docs: updated quickstart
ABeltramo Feb 4, 2024
54a13cc
fix: removed default WOLF_DOCKER_FAKE_UDEV_PATH it'll be derived at r…
ABeltramo Feb 4, 2024
553ad78
fix: missing apparmor config from default Steam configuration
ABeltramo Feb 4, 2024
81e59a7
refactor: completely separated Moonlight protocols and methods
ABeltramo Feb 5, 2024
6da00fc
docs: updated with latest changes
ABeltramo Feb 5, 2024
c78c951
tests: using libinput to test virtual mouse and keyboard
ABeltramo Feb 7, 2024
357e2bf
fix: virtual trackpad support
ABeltramo Feb 7, 2024
aafed06
feat: implemented virtual pen tablet support
ABeltramo Feb 7, 2024
a131d7f
feat: implemented virtual touch screen
ABeltramo Feb 9, 2024
4d37d82
Committing clang-format changes
ABeltramo Feb 9, 2024
65624f4
refactor: better split between input library and Moonlight specific code
ABeltramo Feb 10, 2024
6e6caa9
feat: moved virtual input library to games-on-whales/inputtino
ABeltramo Feb 10, 2024
f3c5d27
Committing clang-format changes
ABeltramo Feb 11, 2024
322d2ea
fix: cmake compilation issues
ABeltramo Feb 11, 2024
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
30 changes: 30 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Generated from CLion Inspection settings
---
Checks: '-*,
bugprone-*,
mpi-*,
cert-err52-cpp,
cert-err60-cpp,
cert-err34-c,
cert-str34-c,
cert-dcl21-cpp,
cert-msc50-cpp,
cert-msc51-cpp,
cert-dcl58-cpp,
cert-flp30-c,
cppcoreguidelines-*,
-cppcoreguidelines-avoid-do-while,
google-default-arguments,
google-runtime-operator,
google-explicit-constructor,
hicpp-multiway-paths-covered,
hicpp-exception-baseclass,
misc-unconventional-assign-operator,
misc-misplaced-const,
misc-new-delete-overloads,
misc-non-copyable-objects,
misc-no-recursion,
misc-throw-by-value-catch-by-reference,
misc-uniqueptr-reset-release,
openmp-use-default-none,
portability-simd-intrinsics'
10 changes: 5 additions & 5 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
context: docker/
file: docker/gpu-drivers.Dockerfile
push: true
tags: ghcr.io/${{ github.repository_owner }}/gpu-drivers:2023.04,gameonwhales/gpu-drivers:2023.04 # TODO: set build version as param
tags: ghcr.io/${{ github.repository_owner }}/gpu-drivers:2023.11,gameonwhales/gpu-drivers:2023.11 # TODO: set build version as param
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/gpu-drivers:buildcache
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/gpu-drivers:buildcache,mode=max
Expand All @@ -109,9 +109,9 @@ jobs:
file: docker/gstreamer.Dockerfile
push: true
build-args: |
GSTREAMER_VERSION=1.22.0
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/gpu-drivers:2023.04
tags: ghcr.io/${{ github.repository_owner }}/gstreamer:1.22.0,gameonwhales/gstreamer:1.22.0 # TODO: set gstreamer version as param
GSTREAMER_VERSION=1.22.7
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/gpu-drivers:2023.11
tags: ghcr.io/${{ github.repository_owner }}/gstreamer:1.22.7,gameonwhales/gstreamer:1.22.7 # TODO: set gstreamer version as param
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/gstreamer:buildcache
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/gstreamer:buildcache,mode=max
Expand All @@ -126,7 +126,7 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/gstreamer:1.22.0
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/gstreamer:1.22.7
IMAGE_SOURCE=${{ steps.prep.outputs.github_server_url }}/${{ github.repository }}
cache-from: ${{ steps.prep.outputs.cache_from }}
cache-to: ${{ steps.prep.outputs.cache_to }}
32 changes: 26 additions & 6 deletions .github/workflows/linux-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: |
sudo apt-get update -y
sudo apt-get install -y \
g++-11 \
g++ \
cmake \
ninja-build \
libboost-locale-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libboost-stacktrace-dev \
Expand All @@ -34,28 +34,37 @@ jobs:
libevdev-dev \
libudev-dev \
libdrm-dev \
libpci-dev
libpci-dev \
libunwind-dev

- name: Setup Rust
uses: ATiltedTree/setup-rust@v1
with:
rust-version: stable

- name: Setup gst-wayland-display
run: |
git clone https://github.com/games-on-whales/gst-wayland-display
cd gst-wayland-display
cargo install cargo-c
cargo cinstall -p c-bindings --prefix=/usr/local

- name: Configure build
working-directory: ${{runner.workspace}}
env:
CXX: g++-11
run: |
cmake -Bbuild \
-H$GITHUB_WORKSPACE \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DCMAKE_CXX_STANDARD=17 \
-DTEST_UINPUT=OFF \
-DTEST_VIRTUAL_INPUT=OFF \
-DTEST_LIBINPUT=OFF \
-DTEST_DOCKER=ON \
-DLINK_RUST_WAYLAND=ON \
-DTEST_RUST_WAYLAND=OFF \
-DTEST_NVIDIA=OFF \
-DTEST_EXCEPTIONS=OFF \
-DTEST_SDL=OFF \
-DCARGO_TARGET_BUILD=aarch64-unknown-linux-gnu \
-G Ninja

Expand Down Expand Up @@ -112,13 +121,22 @@ jobs:
libudev-dev \
libdrm-dev \
libpci-dev \
libunwind-dev \
${{ join(matrix.other_pkgs, ' ') }}

- name: Setup Rust
uses: ATiltedTree/setup-rust@v1
with:
rust-version: stable

- name: Setup gst-wayland-display
run: |
git clone https://github.com/games-on-whales/gst-wayland-display
cd gst-wayland-display
cargo install cargo-c
cargo cinstall -p c-bindings --prefix=/usr/local --destdir=temp
sudo cp -r temp/usr/local/* /usr/local/

- name: Configure build
working-directory: ${{runner.workspace}}
env:
Expand All @@ -134,11 +152,13 @@ jobs:
-DCMAKE_CXX_EXTENSIONS=OFF \
-DBUILD_SHARED_LIBS=${{ matrix.shared }} \
-DCATCH_DEVELOPMENT_BUILD=ON \
-DTEST_UINPUT=OFF \
-DTEST_VIRTUAL_INPUT=OFF \
-DTEST_LIBINPUT=OFF \
-DTEST_DOCKER=OFF \
-DLINK_RUST_WAYLAND=ON \
-DTEST_RUST_WAYLAND=OFF \
-DTEST_NVIDIA=OFF \
-DTEST_SDL=OFF \
-G Ninja

- name: Build tests + lib
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ DartConfiguration.tcl
.run/
target
Cargo.lock

.clj-kondo
.lsp
10 changes: 9 additions & 1 deletion 85-wolf.rules
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Allows Wolf to acces /dev/uinput
KERNEL=="uinput", SUBSYSTEM=="misc", MODE="0660", GROUP="input", OPTIONS+="static_node=uinput"

# Move virtual keyboard and mouse into a different seat
SUBSYSTEMS=="input", ATTRS{id/vendor}=="ab00", MODE="0660", GROUP="input", ENV{ID_SEAT}="seat9"
SUBSYSTEMS=="input", ATTRS{id/vendor}=="045e", ATTRS{id/product}=="02d1", ATTRS{id/version}=="ab00", MODE="0660", GROUP="input"

# Joypads
SUBSYSTEMS=="input", ATTRS{name}=="Wolf X-Box One (virtual) pad", MODE="0660", GROUP="input"
SUBSYSTEMS=="input", ATTRS{name}=="Wolf PS5 (virtual) pad", MODE="0660", GROUP="input"
SUBSYSTEMS=="input", ATTRS{name}=="Wolf gamepad (virtual) motion sensors", MODE="0660", GROUP="input"
SUBSYSTEMS=="input", ATTRS{name}=="Wolf Nintendo (virtual) pad", MODE="0660", GROUP="input"
26 changes: 11 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,19 @@ endif (CCACHE_FOUND)
include(FetchContent)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/)

option(LINK_RUST_WAYLAND "Link to our custom Rust wayland compositor" ON)
if (LINK_RUST_WAYLAND AND UNIX AND NOT APPLE)
# Adapted from: https://github.com/Devolutions/CMakeRust/
enable_language(Rust)
include(CMakeCargo)
add_subdirectory(src/rust/gst-wayland-display)
include(TargetLinkLibrariesSystem)

add_subdirectory(src/core)

if (UNIX AND NOT APPLE)
add_subdirectory(src/fake-udev)
endif ()

include(TargetLinkLibrariesSystem)
add_subdirectory(src/helpers)
add_subdirectory(src/crypto)
add_subdirectory(src/moonlight)
add_subdirectory(src/streaming)
add_subdirectory(src/input)
add_subdirectory(src/audio)
add_subdirectory(src/docker)
add_subdirectory(src/wolf)
option(BUILD_MOONLIGHT "Build Moonlight server" ON)
if (BUILD_MOONLIGHT)
add_subdirectory(src/moonlight-protocol)
add_subdirectory(src/moonlight-server)
endif (BUILD_MOONLIGHT)

# Testing only available if this is the main app
# Emergency override MODERN_CMAKE_BUILD_TESTING provided as well
Expand Down
8 changes: 0 additions & 8 deletions Cargo.toml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Games on Whales
Copyright (c) 2021-2023 Games on Whales https://github.com/games-on-whales/

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
74 changes: 0 additions & 74 deletions cmake/CMakeCargo.cmake

This file was deleted.

25 changes: 0 additions & 25 deletions cmake/CMakeDetermineRustCompiler.cmake

This file was deleted.

15 changes: 0 additions & 15 deletions cmake/CMakeRustCompiler.cmake.in

This file was deleted.

Loading
Loading