No announcement yet.

Create/Join Session Blueprint Voice Chat

  • Filter
  • Time
  • Show
Clear All
new posts

    Make sure that you have correctly setup your input device in System Preferences > Sound.

    Try a simpler test case - on one Mac bring down the console & enter 'online test voice' without the quotes. This should start playing the capture back through the speakers. During implementation, I disabled the compression/decompression routines so that I could be sure that what I'd done worked by modifying the default value for bUseDecompressed in TestVoice.cpp. If that makes the test work then at least we know the problem is somewhere in the encoding or decoding.


      Ok, 'online test voice' works, I can hear my voice. Is there a way I can test if voice chat is working using a single mac? (e.g. both clients on the same machine?)

      Exiting the clients or the editor I often get the following crash log:

      Exiting the client often I get this crash:
      <SOURCE END>

      OALCaptureDevice::~OALCaptureDevice() Address = 0x1088dbf41 (filename not found) [in OpenAL]
      alcCaptureCloseDevice() Address = 0x1088c1843 (filename not found) [in OpenAL]
      FVoiceCaptureOpenAL::~FVoiceCaptureOpenAL() Address = 0x1030ec97e (filename not found) [in xxx]
      FVoiceEngineImpl::~FVoiceEngineImpl() Address = 0x10310d5cb (filename not found) [in xxx]
      FVoiceEngineImpl::~FVoiceEngineImpl() Address = 0x10310d95e (filename not found) [in xxx]
      FOnlineVoiceImpl::~FOnlineVoiceImpl() Address = 0x10310fd05 (filename not found) [in xxx]
      FOnlineVoiceImpl::~FOnlineVoiceImpl() Address = 0x1031100ae (filename not found) [in xxx]
      FOnlineSubsystemNull::Shutdown() Address = 0x1045e3184 (filename not found) [in xxx]
      FOnlineSubsystemModule::ShutdownOnlineSubsystem() Address = 0x1030dd557 (filename not found) [in xxx]
      FModuleManager::UnloadModule(FName, bool) Address = 0x101bb4dea (filename not found) [in xxx]
      FModuleManager::UnloadModulesAtShutdown() Address = 0x101bb5986 (filename not found) [in xxx]
      FEngineLoop::Exit() Address = 0x1019e58ca (filename not found) [in xxx]
      GuardedMain(wchar_t const*) Address = 0x1019e638e (filename not found) [in xxx]
      -[UE4AppDelegate() Address = 0x1019f1a93 (filename not found) [in xxx]
      -[FCocoaGameThread() Address = 0x101acf038 (filename not found) [in xxx]
      __NSThread__main__() Address = 0x7fff8e29c90a (filename not found) [in Foundation]
      _pthread_body() Address = 0x7fff92fa3268 (filename not found) [in libsystem_pthread.dylib]
      _pthread_body() Address = 0x7fff92fa31e5 (filename not found) [in libsystem_pthread.dylib]
      thread_start() Address = 0x7fff92fa141d (filename not found) [in libsystem_pthread.dylib]
      Last edited by devel.bmad; 03-05-2015, 07:07 PM.


        Also, compiling for iOS fails with the following crash log:

        Thread 4 Crashed:
        0 UE4Editor-Core.dylib 0x00000001086fa985 rml::internal::Block::freePublicObject(rml::internal::FreeObject*) + 69
        1 UE4Editor-Core.dylib 0x00000001088c26c9 operator delete(void*) + 9
        2 0x0000000118488f41 OALCaptureDevice::~OALCaptureDevice() + 41
        3 0x000000011846e843 alcCaptureCloseDevice + 226
        4 UE4Editor-Voice.dylib 0x00000001184e33be FVoiceCaptureOpenAL::~FVoiceCaptureOpenAL() + 254 (VoiceModuleMac.cpp:77)
        5 UE4Editor-Voice.dylib 0x00000001184e294e FVoiceCaptureOpenAL::~FVoiceCaptureOpenAL() + 14 (VoiceModule.cpp:8)
        6 UE4Editor-OnlineSubsystemUtils.dylib 0x00000001182c0780 FVoiceEngineImpl::~FVoiceEngineImpl() + 336 (SharedPointerInternals.h:260)
        7 UE4Editor-OnlineSubsystemUtils.dylib 0x00000001182c0b7e FVoiceEngineImpl::~FVoiceEngineImpl() + 14 (OnlineSubsystemUtils.cpp:31)
        8 UE4Editor-OnlineSubsystemUtils.dylib 0x00000001182c3195 FOnlineVoiceImpl::~FOnlineVoiceImpl() + 181 (SharedPointerInternals.h:192)
        9 UE4Editor-OnlineSubsystemUtils.dylib 0x00000001182c358e FOnlineVoiceImpl::~FOnlineVoiceImpl() + 14 (OnlineSubsystemUtils.cpp:31)
        10 UE4Editor-OnlineSubsystemNull.dylib 0x00000001271a7561 FOnlineSubsystemNull::Shutdown() + 545 (SharedPointerInternals.h:192)
        11 UE4Editor-OnlineSubsystem.dylib 0x0000000114c16d87 FOnlineSubsystemModule::ShutdownOnlineSubsystem() + 359 (BitArray.h:689)
        12 UE4Editor-Core.dylib 0x000000010891314e FModuleManager::UnloadModule(FName, bool) + 222
        13 UE4Editor-Core.dylib 0x0000000108913f09 FModuleManager::UnloadModulesAtShutdown() + 2505
        14 com.epicgames.UE4Editor 0x00000001086989ee FEngineLoop::Exit() + 1086 (LaunchEngineLoop.cpp:2097)
        15 com.epicgames.UE4Editor 0x0000000108699539 GuardedMain(wchar_t const*) + 2553 (Launch.cpp:60)
        16 com.epicgames.UE4Editor 0x00000001086a778f -[UE4AppDelegate runGameThread:] + 223 (LaunchMac.cpp:192)
        17 UE4Editor-Core.dylib 0x00000001087f8048 -[FCocoaGameThread main] + 88
        18 0x00007fff8e29c90a __NSThread__main__ + 1345
        19 libsystem_pthread.dylib 0x00007fff92fa3268 _pthread_body + 131
        20 libsystem_pthread.dylib 0x00007fff92fa31e5 _pthread_start + 176
        21 libsystem_pthread.dylib 0x00007fff92fa141d thread_start + 13


          Thanks devel.bmad - I'll investigate the crash, I'm not sure what else to suggest if the voice module itself is working. BTW what changes were needed for iOS? I can then integrate them in as well - it may be better to add this as a Git pull request so that you get proper credit too.
          Last edited by marksatt-pitbull; 03-06-2015, 07:03 AM.


            I haven't integrated it in iOS yet, I was just pointing out that packaging for iOS would cause this crash with the patch (packaging for mac works - the crash seems related to openAL anyway). When 2 clients are connected is there a way if a client is actually configured for sending/receiving sound (or to check if it is decoding an incoming stream?)

            Maybe it is a problem of configuration.. I've set this in DefaultEngine.ini:


            And this in DefaultGame.ini

            shall I use some console command to start the voice chat or can I somehow check the current connection status?

            Is there a way to test that with both clients on a single PC?
            Last edited by devel.bmad; 03-06-2015, 01:43 PM.


              Ok, it still keeps crashing, but I manage to have voice working by properly creating and joining sessions through blueprints :-)

              Is voice supposed to work also in remote connections (e.g. machines not on the same LAN)? I mean, I know OnlineSubsystemNull is meant to provide the facilities to find sessions only in the LAN, but provided I'm not using these facilities, can I use the voicechat with OnlineSubsystemNull connecting to a machine in the Internet? Is there a way to join a remote session specifying the IP address with this subsystem?
              Last edited by devel.bmad; 03-07-2015, 07:17 PM.


                I've just replaced the OpenAL code with CoreAudio - commit #c8d4759 - that should stop the crash closing the voice capture objects. This code still hasn't been well tested though, so there may be other problems. I'm not familiar with how the voice-module integrates with the rest of the engine & games, so I'm afraid I can't be of much help there.


                  Hi, I'll try it out soon. I get the following errors compiling:
                  UnrealEngine-4.7.2-release/Engine/Source/Runtime/Online/Voice/Private/Mac/VoiceModuleMac.cpp:49:31: Too few arguments to function call, expected 2, have 1
                  UnrealEngine-4.7.2-release/Engine/Source/Runtime/Online/Voice/Private/Mac/VoiceModuleMac.cpp:176:30: Too few arguments to function call, expected 2, have 1

                  I had to change the two calls from FMemory::Memzero(BufferList); to FMemory::MemZero(BufferList);
                  and from FMemory::Memzero(NativeDesc); to FMemory::MemZero(NativeDesc);
                  Last edited by devel.bmad; 03-10-2015, 03:43 PM.


                    Ehi @marksatt-pitbull, any update on this? Is there anything more I can do to investigate the problem?
                    Checking the source code, I see it is the following command in GetVoiceData (inVoiceModuleMac.cpp) to fail whenever CurrentRead != 0:

                    State = CopyBuffer(ReadBuffer, Data, ReadOffset, CurrentRead);

                    in particular, inside CopyBuffer, the conversion from different sample rates (16000 and 44100) fails with an kAudioConverterErr_InvalidInputSize error code:

                    if ( AudioConverterFillComplexBuffer(StreamConverter, &FVoiceCaptureCoreAudio::ConvertInputFormat, &InputBuffer, &FramesToCopy, &OutputBuffer, nullptr) == 0 )

                    So, it is probably the size of the input buffer not set properly? I've not found yet how to fix this..
                    Last edited by devel.bmad; 03-17-2015, 05:34 AM.


                      So, kind of fixed the kAudioConverterErr_InvalidInputSize error by adding
                      *IONumberDataPackets = (IOData->mBuffers[0].mDataByteSize / 2);
                      inside static OSStatus ConvertInputFormat.

                      Now "online test voice" plays my voice back, but the audio is slowed down and stretched, so there's something wrong with the sample rate conversion still...


                        Ok, figured it out, it was a bit more complex than that. There where a couple of things that needed to be modified in the sample rate conversione in order to have it working. Created pull request #952
                        Last edited by devel.bmad; 03-20-2015, 09:09 PM.


                          I'm not going to be able to help too much with the actual creation of the Mac audio output, but I can help with the Opus encoding/decoding and the transmission of voice over the connection.

                          At present voice depends greatly on the proper setup of your online session through create/join session. UserIds must be registered with all parties in order for voice to work.

                          You can do DumpOnlineSessionState on all clients/servers to see the status of the sessions and player registration.
                          You can do DumpVoiceMutingState, as you have seen, to see what players are registered with the voice system. Anyone not listed there probably can't speak/hear anyone listed there.

                          OnlineSubsystemNULL provides only a basic mock interface/functionality but still has enough to provide unique UserIds per player and should go through the session/voice registration flow.

                          It might be useful to provide the dump output here so we can take a look. Also in the logs on all clients/servers, if you unsuppress LogVoice, are notifications for RegisterRemoteTalker and RegisterLocalTalker. These calls must be made for voice to work

                          Now with push to talk disabled, there should be a call to StartNetworkedVoice which is also logged via LogVoice. This is called by ToggleSpeaking or more importantly ClientEnableNetworkVoice which is called in PostLogin of the AGameMode.

                          If you follow some of these paths, you should be able to determine whether the network code is setup properly to transmit voice. Let me know where any shunting or early outs occur and we can address that.

                          You can also #define VOICE_LOOPBACK 1 in VoiceInterface.h to have the local data piped back into the "received remote packet" flow. You should then hear exactly what you're sending.

                          The core "transmit voice" code flow is

                          Client sending voice traffic:

                          // Generate local packets

                          // Send any local packets queued

                          Client Receiving voice traffic:

                          // Packet received
                          // Packet put on remote voice queue
                          // Process remote packets


                            Thanks Josh, very informative! Talking about push to talk:
                            Now with push to talk disabled, there should be a call to StartNetworkedVoice which is also logged via LogVoice. This is called by ToggleSpeaking or more importantly ClientEnableNetworkVoice which is called in PostLogin of the AGameMode.
                            Can you control this also via blueprint? If so, how?


                              Hold on people, can voice chat be accomplished in just blueprints?
                              Last edited by Jamendxman3; 07-03-2015, 08:38 PM.
                              Marketplace Assets

                              Advanced Mobile Input: Marketplace Page | Support Thread ――― Easy Input Remapping: Marketplace Page | Support Thread
                              Multiplayer Blueprint Chat System: Marketplace Page | Support Thread ――― Closing Credits System: Marketplace Page | Support Thread
                              Minesweeper Template: Marketplace Page | Support Thread ――― Maze Creator: Marketplace Page | Support Thread


                                Originally posted by Jamendxman3 View Post
                                Hold on people, can voice chat be accomplished in just blueprints?
                                I would also like to know about this. Thanks.