moonlight-stream / moonlight-qt

GameStream client for PCs (Windows, Mac, Linux, and Steam Link)
GNU General Public License v3.0
10.41k stars 610 forks source link

Moonlight Menu (UI) not detecting steam controller on steam link hardware #697

Closed sixcuda closed 6 months ago

sixcuda commented 2 years ago

Describe the bug

I have moonlight installed on my steam link hardware. I'm using a steam controller connected via dongle. The steam controller works fine using steam, but once I enter the Moonlight app, it will not detect the controller. I'm totally unable to navigate the moonlight UI, and the only option to exit is to unplug the steam link and restart. The controller worked previously, but I don't know what has changed.

I've tried a factory reset on the steam link, and reinstalled moonlight with no success.

Steps to reproduce

Steam controller connected to steam link hardware via dongle, open the moonlight app and the controller no longer functions

Screenshots n/a

Affected games n/a

Other Moonlight clients n/a

Moonlight settings (please complete the following information) Default

Gamepad-related issues (please complete if problem is gamepad-related)

I typically use the steam controller to navigate the steam link. Then I have an xbox series x controller connected to my host pc via bluetooth that I use once I am in the game. The issue persists whether I have the xbox controller on or off

Client PC details (please complete the following information)

Steam link build: 827 Moonlight: 3.1.4 steam controller firmware is up to date

Server PC details (please complete the following information)

OS: Windows 10 21H2 GPU: GTX 1060 (msi laptop) Geforce driver: 496.76 Geforce Experience: 3.24.0.126 Antivirus and firewall software: Default Windows Defender and Windows Firewall

Moonlight Logs (please attach) not sure how to produce logs from steam link hardware

Additional context Thanks for your help

fearlessfrog commented 2 years ago

Same issue for me. Seems related to a Steam Link system update that occurred on Dec 17th. Patch notes and other issues reported here: https://steamcommunity.com/app/353380/discussions/0/4328520278443987007/

sixcuda commented 2 years ago

Ahh, you are correct. I didn't realize that there had been an update. I rolled the steam link firmware back to build 822 and now it is working normal again.

Thanks for your reply. I thoroughly searched for this issue and came up with nothing, which is why I ultimately posted here. I'm glad it's not just me.

komali2 commented 2 years ago

How did you roll back? Factory reset?

Btw are you able to have the steam controller work "raw" through the link and moonlight? I saw a post from 2019 that says this is impossible so I'm curious about your set-up.

ian-jones commented 2 years ago

Rolling back to a specific firmware version is described here: https://help.steampowered.com/en/faqs/view/3F04-3833-414D-454C

Rolling back to 822 resolved this issue for me as well.

I've always used Steam controller to play games via Steam link and moonlight. I don't recall having to do anything specific to get it working.

priest282 commented 2 years ago

is there a fix being worked on? does it have to be valve doing the fix?

cgutman commented 2 years ago

I think Valve will have to fix it, since it was a Steam Link firmware change that broke it. SDL (which is used by Moonlight for input) is shipped with the Steam Link firmware.

mindset-tk commented 2 years ago

just an fyi for anyone finding this, as of steamlink firmware 830 beta, this issue still exists. It does not only apply to steam controllers; it also applies for wired xbox controllers. the fix is still to roll back to firmware 822.

cgutman commented 2 years ago

Please try on firmware 842 or later. Possibly a duplicate of #816.

Limekiller commented 2 years ago

Unfortunately this still isn't working on 846. I had to revert to 822 again.

KronemeyerJoshua commented 1 year ago

Build 850 states "Fixed regression preventing Steam Controllers from working"

Does not fix this issue and is still present in builds 850 and 851.

Draxionx commented 1 year ago

Still doesn't seem to be working :(

ThierryBegin commented 1 year ago

Same here, I have similar issue with steamdeck too

BoringName15 commented 9 months ago

This is still an issue. Strangely if I connect the steam controller with a cable instead of bluetooth, it will work for about 5 seconds and then stop again. Unplugging the controller and plugging it in again allows it to work for another 5 seconds. I also plugged in a second generic controller, this didn't stop working but only the A and B buttons would do anything.

edit: Just editing this to list everything I worked out.

If you have the steam controller connected via bluetooth with the dongle in and start moonlight with a sunshine host running, the controller won't work at all. But if you start moonlight and there is no host ready to connect to, the trackpad and trigger buttons will work as a mouse but no other buttons will work. At this point if you connect the controller with a USB cable (leaving the dongle inserted) it will freeze after 5 seconds. Unplugging the cable at this point will switch off the controller, if you leave the cable unplugged and push the steam button on the controller it will now start working with all buttons on the controller active except X and Y.

Starting sunshine and then Launching steam big picture at this point works but steam doesn't detect the controller at all and the controller just emulates keyboard buttons. RT, LT - Mouse right, Mouse left LB, RB - Tab, Can't remember what RB did... A - Space B - Enter Joystick - ArrowUp, ArrowDown, ArrowLeft, ArrowRight Left Grip - F9 Right Grip - F7 Trackpad - mouse pointer X - Doesn't register at all Y - Doesn't register at all

Some of those keys might be back to front but you get the idea.

If I could figure out how to get X and Y to work it would be usable. I've tried switching XY/AB buttons in moonlight config but it does nothing, probably because it doesn't detect it as a controller.

CommandingCS commented 8 months ago

If I could figure out how to get X and Y to work it would be usable. I've tried switching XY/AB buttons in moonlight config but it does nothing, probably because it doesn't detect it as a controller.

I've figured out a somewhat convoluted process to get the steam controller working once you launch moonlight with current firmware: You'll have to have the BTE firmware installed on the SC, which needs you to roll back Steam to the 5-30-2023 build so you can properly install the firmware. This is also how you can pair the dongle to the controller, or pair the controller directly to the Steam Link without a dongle.

Go to the bluetooth devices screen on the link, turn off the controller and put it into bt pairing mode (Steam+Y), connect a keyboard to the link, the controller should automatically connect to bluetooth here (I had already paired it previously, you might have to play with that, bluetooth acts strange) and then start moonlight, then turn off the controller and restart with node pairing(Steam+A) and it will start working in moonlight. Then you can launch, use the X button to modify, etc.

BoringName15 commented 8 months ago

You'll have to have the BTE firmware installed on the SC, which needs you to roll back Steam to the 5-30-2023

You don't have to roll back steam. They released an update tool https://www.reddit.com/r/SteamController/comments/16jp7sg/psa_for_anyone_in_need_of_a_firmware_update_for/

Since installing Moonlight, when I pair with bluetooth it lists the steam controller twice on the steamlink and all inputs are duplicated. The weird part is I have factory reset the Steam Link to remove Moonlight, re-flashed the firmware on the controller with the tool above, removed all controllers and reset bluetooth on the Steam Link even though a factory reset should have done that anyway.

Still no fix. Tried rolling back to older versions of Steam link firmware back to 870. I have to use wifi instead which chews through batteries. It's just so bizarre it only started happening after installing moonlight and nothing will fix it.

The only thing that makes sense is some kind of hardware issue that coincidentally occurred when I installed moonlight. Either that or somehow installing moonlight changed something on the steam link that even a factory reset doesn't revert which seems unlikely. I've got no dongles or anything else plugged into the Steam Link. It really makes no sense.

CommandingCS commented 8 months ago

You don't have to roll back steam. They released an update tool https://www.reddit.com/r/SteamController/comments/16jp7sg/psa_for_anyone_in_need_of_a_firmware_update_for/

I'm familiar with this update tool, it was not useful for me as it caused my controller to lose dongle connection at the cost of being able to connect via bluetooth. The Steam rollback is reliable, works to pair and update/rollback FW, and really only needs to be done once, so I'd rather have it do the trick.

Steam link firmware back to 870. I have to use wifi instead which chews through batteries

Firmware 822 will still use the native dongle (you can also pair the controller directly to the hardware Steam Link without a dongle with the old Steam version) connection if you launch moonlight so it won't chew through batteries. But I cannot get a current version of Moonlight to launch with that old of a fw, it causes memory addressing issues and crashes when it tries to stream. I am looking into if it's possible to build a version of moonlight that doesn't memory fault on this fw version but it's a longshot. Have you had luck with fw870 not crashing when Moonlight starts the stream? The process I described will get the controller working with current firmware but is a real pain in the ass.

EDIT: Also, in my experience the Bluetooth acts very strange with the old hardware Steam Link. I think that is part of why it stopped working with Steam Link firmware 822 properly. It will act like a brand new bluetooth connection each time I turn the controller off. I have seen some people talking about the firmware update changing the Steam+? combinations on the controller, including Steam+Y turning the controller off. I have not experienced this personally, I have to re-seat a battery to power cycle the controller. What is your experience with this?

BoringName15 commented 8 months ago

I'm familiar with this update tool

There is 2 versions floating around, one has a newer firmware and I had no issues with that. My controller functions normally with it as bluetooth or wifi. Steam+Y puts it into bluetooth pairing mode like it is supposed to. But it didn't fix my double up issue.

I only recently realised the dongle isn't necessary. I guess it's only needed to pair to a PC.

I haven't re-tried anything in Moonlight, after I couldn't get the controller to work properly I stopped trying to use it and after my double up issue, I reset the Steam Link to factory settings to remove Moonlight.

Even if 822 did work I wouldn't want to keep it on that. The Steam Link used to have issues waking up when I pushed the steam button and those issues got fixed around 875. I just rolled back to 870 as I thought it might have been a pairing issue with newer firmwares and I was hoping I could pair it on an old one and update back to 883, keeping the pair intact. I was wrong. The fact it keeps pairing intact when updating firmware does make me think something has been altered that flashing firmware won't overwrite.

I was mainly playing with Moonlight as I was going to pair it with Sunshine so I could use the Steam Link with all my games without having to add them all to steam, but I now just use Playnite and launch that from steam. It does the job.

komali2 commented 8 months ago

This is still an issue. Strangely if I connect the steam controller with a cable instead of bluetooth, it will work for about 5 seconds and then stop again. Unplugging the controller and plugging it in again allows it to work for another 5 seconds. I also plugged in a second generic controller, this didn't stop working but only the A and B buttons would do anything.

edit: Just editing this to list everything I worked out.

If you have the steam controller connected via bluetooth with the dongle in and start moonlight with a sunshine host running, the controller won't work at all. But if you start moonlight and there is no host ready to connect to, the trackpad and trigger buttons will work as a mouse but no other buttons will work. At this point if you connect the controller with a USB cable (leaving the dongle inserted) it will freeze after 5 seconds. Unplugging the cable at this point will switch off the controller, if you leave the cable unplugged and push the steam button on the controller it will now start working with all buttons on the controller active except X and Y.

Starting sunshine and then Launching steam big picture at this point works but steam doesn't detect the controller at all and the controller just emulates keyboard buttons. RT, LT - Mouse right, Mouse left LB, RB - Tab, Can't remember what RB did... A - Space B - Enter Joystick - ArrowUp, ArrowDown, ArrowLeft, ArrowRight Left Grip - F9 Right Grip - F7 Trackpad - mouse pointer X - Doesn't register at all Y - Doesn't register at all

Some of those keys might be back to front but you get the idea.

If I could figure out how to get X and Y to work it would be usable. I've tried switching XY/AB buttons in moonlight config but it does nothing, probably because it doesn't detect it as a controller.

I might be wrong, but I vaguely remember that steam controllers "remember" certain kinds of configs. For example, I kept having issues with the "steam chords" messing up all sorts of stuff for me, so one day I went and deleted all the "steam chords," and then I found out that the steam controller couldn't turn off with steam + y even if it wasn't paired or connected with anything.

So perhaps if you create a default desktop config for it with x and y mapped to something, that might work?

DistractionRectangle commented 7 months ago

Just ran into this as a recent owner of a steamlink + steam controller. SDL docs are... not great.

Apparently the steam link ships with a (custom?) build of 2.27.0, and the closes tag I could find was 2.27.1, which was close enough for debugging purposes.

Turns out, the fix is ridiculously simple, this is supposed to default to enabled but for whatever reason it's disabled on the steamlink,

Adding export SDL_ENABLE_STEAM_CONTROLLERS=1 to moonlight.sh fixes steam controller detection for moonlight on the steamlink.

CommandingCS commented 7 months ago

Wow, nice work on tracking down the source of this!

Apparently the steam link ships with a (custom?) build of 2.27.0, and the closes tag I could find was 2.27.1, which was close enough for debugging purposes.

Where did you figure that out?

DistractionRectangle commented 7 months ago

I made a custom moonlight build for more verbose logging and testing. SDL has an API for printing the version, but it's also encoded in the name of the compiled shared object file, so you can read it out over ssh. After I determined that SDL wasn't enumerating steam controllers at all, but enumerating several other controllers just fine, I checked out a similar tag in the public repository and looked around for anything related to steam/valve that might be/explain the problem.

BoringName15 commented 7 months ago

Nice work. Kind of hilarious how easy that fix is. I might re-install moonlight on the steam link and see if it fixes my bluetooth problem, probably won't but worth a shot.

I assume I just extract the zip to a USB, open moonlight.sh in a text editor and add "export SDL_ENABLE_STEAM_CONTROLLERS=1" to the bottom of the file before inserting the USB into the steamlink?

DistractionRectangle commented 7 months ago

I assume I just extract the zip to a USB, open moonlight.sh in a text editor and add "export SDL_ENABLE_STEAM_CONTROLLERS=1" to the bottom of the file before inserting the USB into the steamlink?

You have to add it before the call to execute moonlight, the line after HOME is defined is a good spot.

BoringName15 commented 7 months ago

You are a dead set legend.

It didn't fix my doubled up bluetooth controller issue. There are still 2 controllers listed in the bluetooth controller window. I tried all the things I've tried before, removing the controllers, resetting bluetooth etc... none of it worked.

But when playing around with Moonlight (that now works) I noticed it wasn't duplicating commands in that interface so I launched a game through steam big picture (not through moonlight) and that didn't duplicate commands either. It appears to only be an issue when on the steam links main interface which I can live with.

The silly thing is it only seems to duplicate up and down commands, left and right is fine.

Launched Mortal Kombat 11 through Moonlight+Sunshine and that worked perfectly!

If you have a bunch of games spread across different launchers, I highly recommend Playnite. You can launch it through steam big picture (what I currently do) or Sunshine which is what I'm about to start playing around with now Moonlight actually works!

Anyway, thank you very much.

DistractionRectangle commented 6 months ago

It didn't fix my doubled up bluetooth controller issue. There are still 2 controllers listed in the bluetooth controller window. I tried all the things I've tried before, removing the controllers, resetting bluetooth etc... none of it worked.

But when playing around with Moonlight (that now works) I noticed it wasn't duplicating commands in that interface so I launched a game through steam big picture (not through moonlight) and that didn't duplicate commands either. It appears to only be an issue when on the steam links main interface which I can live with.

The silly thing is it only seems to duplicate up and down commands, left and right is fine.

Launched Mortal Kombat 11 through Moonlight+Sunshine and that worked perfectly!

If you have a bunch of games spread across different launchers, I highly recommend Playnite. You can launch it through steam big picture (what I currently do) or Sunshine which is what I'm about to start playing around with now Moonlight actually works!

Anyway, thank you very much.

I can't reproduce the doubling issue (two bt controllers listed in the bluetooth menu, I just see one) with my controller. There was two versions of the firmware floating around and one of them is supposedly problematic. To ensure I got the correct firmware, I used the method to downgrade steam and used steam to do the BLE update. I can reproduce the double input with the stick. It seems the stick is very sensitive and registers multiple left/right/up/down events, but using the left trackpad as a dpad works fine. It's likely due to the controller mapping that's associated steam controllers when they connect via bluetooth (they get a different GUID and get a different gamepad mapping). You could experiment with a custom mapping with an SDL hint in rc.local.

My upstream issue has closed as confirmed, with a fix promised in the next firmware release 🎉So we can probably close this issue out @cgutman

I'm not really sure this warrants a PR since it'll be fixed upstream, and anyone tracking this that would download and flash a nightly can just as readily add export SDL_ENABLE_STEAM_CONTROLLERS=1 to moonlight.sh just below where HOME is defined, but I'll leave to your discretion.

BoringName15 commented 6 months ago

It's a very strange issue. On wifi everything is fine, switch to bluetooth and it displays 2 controllers. Up/down and button commands are all doubled up. When it persisted after a factory reset I questioned my reality.

At this point I'm not too worried about it, I spend very little time in the steamlink UI and I can easily switch left and right to choose Moonlight or Steam, after which the problem is gone so I'm ok with that.

I saw that other ticket got confirmed and closed so that's great.

In other news, Moonlight + Sunshine + Playnite is pretty great. When launching Playnite through steam I had issues with the controller on game exit. None of those issues with Sunshine.

BoringName15 commented 6 months ago

Well ok, it is a problem. This is probably off topic now and I should post in the steam forums but I'll just add what I found out in case it helps someone figure it out because I'm stumped and I've already talked about it a lot in here.

I've just realised in bluetooth mode, the right trackpad doesn't work as a mouse. It only works as a directional pad (without clicking, just haptics). This is even just in the Steam Link UI so it's not some config issue with moonlight or steam.

In wifi mode, when I swipe over the right trackpad a mouse icon appears and moves around the screen. In bluetooth mode, when I swipe over the trackpad it just changes what is selected like I'm just using the joystick, no mouse cursor appears.

With the 2 steam controllers listed, when I select the first one and hit A to test the buttons, all the buttons work except the haptic on the right trackpad. When I select the second one, all the buttons work except the haptic on the left trackpad.

So it's like the controller has added itself twice but only one trackpad works on each. So friggin weird.

I guess I've probably busted something when pulling the cable in and out when I initially tried to get it working in moonlight. It's the only thing that makes any sense. I don't think it's the firmware because I didn't play around with that until after the double up issue occurred.

Anyway, I'll take it to the steam forums. Or I'll just keep using wifi and live with it...

komali2 commented 6 months ago

Just ran into this as a recent owner of a steamlink + steam controller. SDL docs are... not great.

Apparently the steam link ships with a (custom?) build of 2.27.0, and the closes tag I could find was 2.27.1, which was close enough for debugging purposes.

Turns out, the fix is ridiculously simple, this is supposed to default to enabled but for whatever reason it's disabled on the steamlink,

Adding export SDL_ENABLE_STEAM_CONTROLLERS=1 to moonlight.sh fixes steam controller detection for moonlight on the steamlink.

You're a hero for sharing the fix after finding it!

DistractionRectangle commented 4 months ago

This fix appears to have finally landed upstream in new steam link beta builds 886/887, funny how this coincides with this landing in the moonlight v6.0.0 release today!