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

PC Volume control #27

Merged
merged 9 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,20 @@ This allows to support a large number of Windows games without any fixes.
| Battery | ✅ | PS Vita's battery status is sent to the emulated DualShock 4 |
| Any configuration | ✅ | You can choose from [ready-made configurations](#33-configurations) |
| DS4Windows support | ✅ | Virtual Controller Support[*] requires activation |
| Sound | ❌ | Probably will never be realized |
| Changing the sound volume | ✅ | Volume Up = Select + R1, Volume Down = Select + L1 |
| Sound sending | ❌ | Probably will never be realized |

[*] - Virtual Controller Support can be found in the [schmaldeo DS4Windows fork](https://github.com/schmaldeo/DS4Windows).
This option can be found in `Settings -> Device Options -> Virtual Controller Support`.

### 4.2 Linux Client

The behavior is close to how the DualShock 4 (`vendor: 0x054C`, `product: 0x9CC`) is defined in Linux. Three `uinput` devices are emulated:
The behavior is close to how the DualShock 4 (`vendor: 0x054C`, `product: 0x9CC`) is defined in Linux. Four `uinput` devices are emulated:

- Main `uinput` device (Dpad, Sticks, buttons, triggers)
- Touchpad `uinput` device;
- Motion Sensors `uinput` device for accelerometer and gyroscope.
- Motion Sensors `uinput` device for accelerometer and gyroscope;
- Keyboard `uinput` device.

| Feature | Support | Details |
| ------------------------------- | :-----: | ----------------------------------------------------------------------------------------------------------------- |
Expand All @@ -166,7 +168,8 @@ The behavior is close to how the DualShock 4 (`vendor: 0x054C`, `product: 0x9CC`
| DualShock 4 digitizer button | ✅ | Works as a quick tap on the digitizer. Supports front and rear digitizer. Linux itself determines the behaviour |
| Battery | ❌ | - |
| Any configuration | ✅ | You can choose from [ready-made configurations](#33-configurations) |
| Sound | ❌ | Probably will never be realized |
| Changing the sound volume | ✅ | Volume Up = Select + R1, Volume Down = Select + L1 |
| Sound sending | ❌ | Probably will never be realized |

You can also use a convenient input signal remapper, such as [antimicrox](https://github.com/AntiMicroX/antimicrox/)
or [input-remapper](https://github.com/sezanzeb/input-remapper).
Expand Down
81 changes: 73 additions & 8 deletions client/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions client/packages/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cli"
version = "1.1.1"
version = "1.2.0"
edition = "2021"

[dependencies]
Expand All @@ -14,7 +14,7 @@ flatbuffers_structs = { version = "0.1.0", path = "../flatbuffers_structs" }
protocol = { version = "0.1.0", path = "../protocol" }
vita_reports = { version = "0.1.0", path = "../vita_reports" }
vita_virtual_device = { version = "0.1.0", path = "../vita_virtual_device" }
serde = { version = "1.0.214", features = ["derive"] }
serde = { version = "1.0.215", features = ["derive"] }
config = "0.14.1"
toml = "0.8.19"
home = "0.5.9"
Expand Down
2 changes: 1 addition & 1 deletion client/packages/protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ flatbuffers_structs = { path = "../flatbuffers_structs" }
thiserror = "2.0.3"
vita_reports = { path = "../vita_reports" }
tokio-util = { version = "0.7.12", optional = true, features = ["codec"] }
bytes = { version = "1.8.0", optional = true }
bytes = { version = "1.9.0", optional = true }

[features]
codec = ["dep:tokio-util", "dep:bytes"]
4 changes: 4 additions & 0 deletions client/packages/vita_reports/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ pub struct ButtonsData {
pub circle: bool,
pub cross: bool,
pub square: bool,
pub vol_up: bool,
pub vol_down: bool,
// timestamp: u64;
}

Expand All @@ -30,6 +32,8 @@ impl From<flatbuffers_structs::net_protocol::ButtonsData> for ButtonsData {
circle: buttons.circle(),
cross: buttons.cross(),
square: buttons.square(),
vol_up: buttons.vol_up(),
vol_down: buttons.vol_down(),
// timestamp: buttons.timestamp(),
}
}
Expand Down
9 changes: 8 additions & 1 deletion client/packages/vita_virtual_device/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ edition = "2021"
cfg-if = "1.0.0"
derive_builder = "0.20.2"
rstar = { version = "0.12.2", features = ["serde"] }
serde = { version = "1.0.214", features = ["serde_derive"] }
serde = { version = "1.0.215", features = ["serde_derive"] }
thiserror = "2.0.3"
vita_reports = { version = "0.1.0", path = "../vita_reports" }

Expand All @@ -18,3 +18,10 @@ input-linux = "0.7.1"

[target.'cfg(windows)'.dependencies]
vigem-client = { git = "https://github.com/santarl/vigem_client_rust/" }
windows = { version = "0.58", features = [
"Win32_Foundation",
"Win32_Media_Audio",
"Win32_Media_Audio_Endpoints",
"Win32_System_Com",
"Win32_UI_Input_KeyboardAndMouse",
] }
Loading
Loading