Git Product home page Git Product logo

gadgetdeck's Introduction

GadgetDeck

This is a program to emulate a game controller on the Steam Deck when connected over USB to another computer.

How it works

The USB port on the Steam Deck is a USB Dual Role Port. This means that, like most phones, it can act as a USB host or device. This is possible with the DWC3 (DesignWare Core SuperSpeed 3.0) controller in the AMD CPU.
Using LibComposite, we can emulate a wide variety of USB devices. In this case, an HID device is emulated that has some game controller inputs.

Prerequisites

  • A password set for the deck user
  • SSH enabled

How to use

1. Enable USB Dual Role Device

On the Steam Deck, boot into the BIOS by holding the VOLUME UP button and pressing the power button and go to setup utility. Navigate to Advanced>USB Configuration>USB Dual Role Device and change from XHCI to DRD. Then Exit>Exit Saving Changes.

2. Install GadgetDeck

In a terminal, run

curl -s https://raw.githubusercontent.com/Frederic98/GadgetDeck/main/setup | sudo bash

This should download and install GadgetDeck and everything it needs to work. When this is done, you should have a new item in your Steam library under non-steam.
❗It is possible that it shows up as a blank tile without a name. This should be fixed after a reboot.

Start GadgetDeck, and assign actions to all inputs appropriately. When this is done, connect your Deck to a PC and test if the keyboard and mouse work.

On your computer, search game controllers and open Set up USB game controllers. Move the Steam Deck joysticks, and this should be reflected on your computer.

In Steam on your computer, go to settings->Controller->General controller settings and enable Generic gamepad configuration support.
Then, click the steam deck and map all the buttons to a controller layout.

3. Disable GadgetDeck

Not really necessary. But, to stop the USB gadgets, either reboot the Deck, or, in a terminal, type systemctl stop gadget-deck-base.

Planned improvements

  • Ethernet gadget for local multiplayer by connecting two Steam Decks to each other (Might need to disable charging on both to prevent one from draining the other)
  • MTP gadget to browse Steam Deck files from computer
  • UVC gadget for streaming game to computer without the use of an HDMI capture card

gadgetdeck's People

Contributors

frederic98 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

unphased

gadgetdeck's Issues

string.h No such file or directory

Hello, this is not working very well for me, when I run make I get this error

g++ -std=c++11 -o SteamworksPy.so -shared -fPIC SteamworksPy.cpp -l steam_api -L.

In file included from sdk/steam/steam_api_common.h:233,
from sdk/steam/steam_api.h:21,
from SteamworksPy.cpp:16:
sdk/steam/steam_api_internal.h:14:10: fatal error: string.h: No such file or directory
14 | #include <string.h>
| ^~~~~~~~~~
compilation terminated.
make: *** [Makefile:2: makeall] Error 1

Installation fails with the message: "make: command not found. bash: Line 1: make: Command not found." and chmod: Access to '/usr/share/gadget-deck/GadgetDeck/GadgetDeck' not possible: Is not a directory"

Hello@all. I'm having problems installing it. First I had to use "sudo steamos-readonly disable", after which I now get this message:
"bash: Line 1: make: Command not found.
bash: Line 13: make: Command not found.
chmod: Cannot access '/usr/share/gadget-deck/GadgetDeck/GadgetDeck': Is not a directory
Usage: steamos-add-to-steam [-ui] "

Trying to get this thing to work!

The makefile directly runs pyinstaller as well as pip. None of which are available. I tried pacman -S python-pip which installed fine but that gave me

pip install -r requirements.txt
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try 'pacman -S
    python-xyz', where xyz is the package you are trying to
    install.

    If you wish to install a non-Arch-packaged Python package,
    create a virtual environment using 'python -m venv path/to/venv'.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip.

    If you wish to install a non-Arch packaged Python application,
    it may be easiest to use 'pipx install xyz', which will manage a
    virtual environment for you. Make sure you have python-pipx
    installed via pacman.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
make: *** [Makefile:31: install] Error 1

Based on the readme you have stated that I only need ssh and a user password set up. I think that is not a comprehensive list.

Unable to Properly Install

Hey. I'm having some sort of issue while trying to install. I tried to install some times before, but was unable to due to the system being read-only, but it still is having issues unfortunately. It keeps trying to overwrite a folder within the gadget-deck that doesn't exist, and I cannot create that folder or have it make that folder itself. Listing the issue:

cp: cannot overwrite non-directory '/usr/share/gadget-deck/GadgetDeck' with directory 'GadgetDeck'
chmod: cannot access '/usr/share/gadget-deck/GadgetDeck/GadgetDeck': Not a direcfory
Usage: steamos-add-to-steam [-ui] <path>

It doesn't show up on Steam or the app launcher, so I'm unsure what to do. New to stuff like this, so maybe I'm doing something wrong.

This may help

I'm also planning out a USB Gadget Utility on a different platform (Ubuntu Touch on Pinephone Pro).

Thought you might be able to make use of this list I wrote on Reddit:

I added your utility to it, even if it isn't in a working state. Don't feel too bad. Most of the items in that list probably aren't in a working state either, but it should give you a plethora of source code to gloss over. That's the plan for how I intend to use it once my Pinephone Pro arrives.

GadgetDeck Doesn't Run

Hey, I submitted an issue earlier but I thought I fixed it, but sadly to no luck.
I installed everything, GadgetDeck showed up in my Steam library, but running it does nothing. It does pop up a copy of SpaceWar in my library, though. Nothing opens, it just goes back to the regular screen.

Off-topic: SteamworksPy collaboration

Hi - I saw you have some recent contributions to SteamworksPy, something I'd like to add features to. I'm wondering if you'd like to collaborate or even pair on a feature. Sorry for this being kinda off-topic, but I didn't have any other way of contacting you (unless I subscribed to LinkedIn premium but I didn't know if you'd see my message if I went that way).

Idea for allowing Steam Input support

Hi!
Just wanted to note that the Deck's controller appears internally as a USB device, and I've had luck using software like VirtualHere to instead "plug" the controller into my PC's USB wirelessly, and it essentially acts like the deck's inputs are plugged into the PC instead of the Deck. Everything steam input-related works (mostly...) Trackpads, back buttons, capacitive touch on the joysticks, only thing that doesn't really get transferred over is the touch screen.
As of late, it seems to have gotten a bit wonky for me for some reason (Doesn't control the desktop once Steam loads up the desktop control config, sometimes doesn't work on games?) but until recently it was working as it should.
Anyway, it'd be nice to have the same thing done with this as VirtualHere does.

No input on host (Linux)

I have loaded your script as per the instructions with no errors.

Shows up on Arch Linux host machine as controller but none of the inputs are coming through.

I have tried with Steam running, Steam shut down, and hid_steam unloaded on the Deck with the same result.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.