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

Sound and video stutter on iPad Pro M4 #627

Open
ollebro opened this issue May 16, 2024 · 46 comments
Open

Sound and video stutter on iPad Pro M4 #627

ollebro opened this issue May 16, 2024 · 46 comments

Comments

@ollebro
Copy link

ollebro commented May 16, 2024

Describe the bug
Both video and sound stutters every 3-4 seconds, similar to the kind of video stutter you would get from running 24Hz video on a 60Hz display. It doesn't matter which resolution(720,1080,4K), FPS/Hz(30,60,120) or bitrate I select in Moonlight. Also doesn't matter if I select smooth video or not on the frame pacing setting. Both host and client are on the same network and just to be sure to rule out network and host I tried Moonlight on a iPhone 15 Pro and Macbook Air M2. Neither have any issues regardless of resolution, Hz or bitrate.

I'm using a virtual display adapter which can handle any resolution and Hz, and it works fine for the other Apple devices but not the new iPad. https://github.com/itsmikethetech/Virtual-Display-Driver

Device details

  • iOS/tvOS version: iPadOS 17.5
  • Device model: iPad Pro M4
  • Moonlight Version 9.0.2

Server PC details

  • OS: Windows 11 Pro Version 10.0.22631 Build 22631
  • GeForce Experience version: Nvidia App 10.0.0535
  • Nvidia GPU driver: 552.44
  • Sunshine Version v0.23.1
  • Antivirus and firewall software: Windows Defender and Windows Firewall
@marcosscriven
Copy link

marcosscriven commented May 17, 2024

Hi - I wanted to report the same. I have all the latest versions of OS, drivers, Sunshine/Moonlight (as per @ollebro). In my case, I'm not using the virtual driver.

I'm using a Wifi 6e Unifi router, with the iPad on 6GHz. Stats show no dropped frames.

I was excited to try AV1 + 6GHz wifi, but unfortunately it's unplayable like this.

@justing6
Copy link

justing6 commented May 18, 2024

I can confirm the exact same behavior. An entire stream stutter (video and audio) usually every 3-5 seconds, but sometimes up to 10 seconds between stutters. Between major stutters, video and audio are flawless without micro-stutter at both 60hz and 120hz settings.

Note I usually use moonlight on my steam deck oled, and I have absolutely no stutter at 60hz or 90hz, 5ghz or 6ghz streaming 2560x1600 at 100mbps.

This is with my desktop (i7-12700k/rtx 4090) running a custom resolution to match the iPad from directly connected TV (not virtual driver), 2752x2064 at 120hz and 60hz. I also have access to 6ghz wifi which consistently hits 920mbps on a speedtest from the iPad. Normally I’d blame apple’s WiFi, but the 0.00% network dropped frames with 4-6ms average network latency from the statistics window points away from it.

Nothing I’ve tested has affected this at all (didn’t make the stuttering better or worse), including:

Testing both 120hz and 60hz
Vsync on/off in game
nvidia control panel frame limit game to 120fps/60fps respectively instead of Vsync
Gsync on/off on host monitor
Using 5ghz or 6ghz wifi
Streaming 60hz and limiting iPad screen to 60hz max
using h264/hvec/av1 encoder
lowering/raising bitrate (between 50mbps and 150mbps)
changing frame pacing setting on moonlight
disabling location service on iPad
disabling bluetooth on iPad
testing after fresh boot of iPad and PC
Disabling Moonlight Statistics window
multiple different games

Device details

iOS/tvOS version: iPadOS 17.5
Device model: iPad Pro 13 M4, WiFi only
Moonlight Version 9.0.2

Server PC details

OS: Windows 11 Pro Version 10.0.22631 Build 22631.3593
GeForce Experience version: 3.28.0.412 (not used for streaming)
Nvidia GPU driver: 552.22
Sunshine Version v0.23.1
Antivirus and firewall software: Windows Defender and Windows Firewall

@marcosscriven
Copy link

I found the following fixed the issue for me: moonlight-stream/moonlight-qt#159 (comment)

Please try disabling location services. It might interrupt your stream when it scans for nearby wifi networks. System Preferences -> Security & Privacy -> Location Services

@justing6
Copy link

I found the following fixed the issue for me: moonlight-stream/moonlight-qt#159 (comment)

Please try disabling location services. It might interrupt your stream when it scans for nearby wifi networks. System Preferences -> Security & Privacy -> Location Services

Note for anyone looking at this issue, this did not fix the issue for me. Disabling location services seemed to have no effect.

@heywoodlh
Copy link

TL;DR - Resolved this issue for myself on my M4 iPad Pro by switching my 5Ghz wireless network to channel 149 on OpenWRT.


I have experienced the same issue on my 11" iPad Pro and M2 Macbook Air but no other devices on my network (Steam Deck, Apple TV, iPhone, Logitech G Cloud) seem to encounter this issue over Wifi. Today I upgraded to an M4 iPad and encountered the same issue so was happy to see this thread pop up and know that I'm not the only one experiencing the issue. As it seemed to only happen to me on low-priority (for me) Apple devices, I wasn't very concerned about this.

After a bit of Googling today, I found this Reddit comment which suggests to switch your 5Ghz wifi network to channel 149. I gave it a try thinking it would resolve nothing -- but it totally worked for me on my OpenWRT router. I was able to play Ghost of Tsushima on my iPad Pro over Moonlight without stuttering. Prior to today, I was using the default OpenWRT 5Ghz channel.

I am also happy to report that it resolved my MacOS + Moonlight stuttering issue. I've never been able to get smooth performance on my Macs before, so I was happy that this helped!

Would be curious if this helps anyone else and if any wireless/Apple wizards have any explanations. I work remotely in a tech role, so I'm pretty attentive to making sure my wireless network is solid -- and this was one of the only niche pain-points I've had that I haven't tried hard to resolve.

@Ysabelle12
Copy link

This happens to me on every exactly 1 second interval. no packet loss was detected and stuff. I tried using ethernet to no avail.
However restarting iPad 11" M4 will fix it temporarily. just it'll come back sooner or later. its a very specific interval of 1 second or sometimes even 500MS

@EvenZH1102
Copy link

I have similar issue as well on iPad Pro M2, however such stutter won't happen when I use cable network.

@justing6
Copy link

I got a chance to test my iPad Pro M4 using an Ethernet adapter and got no stuttering or skipping at all. I also tested having my desktop host a WiFi network in hotspot mode and connecting the iPad to that and got a much smoother connection as well. It wasn’t really usable as I got massive frame drops every 30 seconds or so due to the hotspot feature in windows just not having consistent throughput, but I didn’t get the same skipping every few seconds that I did over my normal WiFi connection.

I can’t figure out what the difference is though, as I’ve tested multiple wireless APs, switches, security settings, bands, etc and nothing has made the skipping better or worse using Moonlight on my iPad. At the same time, my android phone and Steam Deck OLED work completely fine with no skipping on the same 5ghz and 6ghz networks that the iPad is having issues on. I also have an older iPad Pro 2018 I’m testing with, and while the stream isn’t as smooth as my Steam Deck and there is some skipping still, there’s notable no audio skipping on my 2018 iPad. While the 2024 iPad has a smoother stream, it has much larger skips where the audio cuts out as well.

@alotofentropy
Copy link

alotofentropy commented Jun 3, 2024

I suspect it is a mix of Location services and other apple services like continuity. On a fresh boot of iPad OS having location services on makes lag spikes horrible, but when I turn it off it disappears. If I share my screen with my mac though, everything comes back, and no change of disabling or enabling continuity fixes it, the iPad will need a reboot to get rid of the lag again

@justing6
Copy link

justing6 commented Jun 7, 2024

I gave it a try and disabled location service prior to a fresh boot, didn’t see really any change. Still got skips every few seconds. It must be that something in my setup just hate iOS, because everything works great to my steam deck.

@Belthazaar
Copy link

@justing6 I responded to another issue about this, but can you try this and see if this helps #607 (comment)

@ollebro
Copy link
Author

ollebro commented Jun 7, 2024

Before switching to AWDL channels I did a test with steam link which looks like below. for iPhone the connection is very stable while you can see the result for iPad, a jump every second or so.

iphone
ipad

I then tested to switch 2,4Ghz to channel 6 and 5GHz to channel 44 (I don't have access to channel 149) and now both devices looks like the iPhone result, rock solid connection and I notice it immediately starting up Moonlight on iPad that there now is 0 stutters.

So I guess this is one solution, what doesn't make sense to me is that even with this network stutter I don't notice any video or audio issue streaming with Steam Link as opposed to Moonlight, so is Steam Link doing some kind of buffer?

Secondly I don't understand how this issue never affected the iPhone which is on the same network.

@Belthazaar
Copy link

My guess is that the Steam Link has a bit of a buffer somewhere. Since clearly the Steam Link sees the same network behaviour when we do a network test. However, I have seen posts about people complaining about other streaming software such as Geforce Now, Xbox Cloud Streaming, and even Apple's own Virtual Mac streaming. This reddit post pointed me towards AWDL and started the whole debugging process.

I'm not sure with the iPhone, as I might have only encountered this issue maybe once over the past year, compared to how easily it is to reproduce this issue with an iPad. I have experienced this on my MacBook in the past, but I am usually connected to a dock with wired networking when I stream on that.

My current guesses for the iPhone is :

  1. that Apple keeps the AWDL knowledge and network running for longer when the screen is off, so it doesn't need to do the discovery process as often. On my iPad I noticed that the Steam Link performance is at it's worst when I've left my iPad locked for a few minutes and start the network test immediately after waking it
  2. The iPhone has the possibility to listen on multiple Wi-Fi channels at once. Unsure if this is related to the iPhone having cellular access as well.

@joeybaumgartner
Copy link

The switch to AWDL fixed the same issue I had, just on a slightly older iPad (M2 iPad Pro). Prior to that, the stream was pretty stuttery. On top of that, I found that running iperf3 on a server for my iPad to connect to would always cause the connection to drop to zero (or near zero). Similar results when doing a test using Steam Link as well. After switching my Wi-Fi signal over to 149 MHz, all of these issues went away. iPerf3 testing showed a lower bound of 149 Mbps compared to 0 or single digits. I highly recommend making this change if your wireless supports it.

@mayankk2308
Copy link

mayankk2308 commented Jun 9, 2024

Strangely, using the aforementioned WiFi channels does not fix this issue for me on the M4 iPad Pro (no cellular). I still get the rhythmic spike in the steam link test regardless. Streaming over WiFi on Mac and iPhone works fine. Turning off both airplay/handoff and location services also does not seem to help in my case.

@chrispe-lab
Copy link

chrispe-lab commented Jun 12, 2024

I have the same issue with my new Ipad Pro M4.

Iphone Steam Link on Wifi - No issues
IMG_0460

Ipad Steam Link on Wifi - Major issues
IMG_0005

Ipad Steam Link on Wifi after network reset - No issues
IMG_0006

Ipad Steam Link on Wifi after network reset and a while later - Major issues
IMG_0007

Ipad Steam Link on Cellular with VPN - Major issues
C34E4EAF-FBEC-41C0-995F-91096BA6F6BF_1_201_a

Iphone Steam Link on Cellular with VPN - No issues
BBC4AE11-BE94-4299-9561-1AE92679CEF8_1_201_a

Based on the above makes me think this is not a specific Wifi issue with channels or related to specific Wifi brands. This is either an issue with Steam Link or how Apple have configured their wifi settings.

@ollebro
Copy link
Author

ollebro commented Jun 12, 2024

I wonder if this will improve with the Game Mode Apple showed off at WWDC.

@chrispe-lab
Copy link

I really hope so, have you found some other fix to this? It keeps coming back for me...

I'm downloading iPadOS 18 Beta now to see if it works better.

@ollebro
Copy link
Author

ollebro commented Jun 12, 2024

For me switching the wifi channels to 6(2.4GHz) and 44(5GHz) worked but those channels are quite congested in my building so if the Game Mode fixes this I would be very happy. I dont have access to the beta so I'm curious to see if it improves for you.

@chrispe-lab
Copy link

Ok, I might try that later.

First let's see if iPadOS18 solves anything.

I've also bought a new 6GHz AP, not sure i will need it as the issue seems to go beyond WiFi.

@chrispe-lab
Copy link

Some interesting findings here. At first iPadOS 18 seemed to fix this issue but then I opened my Macbook Pro to start working again. Did the latency test again and it's back to intermittent lag spikes...

So this has more to do with the connection to the MacOS than anything else.

Do you have a Macbook Pro in close proximity?

@Belthazaar
Copy link

I did some more testing over the last few days. Purposely having my network not "Apple optimised".

What you are seeing is the MacBook sending out it's AWDL discovery packets when it wakes up.
This is an issue with Apple products in general, not just iPads, iPhones or the new Vision Pro.

To easily replicate this issue on your iPad, you can run a continuos ping to something else on your network (preferably a device with a wired connection to your router). For the best result reduce your ping count to something pretty low, like 0.1 or 0.05 seconds. You might start to see the rhythmic pattern already.

Now this is where the "fun" begins, if you then unlock your iPad or iPhone, you will start to see your RTTs go all over the place, and you might even see some packets drop.

@Belthazaar
Copy link

This is the results of some tests I ran earlier. The setup is a Macbook running pings to my moonlight pc, with a second Macbook sniffing on channel 44. The blue line is ping RTT, and the red lines that I've overlapped is every time an AWDL packet was seen on channel 44.

image

The first red cluster is me unlocking my iPad, and the second is me unlocking my iPhone.

I can't yet say for 100% certainty that it is AWDL, but it sure looks like it causes it.

@chrispe-lab
Copy link

chrispe-lab commented Jun 12, 2024

It sure is: https://forums.macrumors.com/threads/wi-fi-jitter-erratic-ping-latency-due-to-awdl-airdrop-airplay.2373916/

I'm not sure how Apple is getting away with this, especially now that Apple are going for the gamers market with Sequioa and iPadOS / iOS 18.

Would prefer the option in the upcoming "Game Mode" to disable AWDL completely!

This seems to only affect iPads and MacBooks, as I'm not seeing this issue on the iPhone.

@chrispe-lab
Copy link

This is slowly driving me crazy. I thought I was able to isolate this problem but I've been using the iPad next to my other Apple devices now for a few hours and nothing, it works perfectly.

I did a restart (up then down) of the AWDL eth adapter though, maybe that was the solution to the problem.

@mayankk2308
Copy link

mayankk2308 commented Jun 15, 2024

I figured out the issue on my end as well. For reference, my router is TP-LINK AX90 (WiFi 6). I was using the Tether app to configure channel 149 for the 5GHz-2 network. Now the app indicated that configuration was successful, but turns out it wasn’t the case. The channel bandwidth in the app was set to 160MHz, so only DFS channels were actually applicable (app indicates incorrect state). Only when I looked into it further via the browser did I see the issue. Switching to 80MHz width allowed me to select channel 149 after which the spikes were resolved. A silly miss on my part. Sharing this anecdote in case anyone has a similar setup.

In terms of losing 160MHz, it’s not applicable for my case as it seems Apple devices only support 6GHz (WiFi 6E) with 160MHz width, not WiFi 6. This is based on: https://support.apple.com/guide/deployment/wi-fi-specifications-for-apple-devices-dep268652e6c/web but perhaps it’s not worth considering an upgrade anyway given the streaming issues. I did file a bug report as well about this, no expectations though.

@Yuriy16
Copy link

Yuriy16 commented Aug 28, 2024

channel 149 is the working solution!

@Belthazaar
Copy link

Small updated from my side, I finally had a chance to test this within a 6 GHz environment. Sad to report that I found AWDL still uses a single social channel in 6 GHz. After doing some sniffing on all the channels in the 6 GHz spectrum, I found that Apple uses channel 69 as the social channel for 6 GHz. So if you encounter this issue on 6 GHz, try swapping over the channel to 69

@Belthazaar
Copy link

For those that are more interested in the issue, I recently presented this issue at a network operator conference explaining some of the findings I discussed here:
https://www.youtube.com/live/KwkSIxl00Dg?si=veyfKI2oWqX8AsmV&t=521

@marcosscriven
Copy link

I'm keen to see if game mode helps when iOS 18 is out next week or so.

@leuchthelp
Copy link

hopefully, been encountering this issue lately with my iphone 15 pro and since I'm from germany, I don't have access to the supposed Channel 149 fix :/

@dulcinea22
Copy link

The channel 149 fix works but I am guessing I'm out of luck if I'm using my iPad outside my network right?

I tried remote playing a video game at work and it has the stutter... Oh well.

@maxwell-01
Copy link

Hi all, thank you for discovering and sharing your insights about this. I've been battling this stuttering for years with apple products!

I have 3 Ubiquiti access points around the house. I like to game from several places making use of multiple APs. I appreciate setting them all to channel 149 is not viable. What's the next best option, set one to 149 and just deal with the stutters when I'm on another AP?

@hugeBlack
Copy link

hugeBlack commented Oct 5, 2024

I have this problem too with my iPhone and my iPad on iOS 18.0.1. I don't have control over my AP so I can't switch it to channel 149. But instead, I found that powering off any Mac nearby and doing a reboot of iPhone/iPad will get rid of this stutter. Since this stutter happens among all streaming apps not matter they enable game mode or not, I think it has nothing to do with game mode.

@Wontell
Copy link

Wontell commented Oct 23, 2024

I had this issue on my ipad pro m1 12.9
I managed to completlly get rid of it

1] Air Drop: OFF
2] Location Services: OFF
3] AirPlay and Continuity: all options OFF

Since than, 0 issues

P.S. Hows the 11inch ipad, good enough? I want to get one instead the big that i have, i managed to get couple stretchy gamepads to work, but still its too heavy

@Wontell
Copy link

Wontell commented Oct 23, 2024

The channel 149 fix works but I am guessing I'm out of luck if I'm using my iPad outside my network right?

I tried remote playing a video game at work and it has the stutter... Oh well.

Hi all, thank you for discovering and sharing your insights about this. I've been battling this stuttering for years with apple products!

I have 3 Ubiquiti access points around the house. I like to game from several places making use of multiple APs. I appreciate setting them all to channel 149 is not viable. What's the next best option, set one to 149 and just deal with the stutters when I'm on another AP?

hopefully, been encountering this issue lately with my iphone 15 pro and since I'm from germany, I don't have access to the supposed Channel 149 fix :/

1] Air Drop: OFF
2] Location Services: OFF
3] AirPlay and Continuity: all options OFF

@Wontell
Copy link

Wontell commented Oct 23, 2024

I did some more testing over the last few days. Purposely having my network not "Apple optimised".

What you are seeing is the MacBook sending out it's AWDL discovery packets when it wakes up. This is an issue with Apple products in general, not just iPads, iPhones or the new Vision Pro.

To easily replicate this issue on your iPad, you can run a continuos ping to something else on your network (preferably a device with a wired connection to your router). For the best result reduce your ping count to something pretty low, like 0.1 or 0.05 seconds. You might start to see the rhythmic pattern already.

Now this is where the "fun" begins, if you then unlock your iPad or iPhone, you will start to see your RTTs go all over the place, and you might even see some packets drop.

Have you solved the issues?
Try these 3 settings, it fixed it for me

1] Air Drop: OFF
2] Location Services: OFF
3] AirPlay and Continuity: all options OFF

@nukeajax
Copy link

I had this issue on my ipad pro m1 12.9 I managed to completlly get rid of it

1] Air Drop: OFF 2] Location Services: OFF 3] AirPlay and Continuity: all options OFF

Since than, 0 issues

P.S. Hows the 11inch ipad, good enough? I want to get one instead the big that i have, i managed to get couple stretchy gamepads to work, but still its too heavy

Is someone able to make an iOS shortcut to toggle these 3 settings on and off? would be very useful

@malmaud
Copy link

malmaud commented Oct 24, 2024

I set these all to off and the issue persists for me - my AP doesn't let me manually set channels afaik so I can't try that solution.

@Wontell
Copy link

Wontell commented Oct 24, 2024

I had this issue on my ipad pro m1 12.9 I managed to completlly get rid of it
1] Air Drop: OFF 2] Location Services: OFF 3] AirPlay and Continuity: all options OFF
Since than, 0 issues
P.S. Hows the 11inch ipad, good enough? I want to get one instead the big that i have, i managed to get couple stretchy gamepads to work, but still its too heavy

Is someone able to make an iOS shortcut to toggle these 3 settings on and off? would be very useful

did it worked for you thou?

@Wontell
Copy link

Wontell commented Oct 24, 2024

I set these all to off and the issue persists for me - my AP doesn't let me manually set channels afaik so I can't try that solution.

Strange, worked for me.
But I also tested the 5ghz 149 channel and at least my ipad pro m1 cant see it, maybe its regional and i should select the 44 channel, but i have no idea where is my iPad from, i got it in Brown box, like ex-store demo unit, and it was Parallel non official import, so it can be EU,ASIA or USA, i guess if i twas USA i wouldn't have an issue with channel 149.

EDIT: just checked my serial ends with LL/A that means: USA, Canada or replacement unit
Yet i cant see channel 149

@m13253
Copy link

m13253 commented Nov 14, 2024

Try these 3 settings, it fixed it for me

1] Air Drop: OFF
2] Location Services: OFF
3] AirPlay and Continuity: all options OFF

Didn’t work for me. I guess there might be something else that can trigger AWDL scan.
So as a last resort, I switched my Wi-Fi AP to channel 149 despite it being already crowded.
Channel 149 works for me. (My iPad is a USA model.)

@HunterAhlquist
Copy link

Small updated from my side, I finally had a chance to test this within a 6 GHz environment. Sad to report that I found AWDL still uses a single social channel in 6 GHz. After doing some sniffing on all the channels in the 6 GHz spectrum, I found that Apple uses channel 69 as the social channel for 6 GHz. So if you encounter this issue on 6 GHz, try swapping over the channel to 69

Channel 69 doesn't work for me unfortunately.

@yengalvez
Copy link

Well… it doesn’t help me. In my house yeah, I have control of my WiFi, but when I go out with my iPad M4 and using WireGuard I can’t connect without this annoying issue to my desktop.

is this too difficult to avoid this issue? I see that we are A LOT.

@anatoly108
Copy link

Channel 149 wasn't available in my case. What worked for me is: switching 5Ghz to channel 44 and disabling 2.4Ghz (no device is using it in my household) in my router settings (fritzbox). Running Moonlight on Macbook Air M1 and Sunshine on a Windows PC.

@tignioj
Copy link

tignioj commented Jan 17, 2025

Channel 149 not working. Only logging out of icloud can solve this problem, but it is inconvenient

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