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

[BUG] chiaki4deck lag after 5 minutes, restart completely fixes it. #230

Open
AndrewMC1994 opened this issue Jan 25, 2024 · 53 comments
Open

Comments

@AndrewMC1994
Copy link

Describe the bug
Whenever I use chiaki4deck I start getting very bad lag after 5 min of play. Restarting chiaki seems to fix the issue as I can then play for hours without issue. Im using the newest update of chiaki4deck, 720p, dfeault bitrate with h265. It’s not a huge issue since restarting the app fixes it but if it's a known issue.

To Reproduce
Play a game for 5 minutes or so and see if it lags, then restart.

Expected behavior
I would expect if it runs fine after restarting, there must be a specific cause why it had issues intially.

Desktop (please complete the following information):

  • OS: SteamOS
  • Latest
  • OLED Steam Deck
  • Chiaki4deck Version - Latest
@TedMosly
Copy link

Same problem, i get many packets drop...

@jonginator
Copy link

I had the same issue.

Downgrading to v1.6.1 fixed it.

@streetpea
Copy link
Owner

Can you try toggling on and off the wifi when this happens and see if that helps and report back. People had reported this when resuming their console from sleep instead of turning it off completely with moonlight so I want to see if maybe that is happening here as well…

@streetpea
Copy link
Owner

Also please post a log of this happening with verbose logs enabled. This helps us to determine what is going wrong as without that we can only guess at the problem.

@jonginator
Copy link

Can you try toggling on and off the wifi when this happens and see if that helps and report back. People had reported this when resuming their console from sleep instead of turning it off completely with moonlight so I want to see if maybe that is happening here as well…

I think that this might be the case.

Updated back to 1.6.2, played for a while, recommended settings, no issues.

Put the deck in sleep mode, came back half an hour later, I would constantly get terrible stuttering to complete connection loss about 5 mins later no matter what bitrate I chose.

I turned WiFi off for a few seconds, turned it back on, no issues again.

I even raised the bitrate to 50000, absolutely zero network issues.

Looks like some hardware or driver level bug related to the WiFi module.

@AndrewMC1994
Copy link
Author

Can you try toggling on and off the wifi when this happens and see if that helps and report back. People had reported this when resuming their console from sleep instead of turning it off completely with moonlight so I want to see if maybe that is happening here as well…

Yes, that would make sense. It occurs when I resume my PS5 from sleep and then play for 5 minutes and then lag/stutter. Then the restart fixes it. I'll get a log for you shortly.

@AndrewMC1994
Copy link
Author

Also please post a log of this happening with verbose logs enabled. This helps us to determine what is going wrong as without that we can only guess at the problem.

Log attached, the end of the file will be where it started to lag

chiaki_session_2024-01-27_15-03-13-646646.log

@sillikuningas
Copy link

Experiencing exactly the same problems here

@olivierrivard
Copy link

I have the same issue.

@deedeeped
Copy link

Yep, I mentioned this in another issue. Seems widespread. It’d be awesome if we could get a stream that doesn’t need resetting someday! Purportedly, Valve is aware of this.

@IvarLJ
Copy link

IvarLJ commented Feb 20, 2024

Same thing for me. Putting the Deck to sleep and then waking it up again makes everything hunky dory again. Other than this chiaki is nearly flawless for me, so hope this gets fixed.

@deedeeped
Copy link

Alright, I fixed it. @streetpea , you might want to also see this since it’s been with us since the OLED’s appearance and you’ll likely see a bunch of issues raised here as we go. For my ASUS mesh setup, here is the solution to the strange drop in connection which necessitated a WiFi restart:

  1. I reserved an IP (ipv4) address for the Deck in the router settings.
  2. I went to the WiFi settings for the deck in desktop mode and created a manual IP configuration for ipv4. I assigned my router-designated IP address there. The subnet populated automatically, and for gateway, you’ll need to input your router’s IP address (not the WAN IP, but the actual beginning of you DHCP pool).
  3. I disabled (note: not “ignored”) ipv6.

Since I’ve done this, I have had no more disconnections. It might work for you!

@cartman61616
Copy link

Alright, I fixed it. @streetpea , you might want to also see this since it’s been with us since the OLED’s appearance and you’ll likely see a bunch of issues raised here as we go. For my ASUS mesh setup, here is the solution to the strange drop in connection which necessitated a WiFi restart:

  1. I reserved an IP (ipv4) address for the Deck in the router settings.
  2. I went to the WiFi settings for the deck in desktop mode and created a manual IP configuration for ipv4. I assigned my router-designated IP address there. The subnet populated automatically, and for gateway, you’ll need to input your router’s IP address (not the WAN IP, but the actual beginning of you DHCP pool).
  3. I disabled (note: not “ignored”) ipv6.

Since I’ve done this, I have had no more disconnections. It might work for you!

I tried this last night on my deck and still getting the discount after 5 minutes sadly. Flipping the wifi off and back on fixes it which is fine but annoying at times.

@streetpea
Copy link
Owner

Can someone still facing this issue post a recent log? There is some more logging now so it may help see if this is connected to other issues.

@wx40217
Copy link

wx40217 commented Mar 31, 2024

chiaki_session_2024-03-31_20-19-06-710710.log
chiaki_session_2024-03-31_20-19-25-531531.log
chiaki_session_2024-03-31_20-20-32-100100.log
chiaki_session_2024-03-31_20-22-53-155155.log
Here are my logs. They are unexpectly huge and hardly recognize which is useful so I upload all of them.

@olivierrivard
Copy link

Hi,

Here are more logs.
Let me know if you need more logs

chiaki_session_2024-03-30_22-24-07-096096.log

@gdiazbanuelos
Copy link

Alright, I fixed it. @streetpea , you might want to also see this since it’s been with us since the OLED’s appearance and you’ll likely see a bunch of issues raised here as we go. For my ASUS mesh setup, here is the solution to the strange drop in connection which necessitated a WiFi restart:

  1. I reserved an IP (ipv4) address for the Deck in the router settings.
  2. I went to the WiFi settings for the deck in desktop mode and created a manual IP configuration for ipv4. I assigned my router-designated IP address there. The subnet populated automatically, and for gateway, you’ll need to input your router’s IP address (not the WAN IP, but the actual beginning of you DHCP pool).
  3. I disabled (note: not “ignored”) ipv6.

Since I’ve done this, I have had no more disconnections. It might work for you!

I tried this last night on my deck and still getting the discount after 5 minutes sadly. Flipping the wifi off and back on fixes it which is fine but annoying at times.

I have the general issue on my OLED Steam Deck too. It seems to be a general WIFI problem. If I wake up my Steam Deck from sleep and try to download all the shader cache updates they can take 10 minutes even though they are only less than 50mb. Or if I wake up from sleep and go to desktop mode to update my flatpak from the Discover store, it can take several minutes to update a few mb worth of updates.

Based off this thread, I have started having the habit of restarting my wifi on each boot from sleep. Not sure if this can be fixed by Valve or if this only affect certain OLED models?

@jonginator
Copy link

I'm not sure if there is anything can be done to realistically fix it.

This is an issue I've noticed on all streaming services or apps. This happens on Moonlight, GFN, and XCloud.

The only work around is to just quickly browse through WiFi and Bluetooth in quick menu and then go back to the game.

This is clearly a driver level issue that Valve must fix themselves.

@TBhimdi
Copy link

TBhimdi commented May 27, 2024

Just a heads up, I'm still having this issue on my Asus ROG Ally, this was with 1.7.0 and PS5 Slim on ethernet (also occurred with my previous regular PS5). Downgrading down to 1.6.1 fixes the issue. Don't have any issues with Moonlight streaming from my PC, so not a streaming issue with my wifi or the ROG Ally. I'll post 1.7.0 logs later if still needed (I already saw latest logs with the issue above).

@streetpea
Copy link
Owner

@TBhimdi it is likely you are experiencing a different issue with similar symptoms. Does toggling the wifi on and off fix your issue as well on the rog ally. With the Steam deck ppl experiencing this can usually just toggle the wifi on and off and then it will work fine afterwards for the duration of the play session.

@TBhimdi
Copy link

TBhimdi commented May 27, 2024

Toggling the wifi on/off or exiting/restarting chiaki4deck do the same thing, fix the issue for X minutes then it comes back. I have only found 2 solutions:

For 1.7.1: Use ethernet (via USB to ethernet adapter). Not feasible most of the time with ROG Ally.
or
Use 1.6.1 (which works fine via wifi)

I haven't had any issues with download speeds or streaming as others have with their Steamdeck in other apps that require toggling wifi. Even after Chiaki4deck exhibits these issues, I can run a speedtest or download from Steam at full wifi speeds on the device.

@streetpea
Copy link
Owner

streetpea commented May 27, 2024

@TBhimdi i am able to reproduce the issue on my Steam Deck oled model but it’s different than what you’re experiencing. It only happens if the Steam deck is turned on from sleep mode and is fixed for the duration the Steam deck is on once I toggle the wifi on and off once (either before using Chiaki4deck or while using both work) and then lasts until I put the Steam deck back into sleep mode and wake it up again. It also affects Steam downloads as well so you are likely facing a different issue than what the other ppl are experiencing on the Steam Deck and it is worth looking into

@streetpea
Copy link
Owner

@TBhimdi can you try this build https://github.com/streetpea/chiaki4deck/actions/runs/9262243115/artifacts/1542500876? I reverted some of the changes made for 1.6.2 so maybe one of them will fix your issue? lmk

@TBhimdi
Copy link

TBhimdi commented May 28, 2024

I just spent the last 20 minutes alternating between v1.6.1, v1.7.1, and the above v1.7.1VC build you linked.

v1.6.1: No issues, could not replicate the "bad bitrate" blockiness
v1.7.1: Replicated the problem every time
v1.7.1VC: No issues! Could not replicate the problem!

The build you sent over works, at least I couldn't replicate the problem, thank you.

@TBhimdi
Copy link

TBhimdi commented May 29, 2024

Just tried all three builds (thank you for creating them):

  • build 0: Was able to replicate issues
  • build 1: Worked without issues!
  • build 2: Was able to replicate issues

@streetpea
Copy link
Owner

that is turning off packet loss reporting (main...revert-162-1) @nowrep I thought you had a reason for turning back on the packet loss reporting but I forget what it was. @TBhimdi what exactly happens after 5 minutes or so, does the stream slow down or freeze or what?

@TBhimdi
Copy link

TBhimdi commented May 29, 2024

No slow downs or freezes, some audio crackling for a bit and very bad compression artifacts.

At random times or during heavy scenes, I see the "bad connection" indictor blink for barely a second and then there is massive artifacting, almost as if (most likely) the bitrate drops tremendously. It feels as if, just a guess since I don't know the protocol or any of the code, there is a streaming issue and then bitrate drops very low to compensate and then it STAYS low, after which I have to restart Chiaki for it to reset to what I had it set to in settings. Doesn't matter what I set the bitrate to in settings, very very low or very very high, I've tried both, it eventually happens during busy games.

@nowrep
Copy link
Contributor

nowrep commented May 29, 2024

Reporting lost packets causes console to increase the amount of FEC packets, so it's very important on worse connections. The downside is if the packet loss is too severe, it drops the bitrate significantly and takes a lot of time for the bitrate to (at least partially) recover when the packet loss is low again.

Maybe it would work to only report packet loss up to some percentage, eg. report 20% packet loss maximum.

@TBhimdi
Copy link

TBhimdi commented May 29, 2024

If I'm on my home WiFi, I'd prefer an occasional blip in my game rather than a loss in my streaming quality. Is it possible to make it an option per console? I have a manual connection setup for streaming away-from-home and use the in-home "discovered" console for in-home streaming.

@streetpea
Copy link
Owner

streetpea commented May 31, 2024

@TBhimdi can you try this build: .It reports at most 20% packet loss at a time. https://drive.proton.me/urls/JS4G6FXTJ0#xuK4NGKANfOA

@streetpea
Copy link
Owner

@TBhimdi have you got a chance to try the above build yet?

@TBhimdi
Copy link

TBhimdi commented Jun 4, 2024

Sorry, been a bit busy. I'll give it a try this evening.

@TBhimdi
Copy link

TBhimdi commented Jun 5, 2024

Sorry I didn't get back to you earlier (was getting married this weekend), but I just tested the 20% build, no go, same issue with heavy macro blocking after some packet loss and didn't bounce back.

@streetpea
Copy link
Owner

@TBhimdi Congrats on your wedding! Here's a new build: https://drive.proton.me/urls/6G2VD8QASC#Or1a6dYnJn16 that lets you set the max percent of packet loss reported to the console in the settings in Audio/Wifi. can you try different values with that and report back? What's happening is the console is lowering the bitrate in response to the packet loss you're experiencing on your end of the connection (which Chiaki4deck is reporting) to create a more stable connection. Lowering the max packet loss reported at a time should mitigate this and prioritize bitrate over stream connection.

@TBhimdi
Copy link

TBhimdi commented Jun 5, 2024

So I tried several different settings. All of them I let sit on the home screen for a couple minutes, then I'd explore the dashboard, inevitibly they'd all get bitrate artifacts. I assumed setting Wifi Indicator to 100% and Packet Loss to 0% would avoid the issue, but it did not.

Here are some of the few different combinations I tried (going from memory):

  • 3% indicator, 20% packet loss (the default)
  • 3% indicator, 15% packet loss
  • 3% indicator, 10% packet loss
  • 3% indicator, 5% packet loss
  • 3% indicator, 0% packet loss
  • 0% indicator, 0% packet loss
  • 100% indicator, 100% packet loss
  • 100% indicator, 0% packet loss

Then I tried the last few after restarting the Chiaki app (I thought maybe the sliders didn't go into effect since I saw no change?). It didn't help. I thought maybe I was doing something wrong, so I rebooted my ROG Ally and tried 100%/0% again, same issue. Then I tried Chiaki4Deck 1.6.1, all worked fine (even with the wifi indicator popping up).

Is there anything specific I should try in the settings?

@streetpea
Copy link
Owner

@TBhimdi can you try this build: https://drive.proton.me/urls/PCCRGP54J0#5nmJqZZBExVl? Setting the packet loss level should work correctly now. Setting the indicator just sets when the indicator light will flash on so isn't important for this.

@TBhimdi
Copy link

TBhimdi commented Jun 5, 2024

Tried the latest build, results:

  • 3% indicator, 20% packet loss = Low Bitrate Artifacts
  • 3% indicator, 15% packet loss = Low Bitrate Artifacts
  • 3% indicator, 10% packet loss = Low Bitrate Artifacts
  • 3% indicator, 5% packet loss = No Artifacts!
  • 3% indicator, 0% packet loss = No Artifacts!

I tried the 5% and 10% a couple times to make sure.

@streetpea
Copy link
Owner

streetpea commented Jun 5, 2024

Thanks @TBhimdi! @nowrep do you have an idea of what a good default would be based on that and what you know about the fec frames? After setting the default we could leave at it at that or leave it as configurable from that default if individual users want to tweak it.

@streetpea
Copy link
Owner

@TBhimdi 1.7.2 has the update that should fix your issue.

@TBhimdi
Copy link

TBhimdi commented Jun 14, 2024

Just tried, works perfectly, thank you!

@agonzalezramos
Copy link

@TBhimdi 1.7.2 has the update that should fix your issue.

Streetpea, the issue is still there. However, now it happens like after a couple of extra minutes. Let’s say before was like after 2 min, and now after 4. Restarting helps as usual.

Thanks!

@streetpea
Copy link
Owner

streetpea commented Jun 16, 2024

@agonzalezramos you can further lower the max reported dropped % in audio/wifi in the settings … maybe try 4% or 3% to see if that helps your situation. Ultimately the quality is being dropped by the PlayStation console bc your WiFi connection is poor. This won’t fix your poor connection, but will make it so that the stream doesn’t lower your resolution as much in response to it. It could result in other issues though if it’s too low.

@agonzalezramos
Copy link

@agonzalezramos you can further lower the max reported dropped % in audio/wifi in the settings … maybe try 4% or 3% to see if that helps your situation. Ultimately the quality is being dropped by the PlayStation console bc your WiFi connection is poor. This won’t fix your poor connection, but will make it so that the stream doesn’t lower your resolution as much in response to it. It could result in other issues though if it’s too low.

Ok, I’ll try it. However, the PS is connected by Ethernet to the wifi6 router, and my steam deck is 1 meter far from it. Everything gets super smooth and clear after I simply restart the chiaki4deck.

Thanks !

@streetpea
Copy link
Owner

streetpea commented Jun 16, 2024

@agonzalezramos Of course it is clear at the beginning of the stream. What is happening is the stream quality is dropping in response to continued packet drops happening over the connection (this is actually before the packet gets to chiaki4deck for processing it is just the basic udp transmission implemented for Linux that is used for all udp network transmission for any app. Chiaki4deck is just reporting these drops and Remote play on the console is just responding to these drops.). This is happening in hopes of sacrificing stream clarity for stream responsiveness. These drops only happen if there is a problem with your connection. By definition, this setting would only have an effect if your connection is poor. As for why you are having a poor connection using Ethernet while I have I don’t face those problems using WiFi there is likely some issue happening between your Steam deck and ps. That setting I mentioned reports less of these drops to the ps so quality won’t be traded off as quickly. Let me know if 4% or 3% fix your issue. Also make sure you are using auto for hw decoder if you’re not already using that.

@burninater69
Copy link

burninater69 commented Oct 12, 2024

@streetpea Hello. First off just want to say I love this app and can’t thank you enough for it. I am running into this issue where fps drop severely after roughly 5 mins. I saw you mention this is due to a poor WiFi connection, but I can guarantee in my situation that is not the case. I have a mid-high end tplink deco setup, and play within 10-15ft of the router. Do you know of any WiFi settings on the router which could be causing these issues?

@streetpea
Copy link
Owner

@burninater69 are you using an oled deck. If so toggling the wifi on and off before using chiaki-ng usually vastly improves the wifi connection (especially after waking up from sleep)

@burninater69
Copy link

@streetpea Yes I am using an oled steam deck. I will try toggling WiFi before running chiaki. Is this a steam deck oled driver issue which steam will need to address?

@streetpea
Copy link
Owner

@jonginator
Copy link

@burninater69 They do but Valve has been silent on the issue.

@burninater69
Copy link

@jonginator Figures. Thank you both for your help

@deedeeped
Copy link

Do me a favor, everyone, try this out and report your findings. Found this via a little-seen comment on Reddit:

“I've been having stream stuttering issues despite trying all these fixes for months and I think I've finally found a solution. I'm still testing this but I've been having a solid 20 minutes of stutter-free streaming with Moonlight with the following tweak:

• ⁠Disable background scan in iwd or wpa_supplicant, depending on what you use.

For wpa_supplicant, you want to put bgscan="" and update_config=0 (to prevent NetworkManager from re-inserting runtime scan values) somewhere near the top of /etc/wpa_supplicant/wpa_supplicant.conf:

update_config=0
bgscan=""

For iwd you want to add this to /etc/iwd/main.conf:

[Scan]
DisablePeriodicScan=true

I've only tested it in wpa_supplicant but this should achieve the same result with this iwd config

Update 4 days later: sticking update_config=0 in wpa_supplicant.conf seems to solve the NetworkManager issue and can thus be left enabled for full wifi management”

You’ll have to use elevated privileges to edit these folders. It just might address the streaming degradation that requires toggling wifi. Or, it might not.

@burninater69
Copy link

burninater69 commented Nov 16, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests