Download

Help needed for voice chat on LAN between Android and Windows

Hi,

I’ve got a (non-game) project with a few requirements.

  • Need voice chat between all users
  • Should function without internet connexion (all users are on the same LAN, either on ethernet or Wifi, but the internet isn’t reachable)
  • Users may use an Android device (Oculus Quest) or a Windows desktop machine (which will run a Vive Pro VR headset).

Unfortunately, these are hard requirements, I’m not the decision-maker for those.
I have been looking fate and wide, but can’t find anything that works.

What I’ve tried:

Also, for context, I’m using the OnlineSubsystemNull so that my multiplayer implementation also works without internet connexion.

Any help would really be appreciated.

Cheers

Bump on that, i’m having the same issue…

I got voicechat working with the native voicechat-system in LAN with multiple PCs.

The message “LogVoiceEngine: Error: OSS: StartLocalVoiceProcessing(): Device is currently owned by another user” is only a warning AFAIR, as this function is called slightly too early.
When it is called later again, the user has been setup correctly.

In order to get it working on PCs you need to make use of the session-system, i.e you have to use the CreateSession/FindSession/JoinSession- calls. It does not work without sessions.

I am not sure if the native voice-chat solution works well in all constellations (android) or how good it is supported by epic, since I had to use several workarounds in C++.

Examples:

  • I needed to call “FOnlineVoiceImpl::RegisterRemoteTalker” on the server every time a client connected in order to make voice-spatialization work.
  • I needed to call APlayerController::ToggleSpeaking twice on local machines after the VOIPTalker component was created and as soon as the playerstate was replicated in order to hear something.

Some links:

https://forums.unrealengine.com/deve…d-join-session
https://couchlearn.com/positional-vo…prints-in-ue4/

Cheers

Hey @djchase could you please explain a little bit better how you managed to make it work?

I have been working my ass out here and I got this from the logcat:


LogVoiceEngine: Error: OSS: StartLocalVoiceProcessing(): Device is currently owned by another user
LogOnlineVoice: OSS: StartLocalProcessing(0) returned 0xFFFFFFFF
LogOnlineVoice: OSS: Starting networked voice for user: 0
LogVoiceEngine: Error: OSS: StopLocalVoiceProcessing: Ignoring stop request for non-owning user


My project right now is Blueprint only, I am using a button to execute command line “ToogleSpeaking 1” and I am not using the VOIPTalker.

I am trying it on an Oculus Quest.

Any hints?

@pekayatt Unfortunately, I moved now everything to C++, since it was the cleaner implementation and which was necessary to fix another bug with voicechat for more than 2 players.

My first version was based on Positional Voice Chat using Blueprints in Unreal Engine 4 - Couch Learn which nearly worked from scratch, but had some issues I could only fix with C++ as well.

The errors in the log are not relevant, but if you follow the tutorial, you should hear at least “something”

C++ is not an issue for me at all.

So I should just ignore the errors and move to start my session in C++?

Please just point a direction and I can follow, I don’t even need to have a VOIP char, just to hear other players.

Following this tutorial: The easy way to add Voice Chat into your multiplayer Unreal Engine 4 Game - Couch Learn and yet It doesn’t work on a Oculus Quest…

@djchase
Your project is also Android based?

So far I have realized that my main problem was regarding permissions:

https://blueprintue.com/blueprint/_ke-tmfe/

Easy fix needed for Oculus Quest.

I missed the notifcation apparently.

No, it is windows based. An android port would be nice, but the pixelstreaming player does unfortunately not work on the quest.
Ah, yeah the permissions, that could have been a source of error as well IIRC.

Good that you could sort it out!

Hey @djchase , in fact I have not managed to make it work yet. Even though I found some issues.

I created an empty project to try to make deploy faster on Oculus Quest 2, so far I got all the process of sessions working, even better using the Advanced Session Plugin (highly recommended).

Unfortunately the app has been able to work with voice chat on Windows, but the same project is failing at Oculus Quest. I am trying to increase the bandwidth, which might be able to fix the problem (because when I start to try talk I can hear a very briefly sound).

Right now I do have this logcat:


11-18 11:49:34.175: D/UE4(4768): [2020.11.18-14.49.34:175][689]LogNet: NotifyAcceptingConnection accepted from: 192.168.104.11:45974
11-18 11:49:34.176: D/UE4(4768): [2020.11.18-14.49.34:175][689]LogHandshake: SendConnectChallenge. Timestamp: 49.201457, Cookie: 061018091175072237155075085064225030227190175214013229249212
11-18 11:49:34.374: D/soundtrigger(767): audio_extn_sound_trigger_get_parameters input string<snd_device_in=>
11-18 11:49:34.374: D/soundtrigger(767): extract_sm_handle input string <snd_device_in=> param string <snd_device_in=>
11-18 11:49:34.374: I/hash_map_utils(794): key: 'snd_device_in' value: ''
11-18 11:49:34.375: D/soundtrigger(767): audio_extn_sound_trigger_get_parameters input string<snd_device_out=>
11-18 11:49:34.375: D/soundtrigger(767): extract_sm_handle input string <snd_device_out=> param string <snd_device_out=>
11-18 11:49:34.375: I/hash_map_utils(794): key: 'snd_device_out' value: ''
11-18 11:49:34.760: I/VrApi(4768): FPS=70,Prd=49ms,Tear=0,Early=0,Stale=6,VSnc=1,Lat=1,Fov=0D,CPU4/GPU=2/3,1171/490MHz,OC=FF,TA=0/70/70,SP=N/N/N,Mem=2092MHz,Free=2606MB,PSM=0,PLS=0,Temp=25.0C/0.0C,TW=2.00ms,App=15.28ms,GD=1.14ms,CPU&GPU=22.52ms,LCnt=1,GPU%=0.99,CPU%=0.24(W0.26),DSF=1.00
11-18 11:49:35.081: D/UE4(4768): [2020.11.18-14.49.35:081][752]LogNet: NotifyAcceptingConnection accepted from: 192.168.104.11:45974
11-18 11:49:35.081: D/UE4(4768): [2020.11.18-14.49.35:081][752]LogHandshake: SendConnectChallenge. Timestamp: 50.106306, Cookie: 190119024088201106110144122059051004117115072161154227129002
11-18 11:49:35.456: D/UE4(4768): [2020.11.18-14.49.35:456][778]LogNet: NotifyAcceptingConnection accepted from: 192.168.104.11:45974
11-18 11:49:35.456: D/UE4(4768): [2020.11.18-14.49.35:456][778]LogHandshake: SendChallengeAck. InCookie: 061018091175072237155075085064225030227190175214013229249212
11-18 11:49:35.457: D/UE4(4768): [2020.11.18-14.49.35:457][778]LogNet: Server accepting post-challenge connection from: 192.168.104.11:45974
11-18 11:49:35.458: D/UE4(4768): [2020.11.18-14.49.35:458][778]PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent)
11-18 11:49:35.458: D/UE4(4768): [2020.11.18-14.49.35:458][778]LogNet: NotifyAcceptedConnection: Name: StartLevel, TimeStamp: 11/18/20 11:49:35, [UNetConnection] RemoteAddr: 192.168.104.11:45974, Name: IpConnection_2147482490, Driver: GameNetDriver IpNetDriver_2147482519, IsServer: YES, PC: NULL, Owner: NULL, UniqueId: INVALID
11-18 11:49:35.459: D/UE4(4768): [2020.11.18-14.49.35:459][778]LogNet: AddClientConnection: Added client connection: [UNetConnection] RemoteAddr: 192.168.104.11:45974, Name: IpConnection_2147482490, Driver: GameNetDriver IpNetDriver_2147482519, IsServer: YES, PC: NULL, Owner: NULL, UniqueId: INVALID
11-18 11:49:35.459: D/UE4(4768): [2020.11.18-14.49.35:459][778]LogHandshake: Received unexpected post-connect handshake packet - resending ack for LastChallengeSuccessAddress 192.168.104.11:45974 and LastCookie 061018091175072237155075085064225030227190175214013229249212.
11-18 11:49:35.459: D/UE4(4768): [2020.11.18-14.49.35:459][778]LogHandshake: SendChallengeAck. InCookie: 061018091175072237155075085064225030227190175214013229249212
11-18 11:49:35.484: D/UE4(4768): [2020.11.18-14.49.35:484][780]LogNet: NotifyAcceptingChannel Control 0 server World /Game/VoiceChatTest/Maps/StartLevel.StartLevel: Accepted
11-18 11:49:35.484: D/UE4(4768): [2020.11.18-14.49.35:484][780]LogNet: Remote platform little endian=1
11-18 11:49:35.484: D/UE4(4768): [2020.11.18-14.49.35:484][780]LogNet: This platform little endian=1
11-18 11:49:35.484: D/UE4(4768): [2020.11.18-14.49.35:484][780]LogNetVersion: AudioChat 1.0.0.0, NetCL: 13144385, EngineNetVer: 14, GameNetVer: 0 (Checksum: 4070346691)
11-18 11:49:35.498: D/UE4(4768): [2020.11.18-14.49.35:498][781]LogNet: Login request: ?Name=localhost-0005CAB008D88BB7FBC8F76A085E6474 userId: NULL:localhost-0005CAB008D88BB7FBC8F76A085E6474 platform: NULL
11-18 11:49:35.512: D/UE4(4768): [2020.11.18-14.49.35:512][782]LogNet: Client netspeed is 10000
11-18 11:49:35.651: D/UE4(4768): [2020.11.18-14.49.35:651][792]LogNet: Join request: /Game/VoiceChatTest/Maps/StartLevel?Name=localhost-0005CAB008D88BB7FBC8F76A085E6474?SplitscreenCount=1
11-18 11:49:35.652: D/UE4(4768): [2020.11.18-14.49.35:652][792]LogOnlineVoice: OSS: RegisterRemoteTalker(localhost-0005CAB008D88BB7FBC8F76A085E6474) returned 0x00000000
11-18 11:49:35.652: D/UE4(4768): [2020.11.18-14.49.35:652][792]LogOnlineVoice: OSS: Unmuting remote talker (localhost-0005CAB008D88BB7FBC8F76A085E6474)
11-18 11:49:35.653: D/UE4(4768): [2020.11.18-14.49.35:653][792]LogOnlineVoice: OSS: StartRemoteVoiceProcessing(localhost-0005CAB008D88BB7FBC8F76A085E6474) returned 0x00000000
11-18 11:49:35.659: D/UE4(4768): [2020.11.18-14.49.35:659][792]LogNet: Join succeeded: localhost-0005CAB008
11-18 11:49:35.760: I/VrApi(4768): FPS=70,Prd=49ms,Tear=0,Early=0,Stale=4,VSnc=1,Lat=1,Fov=0D,CPU4/GPU=2/3,1171/490MHz,OC=FF,TA=0/70/70,SP=N/N/N,Mem=2092MHz,Free=2604MB,PSM=0,PLS=0,Temp=25.0C/0.0C,TW=2.01ms,App=15.29ms,GD=0.98ms,CPU&GPU=21.62ms,LCnt=1,GPU%=0.99,CPU%=0.31(W0.36),DSF=1.00
11-18 11:49:36.041: D/UE4(4768): [2020.11.18-14.49.36:041][816]LogOnlineVoice: OSS: Unmuting remote talker (localhost-0005CAB008D88BB7FBC8F76A085E6474)
11-18 11:49:36.399: D/soundtrigger(767): audio_extn_sound_trigger_get_parameters input string<snd_device_in=>
11-18 11:49:36.399: D/soundtrigger(767): extract_sm_handle input string <snd_device_in=> param string <snd_device_in=>
11-18 11:49:36.399: I/hash_map_utils(794): key: 'snd_device_in' value: ''
11-18 11:49:36.401: D/soundtrigger(767): audio_extn_sound_trigger_get_parameters input string<snd_device_out=>
11-18 11:49:36.401: D/soundtrigger(767): extract_sm_handle input string <snd_device_out=> param string <snd_device_out=>
11-18 11:49:36.401: I/hash_map_utils(794): key: 'snd_device_out' value: ''
11-18 11:49:36.760: I/VrApi(4768): FPS=67,Prd=49ms,Tear=0,Early=0,Stale=10,VSnc=1,Lat=1,Fov=0D,CPU4/GPU=2/3,1171/490MHz,OC=FF,TA=0/70/70,SP=N/N/N,Mem=2092MHz,Free=2604MB,PSM=0,PLS=0,Temp=25.0C/0.0C,TW=2.01ms,App=14.28ms,GD=0.81ms,CPU&GPU=22.42ms,LCnt=1,GPU%=0.99,CPU%=0.38(W0.48),DSF=1.00
11-18 11:49:36.861: I/chatty(862): uid=1000(system) ControllerStrea expire 6 lines
11-18 11:49:37.760: I/VrApi(4768): FPS=70,Prd=49ms,Tear=0,Early=0,Stale=6,VSnc=1,Lat=1,Fov=0D,CPU4/GPU=2/3,1171/490MHz,OC=FF,TA=0/70/70,SP=N/N/N,Mem=2092MHz,Free=2602MB,PSM=0,PLS=0,Temp=25.0C/0.0C,TW=2.01ms,App=15.07ms,GD=0.81ms,CPU&GPU=22.70ms,LCnt=1,GPU%=0.99,CPU%=0.28(W0.37),DSF=1.00
11-18 11:49:37.961: D/UE4(4768): [2020.11.18-14.49.37:961][950]LogVoiceDecode: Display: DecoderVersion: libopus unknown-fixed
11-18 11:49:37.963: D/UE4(4768): [2020.11.18-14.49.37:963][950]LogVoiceDecode: Warning: Decompression buffer too small to decode voice
11-18 11:49:37.964: D/UE4(4768): [2020.11.18-14.49.37:964][950]LogOutputDevice: Warning:
11-18 11:49:37.964: D/UE4(4768): Script Stack (0 frames):
11-18 11:49:37.964: D/UE4(4768): Ensure condition failed: Amplitude >= 0.0f && Amplitude <= 1.0f [File:D:/Build/++UE4/Sync/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/VoiceInterfaceImpl.cpp] [Line: 816]
11-18 11:49:37.976: D/UE4(4768): [GameActivity] Used memory: 907125
11-18 11:49:38.009: D/UE4(4768): [2020.11.18-14.49.38:009][950]LogStats: FPlatformStackWalk::StackWalkAndDump - 0.045 s
11-18 11:49:38.009: D/UE4(4768): [2020.11.18-14.49.38:009][950]LogOutputDevice: Error: === Handled ensure: ===
11-18 11:49:38.010: D/UE4(4768): [2020.11.18-14.49.38:009][950]LogOutputDevice: Error:
11-18 11:49:38.010: D/UE4(4768): [2020.11.18-14.49.38:010][950]LogOutputDevice: Error: Ensure condition failed: Amplitude >= 0.0f && Amplitude <= 1.0f [File:D:/Build/++UE4/Sync/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/VoiceInterfaceImpl.cpp] [Line: 816]
11-18 11:49:38.010: D/UE4(4768): [2020.11.18-14.49.38:010][950]LogOutputDevice: Error:
11-18 11:49:38.010: D/UE4(4768): [2020.11.18-14.49.38:010][950]LogOutputDevice: Error: Stack:
11-18 11:49:38.010: D/UE4(4768): [2020.11.18-14.49.38:010][950]LogOutputDevice: Error: [Callstack] 0x00000000C421E0AC libUE4.so(0x00000000051120AC)![Unknown]() ]
11-18 11:49:38.010: D/UE4(4768): [2020.11.18-14.49.38:010][950]LogOutputDevice: Error: [Callstack] 0x00000000C41E7C10 libUE4.so(0x00000000050DBC10)!FOnlineVoiceImpl::ProcessRemoteVoicePackets() ]
11-18 11:49:38.010: D/UE4(4768): [2020.11.18-14.49.38:010][950]LogOutputDevice: Error: [Callstack] 0x00000000C41E1308 libUE4.so(0x00000000050D5308)!FOnlineVoiceImpl::Tick(float) ]
11-18 11:49:38.010: D/UE4(4768): [2020.11.18-14.49.38:010][950]LogOutputDevice: Error: [Callstack] 0x00000000C4AF7B28 libUE4.so(0x00000000059EBB28)!non-virtual thunk to FOnlineSubsystemNull::Tick(float) ]
11-18 11:49:38.010: D/UE4(4768): [2020.11.18-14.49.38:010][950]LogOutputDevice: Error: [Callstack] 0x00000000C4DD7584 libUE4.so(0x0000000005CCB584)!FTicker::Tick(float) ]
11-18 11:49:38.010: D/UE4(4768): [2020.11.18-14.49.38:010][950]LogOutputDevice: Error: [Callstack] 0x00000000C3F428BC libUE4.so(0x0000000004E368BC)!FEngineLoop::Tick() ]
11-18 11:49:38.010: D/UE4(4768): [2020.11.18-14.49.38:010][950]LogOutputDevice: Error: [Callstack] 0x00000000C3F37278 libUE4.so(0x0000000004E2B278)!AndroidMain(android_app*) ]
11-18 11:49:38.010: D/UE4(4768): [2020.11.18-14.49.38:010][950]LogOutputDevice: Error: [Callstack] 0x00000000C3F469DC libUE4.so(0x0000000004E3A9DC)!android_main() ]
11-18 11:49:38.010: D/UE4(4768): [2020.11.18-14.49.38:010][950]LogOutputDevice: Error: [Callstack] 0x00000000C3F75AE8 libUE4.so(0x0000000004E69AE8)![Unknown]() ]
11-18 11:49:38.010: D/UE4(4768): [2020.11.18-14.49.38:010][950]LogOutputDevice: Error: [Callstack] 0x00000000F3DFA550 libc.so(0x00000000000A5550)![Unknown]() ]
11-18 11:49:38.011: D/UE4(4768): [2020.11.18-14.49.38:011][950]LogOutputDevice: Error: [Callstack] 0x00000000F3DB4684 libc.so(0x000000000005F684)![Unknown]() ]
11-18 11:49:38.011: D/UE4(4768): [2020.11.18-14.49.38:011][950]LogOutputDevice: Error:
11-18 11:49:38.018: D/UE4(4768): [2020.11.18-14.49.38:018][950]LogStats: SubmitErrorReport - 0.000 s
11-18 11:49:38.018: D/UE4(4768): [2020.11.18-14.49.38:018][950]LogStats: SendNewReport - 0.000 s
11-18 11:49:38.019: D/UE4(4768): [2020.11.18-14.49.38:018][950]LogStats: FDebug::EnsureFailed - 0.055 s
11-18 11:49:38.019: D/UE4(4768): [2020.11.18-14.49.38:019][950]LogBlueprintUserMessages: [BP_VCTestGameInstance_C_2147482602] localhost-0005CAB008D88BB7FBC8F76A085E6474 has started to talk
11-18 11:49:38.019: D/UE4(4768): [2020.11.18-14.49.38:019][950]LogOnlineVoice: OSS: Trigger Remote localhost-0005CAB008D88BB7FBC8F76A085E6474 TALKING
11-18 11:49:38.028: I/VrRuntimeService(2065): RuntimeServiceSDKServer::CreateSwapChain: 848510050
11-18 11:49:38.030: I/VrRuntimeServer(2065): CreateTextureSwapChain: result importswapchaingles 1
11-18 11:49:38.042: W/VrRuntimeClient(4768): GetSamplerStateFromClientTexture: not currently supported for Vulkan.
11-18 11:49:38.295: D/UE4(4768): [2020.11.18-14.49.38:295][970]LogBlueprintUserMessages: [BP_VCTestGameInstance_C_2147482602] localhost-0005CAB008D88BB7FBC8F76A085E6474 has started to talk
11-18 11:49:38.295: D/UE4(4768): [2020.11.18-14.49.38:295][970]LogOnlineVoice: OSS: Trigger Remote localhost-0005CAB008D88BB7FBC8F76A085E6474 NOTTALKING


From which the line :
Ensure condition failed: Amplitude >= 0.0f && Amplitude <= 1.0f [File:D:/Build/++UE4/Sync/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/VoiceInterfaceImpl.cpp] [Line: 816]

Looks important, even more regarding it is present on a bugfix for Steam voice Chat (4.25.1 Hotfix released - Unreal Engine Forums), but I can’t get the commit of that change or if that is really the issue.

Cheers,

@pekayatt

The commit is probably this one:

https://github.com/EpicGames/UnrealEngine/commit/cb958257f93b7929b604230cfd30a168e63e1586

Looks like they have only changed the assert.

Using a empty project eventually is a good idea. I only had a black screen and could not debug further.

Cheers

Hello,

You can use this plugin for voice chat, it works Cross-platform on Windows, Android, iOS.

You can do global, team and proximity voice chat.
It is optimized with the usage of opus codec,
and you can choose microphone sampling rate and number of channels, you can also get the raw Pcm data of microphone input.