Moehammered / switch-remote-play

Let the switch remotely play PC games (similar to steam link or remote play)
GNU General Public License v3.0
301 stars 14 forks source link

Sound issues with latest release #31

Closed Theguysayhi closed 3 years ago

Theguysayhi commented 3 years ago

After testing the new update, I found that the audio quality is both muffled, crackly, and is basically inaudible. It's like this in both handheld and docked mode.

I'm using both the latest PC and Switch versions, and have double checked I've installed everything correctly.

Moehammered commented 3 years ago

Please see this part of the wiki for potential remedies: https://github.com/Moehammered/switch-remote-play/wiki/5.-Help-it's-not-working#4-audio-is-bad

Theguysayhi commented 3 years ago

I attempted to close the duplicate and then later two ffmpeg processes as outlined in the guide, but the problem still persists. Even if I close them, they still pop up again. (I do get "Error receiving 10004" when closing the stream though.

I've also restarted both my PC and Switch but to no avail. I never had this problem with the previous versions so I'm not sure what's wrong.

image

Theguysayhi commented 3 years ago

image After some more testing, I get this error.

Moehammered commented 3 years ago

I've never seen that error before. Interesting...

Could you do the following for me?

  1. Try using the previous versions of Switch Remote Play. Does this happen with version 0.8.3?
  2. Tell me your hardware info: cpu, ram, gpu, network adapter
  3. Show me the network diagnostic information the application displays on startup

Thanks in advance.

Theguysayhi commented 3 years ago
  1. Yes, sound is functional on older versions.

  2. CPU i7-5600U CPU @ 2.60GHz 2.59 GHz RAM 16gb GPU Intel Graphics 5500 Not sure where to find network adapter, sorry.

  3. image

Moehammered commented 3 years ago

Interesting...

OK. Could you please try using the latest release of Switch Remote Play, but replace the ffmpeg.exe with the ffmpeg.exe from the older versions?

I didn't list it in the release notes but the latest release is also using a newer version of ffmpeg. Maybe the older ffmpeg version from the previous release works better for your machine?

Let me know if that helps with the issue :)

Theguysayhi commented 3 years ago

Thanks for the response!

After testing with old ffmpeg.exe, I can confirm the same issue persists.

Moehammered commented 3 years ago

I'm quite puzzled now. I haven't changed any of the audio related code for quite a long time. The only big change that might have affected the audio would be the ffmpeg update. I can't personally replicate the issue.

Still, can you please try the following?

  1. Could you please reinstall this program? https://github.com/rdp/screen-capture-recorder-to-video-windows-free/releases/tag/v0.12.11
  2. That program seems to require Java, could you try updating your Java runtime?
  3. If you don't have Java, could you install OpenJDK? (I personally have OpenJDK installed instead of Oracle's Java)

If any of these help, please let me know.

Theguysayhi commented 3 years ago

Sorry for the late reply. I'll test the above solutions and get back to you as to if they work.

Thanks again for all your hard work!

Theguysayhi commented 3 years ago

I've reinstalled screen capture recorder and still no avail.

I also have the following OpenJDK's for Java: image

Still nothing working sadly.

Moehammered commented 3 years ago

Let's keep going to see if we can narrow it down:

  1. Can you try running the old Switch Remote Play app on the Switch (v0.8.1) and try connecting with the new Switch Remote Play Host application on the PC (v0.9.0) to see if it can connect and if the sound will work?
    • I don't expect this to work. The controls and such will not work properly but I just want to know if the sound works correctly or not.
  2. In the same directory as the switch-remote-play-host.exe program, there should be a config.ini file. Can you change the audio option to show 'yes' and screenshot the output of the audio window that opens after you connect?
    • Change it so it will look something like this:

      show_ffmpeg_audio_output_window=yes; valid options - yes, no (don't forget the semicolon!!!!) show_ffmpeg_encoder_output=yes; valid options - yes, no (don't forget the semicolon!!!!)

If you could also take a screenshot of the audio window when connecting with working sound that might be helpful. I'd just like to see if ffmpeg is using different default settings or not.

Thanks for your patience with all this. :)

RafaelDiasCampos commented 3 years ago

I'm also experiencing the same issue, and seem to have pinpointed the cause. I'm using a 7.1 audio output device, and when changing to a 2.0 device the sound issues go away. Investigating a bit more, it seems the new pc app streams the audio at 6000kbps while using the 7.1 output, while the old pc app would stream it at 1500kbps. Both apps stream the 2.0 output at 1500kbps. My guess is that either something was changed in how the app handles more than 2 audio channels, or something changed in the encoder (old app uses Lavc58.91.100 while new one uses Lavc58.134.100)

Moehammered commented 3 years ago

I'm also experiencing the same issue, and seem to have pinpointed the cause. I'm using a 7.1 audio output device, and when changing to a 2.0 device the sound issues go away. Investigating a bit more, it seems the new pc app streams the audio at 6000kbps while using the 7.1 output, while the old pc app would stream it at 1500kbps. Both apps stream the 2.0 output at 1500kbps. My guess is that either something was changed in how the app handles more than 2 audio channels, or something changed in the encoder (old app uses Lavc58.91.100 while new one uses Lavc58.134.100)

You're an absolute champion. Thank you very much for spotting this and taking the time to compare the audio codec output.

Yes I had a hunch about it having to do with the sampling rate. And sure enough I found in one of the commits I made around the end of February I commented out the audio codec parameters in the PC app... I'm such a goose.

I will be making a small patch to the host application to test this. Would you be willing to test the application for me? I will post it here for testing and once you confirm that it works I will make an updated release.

Honestly the myriad of hardware haha... I never thought about surround sound channels. I myself only use stereo.

Anyway, thank you so much. This gives me something to work with. :)

RafaelDiasCampos commented 3 years ago

Of course! I would be happy to test it. That's one of the issues with computers, hahaha. Many possibilities to use also means many possibilities for something to break. But I guess that's just part of the fun. Thank you for the amazing work you're doing.

Theguysayhi commented 3 years ago

Hurray! Glad the issue has been solved. I also would be happy to test the new version as well. You guys are absolutely amazing ^^

Moehammered commented 3 years ago

Of course! I would be happy to test it. That's one of the issues with computers, hahaha. Many possibilities to use also means many possibilities for something to break. But I guess that's just part of the fun. Thank you for the amazing work you're doing.

Hurray! Glad the issue has been solved. I also would be happy to test the new version as well. You guys are absolutely amazing ^^

Sorry for the wait, I completely reformatted my computer this week to install Linux on it to prepare for work on the Linux port of the application.

I've attached a build of the host exe here with the audio parameters. Could you please test it and see if it works? Simply put it in the folder where ffmpeg.exe is located.

If it doesn't work, could you make sure to include the audio output? Specifically the audio parameters? switch-remote-play-host-audio-patch.zip

image

Thanks for your help! :)

RafaelDiasCampos commented 3 years ago

From my tests, this version works perfectly! Audio bitrate stays at ~1500kbps even while using surround sound on desktop, and it plays fine on the switch. Thank you very much for solving this issue.