Moehammered / switch-remote-play

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

sound is terrible coming from switch #6

Open BFCE opened 3 years ago

BFCE commented 3 years ago

any ways to improve audio quality? Or just play from the desktop and not switch?

Moehammered commented 3 years ago

If you restart your PC and attempt connecting does the sound issue resolve?

BFCE commented 3 years ago

If you restart your PC and attempt connecting does the sound issue resolve?

No. But I did find out the bad audio only occurs when the switch is docked.

Docked + headphones = good audio handheld = good audio docked with just HDMI audio = terrible and yes I've checked the sound of regular games and other homebrews and it sounds normal there. I also tried overclocking my console, but that didn't help

Moehammered commented 3 years ago

Thank you very much for your diagnostics there. That's a very odd situation. However it makes sense as I have only tested my switch docked outputting to my monitor which has bad speakers so I haven't been able to test docked mode audio.

I will investigate this. I'm planning to add audio configuration options. At that time I'll test for the audio issues too.

I appreciate your effort :)

raiken-mf commented 3 years ago

Same problem here. The sound is kinda bad over 5GHz WiFi. BUT I experienced the same problem with In-Home-Switching.

By the way, does switch-remote-play overclock the CPU of the switch?

Moehammered commented 3 years ago

If you experienced the same with In-Home-Switching then it is an issue with ffmpeg and virtual audio device. Though I wonder why... I might need to investigate this with some troubleshooting steps using VLC player later in the week if you don't mind helping?

Also no it doesn't overclock the switch at all. You can do so using sys-clk if you like but not forcing an overclock was one of the requirements of this project when I made it. No point playing remotely if the battery wouldn't last.

Please see the gbatemp thread for other people's questions if you'd like! (I've been meaning to put the gbatemp thread in the readme so people can go there to discuss between each other but I always forget when it comes time to make a commit).

raiken-mf commented 3 years ago

No problem, I can help you if you like. (As much as I got time) Please give me further instructions. (Good choice not to overclock the device)

Moehammered commented 3 years ago

I'll probably provide some simple troubleshooting steps with VLC media player this weekend. I'll contact you then. Feel free to edit your comment.

Ritaku02 commented 3 years ago

I'm also having sound problems, basically constant audio popping, sometimes the audio and/or the controls will drop out. My Switch is also connected to 5GHz wifi, specifically a Wireless-AC router.

Moehammered commented 3 years ago

The audio popping occurs from network interference or latency. Restarting my pc sometimes helps but I haven't determined the fix for it yet.

Controls dropping out? Could you please post the network diagnostic output of the application in a new issue with a description of how frequently the controls drop out. Please also include your switch's configuration file if you can. Thanks.

bad1dea commented 3 years ago

The sound has been a hit or miss, only noticed the sound echo/crackling last night.. after about the past 4-5 nights of 4-5 hours of game play.

Reboot did fix the issue, although finding the root cause is a much better long term solution.

Let me know if you need any help recreating the issue.

Config: PC 1440p SW 720p QUALITY 8 h264 (nvidia or normal doesn't matter)

Moehammered commented 3 years ago

The sound has been a hit or miss, only noticed the sound echo/crackling last night.. after about the past 4-5 nights of 4-5 hours of game play.

Reboot did fix the issue, although finding the root cause is a much better long term solution.

Let me know if you need any help recreating the issue.

Config: PC 1440p SW 720p QUALITY 8 h264 (nvidia or normal doesn't matter)

Thanks for the info. Could you also include the Network diagnostic info the program outputs on startup? May I ask if that was occurring in docked mode? I've had 2 users now find a pattern with it occurring in docked mode.

I still can't personally replicate the issue. So the next time it occurs could you please capture a video from your phone or something demonstrating the audio issue so I can see what's happening? I need to determine whether it is a latency issue or not as even a frame of latency creates odd audio issues but they are different issues compared to say corrupt audio.

Anyone else also reading this if they could capture a small video demonstrating the audio issue (clear enough for me to hear it) that'd be much appreciated. Extra points for having 2 videos. One with normal audio and one with poor audio.

bad1dea commented 3 years ago

Here is the output.

Looking for active network interfaces...

Found an active network connection.

Ethernet {513E9CB0-3FF4-446A-8CD8-5224876273E2}
    Realtek PCIe GbE Family Controller
    Connection type:                Ethernet interface adapter
    Status:                         Active
    Max Transmission Speed:         1000 megabits/sec | 119.209 megabytes/sec
    Max Receive Speed:              1000 megabits/sec | 119.209 megabytes/sec

    IP Address:  10.10.0.253
    Gateway:     10.10.0.1
    Subnet Mask: 255.255.255.0
    Broadcast:   10.10.0.255

Please make sure your Switch is on the same network as this network connection

Broadcast address for network discovery is: 10.10.0.255

Please add the line below to the switch application's config file if you wish to use the network discovery feature:
broadcast_address=10.10.0.255; <-- Do not forget the semi-colon! (;)

The switch configuration file is located at 'switch/switch-remote-play/config.ini'. If it doesn't exist, create it.

Happened while using it in Handheld Mode.

I'll record a video/with audio + do a wireshark from PC for you if it helps, I'll filter the packets to only show relevant stream info.

Moehammered commented 3 years ago

Here is the output.

Looking for active network interfaces...

Found an active network connection.

Ethernet {513E9CB0-3FF4-446A-8CD8-5224876273E2}
    Realtek PCIe GbE Family Controller
    Connection type:                Ethernet interface adapter
    Status:                         Active
    Max Transmission Speed:         1000 megabits/sec | 119.209 megabytes/sec
    Max Receive Speed:              1000 megabits/sec | 119.209 megabytes/sec

    IP Address:  10.10.0.253
    Gateway:     10.10.0.1
    Subnet Mask: 255.255.255.0
    Broadcast:   10.10.0.255

Please make sure your Switch is on the same network as this network connection

Broadcast address for network discovery is: 10.10.0.255

Please add the line below to the switch application's config file if you wish to use the network discovery feature:
broadcast_address=10.10.0.255; <-- Do not forget the semi-colon! (;)

The switch configuration file is located at 'switch/switch-remote-play/config.ini'. If it doesn't exist, create it.

Happened while using it in Handheld Mode.

I'll record a video/with audio + do a wireshark from PC for you if it helps, I'll filter the packets to only show relevant stream info.

I would very much appreciate that if you could record plus include a wireshark. :)

I have been spending some time dealing with the 'pop' or 'click' sound that occurs. I stumbled upon a suggestion that said to ensure the audio header isn't being interpreted as audio mistakenly. But that hasn't led to anywhere so far and looks like ffmpeg doesn't produce them for pcm audio formats(at least that I can spot when looking for the header in the packet data).

I'm almost certain the click is occurring from very small frame latencies or off by one latency issues. To test that I'll need to do a lot of modifications to the way audio works. So I'll probably make a test project to purely test audio streaming.

Thanks everyone for being patient.

bad1dea commented 3 years ago

FYI, has not happened for a while now, been playing with it 2-4 hours a night, no issues so far with sound.

Moehammered commented 3 years ago

FYI, has not happened for a while now, been playing with it 2-4 hours a night, no issues so far with sound.

Thanks for the update. I've bought a second computer now to start testing my code streaming from pc to pc. I have a few ideas about how to solve it. But it's good to know the issue doesn't crop up permanently at least so users can still enjoy using it.

Theguysayhi commented 3 years ago

Just a bump to this-- I'm also experiencing audio issues of the same type.

Audio output in Handheld is seamless, but when docked, the output to TV speakers causes a lot of popping.

ImanCol commented 3 years ago

I was hoping I could play this homebrew on my TV, but sadly the audio is terrible in docked mode.

Nikoru14 commented 2 years ago

I am also experiencing this problem

ImanCol commented 2 years ago

Recomiendo al desarrollador experimentar con https://mpv.io/

He tenido una mejor experiencia con mpv para la transmision de baja latencia

vamidi commented 2 years ago

I am also experiencing this problem. do you want the Wireshark info and the network configuration?

Also, how are you debugging this? You mentioned that you will test the audio in a separate project. Is there a possibility to share it? Maybe we can take a look with you on the subject.

Moehammered commented 2 years ago

@vamidi thanks for sharing that the problem is occurring for you. The past 3 months I've been hammered with work and some life stuff (nothing negative, just serious stuff) so I have not had time to work on my project recently. I do plan to resume working on it in the upcoming months.

As for how I'm debugging this, I'm planning to make a separate project entirely for unit testing audio streaming code. I've been reading through the homebrew TriPlayer and I think I know what might be causing the audio issues. (Race condition is my current theory).

When I resume working on my project again, I will share the unit test audio application with any of the users here who are experiencing the audio issue to test and help if they'd like.

For now, I've got nothing extra to add until I resume development. :)

vamidi commented 2 years ago

@Moehammered, I totally understand! Thanks for the fast response! good luck with finding the issue and take care!

cucholix commented 1 year ago

Theres plans to reimplement audio? The app is súper hice btw, typing this from my Switch heh

Moehammered commented 1 year ago

Theres plans to reimplement audio? The app is súper hice btw, typing this from my Switch heh

Yep, indeed there is. I've gotten the audio rewritten using SDL now but there are still different issues with the audio now. I'll be attempting to fix the issues the new audio implementation causes, but if I can't solve them entirely ill just merge the new audio implementation and move on to something else. Don't wanna stall progress too much if I can get other features implemented in the meantime while I research solutions.