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

[Bug] "Invalid channel count" with audio streaming enabled #94

Closed
myoKun345 opened this issue Nov 17, 2020 · 10 comments
Closed

[Bug] "Invalid channel count" with audio streaming enabled #94

myoKun345 opened this issue Nov 17, 2020 · 10 comments

Comments

@myoKun345
Copy link

myoKun345 commented Nov 17, 2020

Describe the bug
Whenever I try to stream from my Switch, over USB or network, the stream fails when audio is included. This occurs when --no-video and no command line flags are included, but not with --no-audio. This is the error that shows up in the command line after crashing:

Unhandled exception. System.Exception: Invalid channel count
   at SysDVR.Client.Player.Player.InitSDLAudio(AudioStreamTarget target)
   at SysDVR.Client.Player.Player..ctor(PlayerManager owner, Boolean hwAcc, String codecName)
   at SysDVR.Client.Player.PlayerManager..ctor(Boolean HasVideo, Boolean HasAudio, Boolean hwAcc, String codecName)
   at SysDVR.Client.Program.Main(String[] args)

To Reproduce
Start game on switch, run SysDVR Client command with no flags or with --no-video flag. SysDVR on Switch can be in either TCP bridge or USB mode, the crash happens either way.

Expected behavior
A working stream including both video and audio

Setup information

  • PC Os: Windows 10 x64 1909
  • Console firmware: 10.2.0
  • Custom firmware name and version: Atmosphere 0.14.4 and 0.15.0
  • SysDVR version: 5.0
@exelix11
Copy link
Owner

Uhm seems to be an issue with SDL, will prepare a debug build which should print more info.
In the meantime, does it happen even if you try to stream in USB mode without the console plugged in ?

@myoKun345
Copy link
Author

Yes, it does.

@exelix11
Copy link
Owner

Extract this file and replace the SysDVR-Client.dll file you already have and try again. It should print some more info, SysDVR-Client.zip

@myoKun345
Copy link
Author

These extra lines now print before the error message:

Initializing audio subsystem...
Open audio for 2 channels @ 48000hz, format 32784
Open audio returned 8 channels @ 48000hz, format 33056
Initializing converter
Unhandled exception. System.Exception: Invalid channel count
   at SysDVR.Client.Player.Player.InitSDLAudio(AudioStreamTarget target)
   at SysDVR.Client.Player.Player..ctor(PlayerManager owner, Boolean hwAcc, String codecName)
   at SysDVR.Client.Player.PlayerManager..ctor(Boolean HasVideo, Boolean HasAudio, Boolean hwAcc, String codecName)
   at SysDVR.Client.Program.Main(String[] args)

My audio device supports 7.1 channel audio, possibly explaining the 8 channels line.

@exelix11
Copy link
Owner

exelix11 commented Nov 17, 2020

Uhm i actually missed that i have an explicit check that enforces at most two channels, not sure what happens with more cause i'd be asking SDL to convert from two channels to eight in your case, guess let's try. SysDVR-Client.zip.
If this doesn't work I will just cap channels to two instead of failing which should work fine.

@myoKun345
Copy link
Author

myoKun345 commented Nov 17, 2020

The stream starts now but the audio is extremely choppy. I can get a clip of it if you need it.
Edit: It does sound fine when I switch to a stereo audio device

@exelix11
Copy link
Owner

Yeah the problem is with multiple channels, try this build it should work fine:
SysDVR-Client.zip

@myoKun345
Copy link
Author

Works great now! Thanks!

@exelix11
Copy link
Owner

👍 For now use that build as a workaround, will make a proper update in a few weeks as i'm sure more similar bugs will come up soon enough.

@exelix11 exelix11 mentioned this issue Nov 18, 2020
@exelix11
Copy link
Owner

Fixed with latest release

@exelix11 exelix11 mentioned this issue May 30, 2021
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

2 participants