streetpea / chiaki-ng

Next-Generation of Chiaki (the open-source remote play client for PlayStation)
https://streetpea.github.io/chiaki-ng/
GNU Affero General Public License v3.0
1.05k stars 66 forks source link

No audio when using on Windows #143

Closed Jremdog closed 8 months ago

Jremdog commented 8 months ago

Hi guys,

long time user on Steam Deck but also wanted to use on my desktop. The screen streams just fine but I get no audio at all and I've checked all options and tried to troubleshoot online but cant find many people using this on Windows.

Any idea why this might be?

Thanks in advance and thanks for all your hard work.

bloodmc commented 8 months ago

I can confirm this issue occurs when chiaki is configured for Auto sound device in settings. If Auto picks up a device not currently connected (airpods etc..) then the user will experience no audio.

Bug is on this line https://github.com/streetpea/chiaki4deck/blob/main/gui/src/streamsession.cpp#L726

As per SDL docs https://wiki.libsdl.org/SDL2/SDL_OpenAudioDevice, the passed in device name should be a first attempt then you should always fallback to the default output device if not successful. The current code does not fallback by passing nullptr for name.

In my test case, chiaki picked up unconnected airpods which I even removed from windows settings. Not too familiar with chiaki codebase but there is probably a bug with the auto sound detection on windows at least? A disconnected bluetooth audio device should never be chosen.

@Jremdog as a workaround, simply configure the chiaki audio output to one of your audio devices in list that you want to use.

Checking git history, it looks like this bug was introduced from @nowrep 's SDL PR so it would be best for him to chime in. Would be nice to also include the actual audio device name that could not be opened instead of just an SDL error.

nowrep commented 8 months ago

If you select Auto it should save empty string and it will try to open default device (nullptr).

Jremdog commented 8 months ago

Hi @bloodmc , thanks for the help.

I tried this but no success, the no audio issue remains - image

I had a look at the audio settings on the PS5 and it still indicates that the audio is being output device as 'HDMI Device (AV Amplifier) which is the same as playing normally on the console via my TV - image

However, the microphone shows input device as 'Microphone on Remote Play'

Not sure if this might have something to do with it.

bloodmc commented 8 months ago

If you select Auto it should save empty string and it will try to open default device (nullptr).

On my debug build, I had Auto selected and it still attempted to open my disconnected airpods. The name passed was AirPods Pro. How about if the first attempt fails then retry with the default device if the audio device name was not empty? This solves the issue on my end.

bloodmc commented 8 months ago

Hi @bloodmc , thanks for the help.

I tried this but no success, the no audio issue remains - image

I had a look at the audio settings on the PS5 and it still indicates that the audio is being output device as 'HDMI Device (AV Amplifier) which is the same as playing normally on the console via my TV - image

However, the microphone shows input device as 'Microphone on Remote Play'

Not sure if this might have something to do with it.

Just to confirm, what build are you using? As you are still having issues, the only other thing you can do is wait until they add more debugging so we can confirm if it is selecting the proper audio device or add the fallback as I suggested.

Sildurs-shaders commented 8 months ago

Looking at the commit history these changes are not live yet yeah? Running into the same issue on Windows 11, no audio whatsoever, using the latest realtek drivers with a DT 990 Pro. Also the 1.5 release has the zip file name Chiaki4deck-win_x64-VC-1.4.1, inside another zip.

EDIT: The lack of audio is caused by setting my audio device higher than the windows default of 24bit 48000hz. Anything other than that causes this and it can be fixed by using the qtaudio_windows library but that introduced a lot of crackling noises. Not sure if this is worth opening a new issue for.