moonlight-stream / moonlight-embedded

Gamestream client for embedded systems
https://github.com/moonlight-stream/moonlight-embedded/wiki
GNU General Public License v3.0
1.52k stars 325 forks source link

Audio skipping issues #289

Closed shayaantx closed 8 years ago

shayaantx commented 8 years ago

Hello, first thanks and props to people who work on this.

Second, I'm currently having an issue every week where audio skips after a 4-5 days of no issues (no video lag or input lag).

I'm running a windows 10 machine with the GFE beta latest, geforce gtx 970 (4mb of ram for gpu), 16gb of ram for the machine. Using the raspberry pi (all drivers and everything is updated). Using latest moonlight (from apt-get sources).

Literally once a week, the audio seems to degrade (very noticeable skips). The video is clear and the input is fine (streaming with 30fps over 1080p). If I bring it down to 720, the audio does not improve. I see the ALSA write errors, I've read in some issues here. However I see those when there is no audio issue, so at this point I can't attribute these errors to my audio problem yet. Everytime this issue happens I usually test running a mp3 on my raspberry pi (outside of moonlight) and I don't ever have issues.

What has consistently (every time) worked for me, is uninstalling the GFE server, and restarting my machine completely, then reinstalling. I won't have an issue for a few days. My computer is really not running anything when I am game streaming (other than GFE and that actual app I'm streaming).

Any suggestions on what I can troubleshoot further?

KeldorDE commented 8 years ago

I'm noticed the same issue the last days. Sometimes I get the ALSA errors but the audio is still available. Sometimes the Audio is silent for 3 or 4 seconds without any errors. This issue happens after some time and repeats 2 or 3 times, after that the audio resumes normally.

Sounds similiar to your problem. I'm using the latest GFE Release and a RPI 2 as moonlight host (Raspbian Jessie) I'm using the latest raspbian jessie release of moonlight from the moonlight Packages.

shayaantx commented 8 years ago

I mean it could be network or something, but I've got pretty beastly networking components in my setup.

Got the nighthawk router and a pretty good asus N wifi adapter. I am running my raspberry pi over ethernet and my server is running over wifi. I usually have no issues, can play gta5 or witcher 3 on ultra on 30fps/1080p with no issues, then this audio problem crops up. Literally I can stream witcher 3 on 30fps/1080p while people are streaming netflix and playing xbox one with no issues. So it just seems like networking isn't the issue (yet).

When these scenarios occur, I usually kick everything off my network except my server and pi, then I downgrade the resolution to 720p, with no success. Up until yesterday reinstalling GFE would fix it, but yesterday the issue occurred in the morning and later at night (mind you I've changed nothing except disable unused sound adapters - as I have a theory that the multiple sound adapters are part of the problem), the issue went away without reinstalling GFE.

diagonali commented 8 years ago

I'm also experiencing difficulty (as others on other threads have mentioned) with audio stuttering. No idea whether it's Moonlight that can fix it or else the issue lies with my Raspberry Pi, OSMC or possibly Gamestream from Geforce Experience - could it be the controller?. I do hope this can get looked into and fixed because otherwise it was working ok. Interestingly, it is improved a bit by launching games directly and not through Steam Big Picture.

KeldorDE commented 8 years ago

I've also experiencing some strange behaviour with the bitrate parameter. Before, it was set to 22000, now I've raised it to 24000 and the sound problem not happens that much as before.

I'm not sure if the problem is related to Moonlight, RPI 2, GFE or Network. I've checked all channels when the problem occurs. Checking load on RPI 2, checking the kern and syslog on the RPI 2, checking moonlights output, checking network traffic, checking the ping. But all seems ok and I get no errors in any of the checked logs.

KeldorDE commented 8 years ago

Another thing I noticed is: My RPI 2 has some time shifts. If this happens, the NTP daemon adjust the wrong time. If it possible that the moving time could sometimes force dropping of some network packages like the audio packages? But only audio is affected, video has no problems.

shayaantx commented 8 years ago

This issue occurred for the 3rd time to me today. Uninstalling GFE, restarting host machine, install GFE again, repair, audio is flawless again.

My only thought is to modify the code to dump all the streamed audio data (somehow, don't know much about the code yet) on the pi to verify its not the client that is failing here. Really seems like the server is at fault.

KeldorDE commented 8 years ago

At this moment I got the Geforce Experience update for Version 2.9.1 and found the following in the changelog: "Fixes corruption an audio streaming from PC to SHIELD." I'll test if this is releated to our issue.

shayaantx commented 8 years ago

I'll try as well.

KeldorDE commented 8 years ago

For me the issue is still there and not fixed with the ne GFE version :/

diagonali commented 8 years ago

I've also been having this issue, along with the ALSA write errors and the same uninstalling and reinstalling Geforce Experience seems to help. I hope there's a way to get to the bottom of what's causing these issues as they're pretty consistent for people on the Raspberry Pi 1&2. I actually hope it's Moonlight since then it could be fixed directly.

If there's any logs we can submit or otherwise troubleshoot step by step what's going on would be great to figure this repetitive issue out.

shayaantx commented 8 years ago

KeldorDE - does it reproduce for you easily?

diagonali - yea it would be nice if the geforce server was a bit more transparent, some logs would be great...I constantly get the ALSA write errors, with and without the sound issue.

I haven't had the issue for awhile, its intermittent for me, so I'm waiting for it to occur again to try more troubleshooting.

KeldorDE commented 8 years ago

@shayaantx - Yes the first x Minutes run without any issue. After this the skipping starts for 2 seconds, then it continues normally and after a few seconds it happens again. After that it continues without issues for the next 10-20 minutes, then it could happen again.

The period between the issues are not constant so it could be 5 minutes or 20 minutes.

irtimmer commented 8 years ago

Duplicate of #126