28 Replies
      Latest reply on May 1, 2020 9:49 PM by PBK
      bram Level 1 Level 1 (10 points)

        So, GKVoiceChatService has been deprecated, as shown here:

        https://developer.apple.com/documentation/gamekit/gkvoicechatservice

         

        But it does not specify a replacement for it.

         

        Was Voice Chat just dropped from iOS features, and never brought back?

        • Re: GKVoiceChat replacement?
          Brian Greenstone Level 2 Level 2 (40 points)

          Interesting.  I hadn't seen the deprecation notice on that, but it makes sense because Voice Chat stopped working in iOS 10 and still doesn't work in iOS 11.  It used to be amazing, but ever since iOS 6 it kept getting more and more buggy with each iOS release.  At WWDC I'd ask the Game Center team about this and they acknowledged the problems, but blamed them on the Core Audio team, so nothing has ever gotten fixed.

           

          In iOS 10 it completely broke, however.  Sometimes it works fine for a little while but then suddenly the game will halt entirely or slow down to about 2 frames/sec before crashing.  This would typically be triggered when the other player on the other end of the chat disconnected from the chat.  But in iOS 11 it hangs and crashes pretty much immediately after voice chat starts.

           

          -Brian

            • Re: GKVoiceChat replacement?
              schwghrt Level 1 Level 1 (0 points)

              Does any one know if the plan on fixing this, or if there is another way to do voice chat? 

                • Re: GKVoiceChat replacement?
                  Brian Greenstone Level 2 Level 2 (40 points)

                  Back when I worked at Apple in the 90's bugs like this would have never been allowed to happen.  They wouldn't have let an OS update go out with a critical bug like this, but ever since Steve died it seems nobody really cares about bugs over there, so they just keep piling up and never get fixed.  The years go by and with each iOS release Game Center becomes more and more unusable.

                   

                  In the old days I would say "yes, they'll have it fixed with the next OS update", but these days I'm about 80% sure iOS 11 will ship with it still broken.  Such a shame because Apple's Voice Chat implementation in iOS 4 and 5 was absolutely perfect - best voice chat the gaming business has ever seen.  But things have gotten progressively worse since iOS 6, and Voice Chat completely broke in iOS 10.

                   

                  -Brian

                • Re: GKVoiceChat replacement?
                  Brian Greenstone Level 2 Level 2 (40 points)

                  No, it hasn't worked at all since iOS 9.   Even prior to that it started to get buggy with iOS 7 and 8, but now in iOS 10 and 11 it is completely broken and doesn't work.  If you look at the header files you'll see they've deprecated the voice chat calls in Game Center.

                   

                  -Brian

                    • Re: GKVoiceChat replacement?
                      PBK Level 7 Level 7 (3,795 points)

                      For clarity, are you saying that GKVoiceChat is deprecated or that GKVoiceChatService is deprecated.  I see nothing indicating that GKVoiceChat is deprecated.

                        • Re: GKVoiceChat replacement?
                          Brian Greenstone Level 2 Level 2 (40 points)

                          The headers for GKvoiceChatService don't say it's deprecated, so who knows.  The GKVoiceChat does say it, however. 

                           

                          -Brian

                          • Re: GKVoiceChat replacement?
                            Brian Greenstone Level 2 Level 2 (40 points)

                            Actually, I take that back.  The headers don't say it's deprecated, but the docs do.

                             

                            According to Apple's docs this is also deprecated:   https://developer.apple.com/documentation/gamekit/gkvoicechatservice

                             

                             

                            -Brian

                              • Re: GKVoiceChat replacement?
                                PBK Level 7 Level 7 (3,795 points)

                                Let me try to understand.

                                 

                                1) Clearly "GKVoiceChatService" is deprecated. We agree.

                                2) I cannot find any documents that indicate that "GKVoiceChat" is deprecated.  Why do you believe that GKVoiceChat is deprecated?  It is not marked deprecated in the documents here:

                                https://developer.apple.com/documentation/gamekit/gkvoicechat?language=objc

                                3) Are you having trouble with GKVoiceChatService or with GKVoiceChat?

                                  • Re: GKVoiceChat replacement?
                                    Brian Greenstone Level 2 Level 2 (40 points)

                                    Look in the header file.

                                      • Re: GKVoiceChat replacement?
                                        PBK Level 7 Level 7 (3,795 points)

                                        I looked. 

                                        There are a few methods in GKVoiceChat that are listed as deprecated.  But not all!!  The header is consistent with the document as far as which methods and properties are deprecated and which are not.

                                         

                                        Also, to answer your first question, GKVoiceChat  replaces GKVoiceChatService.  The GKVoiceChatService header file has the following:

                                         

                                        NS_CLASS_DEPRECATED_IOS(3_0, 7_0, "Use GKVoiceChat instead")

                                          • Re: GKVoiceChat replacement?
                                            Brian Greenstone Level 2 Level 2 (40 points)

                                            Apple hasn't fixed the Voice Chat bugs since iOS 7, and it hasn't worked at all since iOS 10, so I think that alone makes it safe to say the entire thing has been deprecated.  They care so little about Game Center that they haven't bothered updating the docs or headers to fully represent just how deprecated it is.

                                             

                                            -Brian

                                              • Re: GKVoiceChat replacement?
                                                PBK Level 7 Level 7 (3,795 points)

                                                There is some confusion about GKVoiceChatService and GKVoiceChat.  Both are often referred to as Voice Chat.  So to help communiacte, let's use the specific terms.

                                                 

                                                Can you absolutely confirm that GKVoiceChat is not working in your hands?  Or are you saying that GKVoiceChatService is not working?

                                                  • Re: GKVoiceChat replacement?
                                                    Brian Greenstone Level 2 Level 2 (40 points)

                                                    Yes, GKVoiceChat has not worked at all since iOS 9, and it has not worked 'properly' since iOS 6.  It does not work at all on iOS 10 or 11.

                                                     

                                                    -Brian

                                                      • Re: GKVoiceChat replacement?
                                                        PBK Level 7 Level 7 (3,795 points)

                                                        Thanks.

                                                        • Re: GKVoiceChat replacement?
                                                          PBK Level 7 Level 7 (3,795 points)

                                                          I have GKVoiceChat working but it generates lots of log errors.  Is this expected behavio?

                                                           

                                                          The errors are like these:

                                                           

                                                          2018-05-29 15:41:40.699587-0400 Go[8271:5490221] [log]  [ERROR] openLogDump:65 failed to open /var/mobile/Library/Caches/com.apple.VideoConference/logs/20180529-154140-1878302868-CallSettings.calldump with error 1
                                                          2018-05-29 15:41:40.776685-0400 Go[8271:5490341] [] WiFi:[549315700.776529]: Missing com.apple.wifi.manager-access entitlement
                                                          2018-05-29 15:41:40.776772-0400 Go[8271:5490341] [] WiFi:[549315700.776767]: Missing com.apple.wifi.manager-access entitlement
                                                          2018-05-29 15:41:40.776879-0400 Go[8271:5490341] [] WiFi:[549315700.776874]: Missing com.apple.wifi.manager-access entitlement
                                                          2018-05-29 15:41:40.776934-0400 Go[8271:5490341] [] WiFi:[549315700.776930]: Missing com.apple.wifi.manager-access entitlement
                                                          2018-05-29 15:41:40.777356-0400 Go[8271:5490341] [] WiFi:[549315700.777351]: Missing com.apple.wifi.manager-access entitlement
                                                          2018-05-29 15:41:42.903245-0400 Go[8271:5489904] Bad response from apsd: Connection interrupted
                                                          2018-05-29 15:41:42.903925-0400 Go[8271:5490226] [xpc] Interrupted connection to service com.apple.apsd
                                                          2018-05-29 15:41:42.911918-0400 Go[8271:5489904] [Warning] Remote loader crashed for request: <NSMutableURLRequest: 0x1c000bf90> { URL: http://init.ess.apple.com/WebObjects/VCInit.woa/wa/getBag?ix=4 }
                                                          2018-05-29 15:41:42.912453-0400 Go[8271:5489904] [Warning]  => Retrying... (0/5) retries
                                                          2018-05-2
                                                          
                                                          2018-05-29 15:42:53.745496-0400 Go[8271:5490427] [log]  [ERROR] JLagProcessor_DetectSpike:221 Bundling , looks incorrect 0
                                                          2018-05-29 15:42:54.256481-0400 Go[8271:5490427] [log]  [ERROR] JLagProcessor_DetectSpike:221 Bundling , looks incorrect 0
                                                          2018-05-29 15:42:54.706706-0400 Go[8271:5490427] [log]  [ERROR] JLagProcessor_DetectSpike:221 Bundling , looks incorrect 0
                                                          2018-05-29 15:42:55.270364-0400 Go[8271:5490427] [log]  [ERROR] JLagProcessor_DetectSpike:221 Bundling , looks incorrect 0
                                                          2018-05-29 15:42:55.794207-0400 Go[8271:5490427] [log]  [ERROR] JLagProcessor_DetectSpike:221 Bundling , looks incorrect 0
                                                          2018-05-29 15:42:56.795208-0400 Go[8271:5490427] [log]  [ERROR] JLagProcessor_DetectSpike:221 Bundling , looks incorrect 0
                                                          2018-05-29 15:42:57.334383-0400 Go[8271:5490427] [log]  [ERROR] JLagProcessor_DetectSpike:221 Bundling , looks incorrect 0
                                                          2018-05-29 15:42:57.819354-0400 Go[8271:5490427] [log]  [ERROR] JLagProcessor_DetectSpike:221 Bundling , looks incorrect 0
                                                          2018-05-29 15:43:03.726063-0400 Go[8271:5490427] [log]  [ERROR] JLagProcessor_DetectSpike:221 Bundling , looks incorrect 0
                                                          9 15:41:42.914989-0400 Go[8271:5489904] [Warning] Remote loader crashed for request: <NSMutableURLRequest: 0x1c000bf90> { URL: http://init.ess.apple.com/WebObjects/VCInit.woa/wa/getBag?ix=4 }
                                                          2018-05-29 15:41:42.915089-0400 Go[8271:5489904] [Warning]  => Retrying... (1/5) retries
                                                          2018-05-29 15:41:45.807758-0400 Go[8271:5490221] [log] VideoConference [ERROR] -[VideoConference inviteDataForParticipantID:callID:remoteInviteData:nonCellularCandidateTimeout:error:]:855 VideoConference: CALLID MISMATCH 0x10375cf10 client callID 6127573116 internal callID 0
                                                          2018-05-29 15:41:45.809792-0400 Go[8271:5490338] [log]  [ERROR] VCAudioReceiver_DiscardQueueExcess:454 AudioReceiver is NULL
                                                          2018-05-29 15:41:45.809926-0400 Go[8271:5490338] [log]  [ERROR] VCAudioReceiver_DiscardQueueExcess:454 AudioReceiver is NULL
                                                          
                                                          
                                                          
                                                          
                                                          
                                                          
                                                          
                                      • Re: GKVoiceChat replacement?
                                        gpBenAgain Level 1 Level 1 (0 points)

                                        Hi,

                                         

                                        I have just managed to get GKVoiceChat working.  I am using iOS11.3, and it works between an iPhone X and iPad 5th Gen.

                                         

                                        It does not work on an iPhone 6S, with console errors like this:

                                         

                                        [log]  [ERROR] -[VCVideoRuleCollections filterRules:byBitrateRule:]:88 VCVideoRuleCollections: invalid bitrate rule
                                        [log] VCRC [ERROR] AFRCSetTxCap:1410 Invalid parameter dwTxCap 0
                                        [log]  [ERROR] _AUIOSpkrProc:430 speaker sample buffer is too small (1280). Expected=1488 frames=372 bytesPerFrame=4 channels=1! BufferCount=1 size=1488
                                        [log]  [ERROR] _AUIOSpkrProc:430 speaker sample buffer is too small (1280). Expected=1484 frames=371 bytesPerFrame=4 channels=1! BufferCount=1 size=1484
                                        

                                         

                                        These are not errors I generate, or ask for, they just get spat out by iOS!

                                         

                                        Even when it does work, I still see some odd console errors like this:

                                         

                                        [log]  [ERROR] VCAudioReceiver_DiscardQueueExcess:454 AudioReceiver is NULL
                                        

                                         

                                        I am not getting any delegate callbacks though, so this doesn't work:

                                         

                                         

                                        [_voicechat setPlayerVoiceChatStateDidChangeHandler:^(GKPlayer *player, GKVoiceChatPlayerState state) {
                                                             // Never called!
                                                         }];
                                        

                                         

                                        But overall, voice chat does work...let me know if you find out anything else!

                                          • Re: GKVoiceChat replacement?
                                            PBK Level 7 Level 7 (3,795 points)

                                            bump - to place above spam

                                            • Re: GKVoiceChat replacement?
                                              PBK Level 7 Level 7 (3,795 points)

                                              EDIT - I got it to work.  I needed to do an [allChannel start]; BEFORE allChannel.active=YES;  not AFTER.

                                               

                                               

                                               

                                               

                                              I can get Game Center to work but not Voice Chat.  Anyone have any ideas what is wrong with this code?  I get a few errors on an iPhone 5s and many on an iPhone X.  The errors occur only if I include the [allChannel start] command in:

                                               

                                               

                                              (in the .h file:  )  #include 
                                              
                                              
                                              
                                                  AVAudioSession *audioSession = [AVAudioSession sharedInstance];
                                                  NSError *error= nil;
                                                  [audioSession setCategory:AVAudioSessionCategoryPlayAndRecord error:&error]; 
                                                  if(error){
                                                      NSLog(@"audioSession: %@ %ld %@", [error domain], (long)[error code], [[error userInfo] description]);
                                                      //           return;
                                                  }else{
                                                      [audioSession overrideOutputAudioPort:AVAudioSessionPortOverrideSpeaker error:&error];
                                                      if(error){
                                                          NSLog(@"audioSession1: %@ %ld %@", [error domain], (long)[error code], [[error userInfo] description]);
                                                      }else{
                                                          if( [GKVoiceChat isVoIPAllowed]){
                                                              allChannel=[myMatch voiceChatWithName:@"allPlayers"];
                                                              if(allChannel){ 
                                                                  allChannel.volume = 1.0;
                                                                  allChannel.active=YES;
                                                                  [allChannel start];     //EDIT - ERRROR IS IN THIS LINE - IT NEEDS TO BE BEFORE allChannel.active=YES:
                                                               }
                                                          }
                                                       }

                                               

                                               

                                              And here are the error messages:

                                               

                                               

                                              2018-05-17 14:38:50.123833-0400 Go[17875:17114561] [log]  [ERROR] VCAudioReceiver_DiscardQueueExcess:454 AudioReceiver is NULL
                                              
                                              // the following errors do not appear on the iPhone 5s.  They appear on the iPhone X and the last message is repeated over and over again.
                                              
                                              
                                              2018-05-17 14:38:55.250934-0400 Go[17875:17114119] [log]  [ERROR] openLogDump:65 failed to open /var/mobile/Library/Caches/com.apple.VideoConference/logs/20180517-143855-1280431540-CallSettings.calldump with error 1
                                              2018-05-17 14:38:55.336203-0400 Go[17875:17114605] [] WiFi:[548275135.335807]: Missing com.apple.wifi.manager-access entitlement
                                              2018-05-17 14:38:55.336334-0400 Go[17875:17114605] [] WiFi:[548275135.336327]: Missing com.apple.wifi.manager-access entitlement
                                              2018-05-17 14:38:55.336422-0400 Go[17875:17114605] [] WiFi:[548275135.336415]: Missing com.apple.wifi.manager-access entitlement
                                              2018-05-17 14:38:55.336510-0400 Go[17875:17114605] [] WiFi:[548275135.336503]: Missing com.apple.wifi.manager-access entitlement
                                              2018-05-17 14:38:55.336999-0400 Go[17875:17114605] [] WiFi:[548275135.336989]: Missing com.apple.wifi.manager-access entitlement
                                              2018-05-17 14:39:00.348760-0400 Go[17875:17114119] [log] VideoConference [ERROR] -[VideoConference inviteDataForParticipantID:callID:remoteInviteData:nonCellularCandidateTimeout:error:]:855 VideoConference: CALLID MISMATCH 0x101628380 client callID 6159411460 internal callID 0
                                              2018-05-17 14:39:00.484851-0400 Go[17875:17114119] [log] VCCallSession [ERROR] -[VCCallSession startConnectionWithParticipantID:callID:usingInviteData:isCaller:capabilities:idsSocket:destination:error:]_block_invoke:2215 - Reporting not available (no backends)
                                              2018-05-17 14:39:00.495563-0400 Go[17875:17114119] Bad response from apsd: Connection interrupted
                                              2018-05-17 14:39:00.500472-0400 Go[17875:17114119] [Warning] Remote loader crashed for request:  { URL: http://init.ess.apple.com/WebObjects/VCInit.woa/wa/getBag?ix=4 }
                                              2018-05-17 14:39:00.501037-0400 Go[17875:17114119] [Warning]  => Retrying... (0/5) retries
                                              2018-05-17 14:39:00.502538-0400 Go[17875:17114119] [Warning] Remote loader crashed for request:  { URL: http://init.ess.apple.com/WebObjects/VCInit.woa/wa/getBag?ix=4 }
                                              2018-05-17 14:39:00.502602-0400 Go[17875:17114119] [Warning]  => Retrying... (1/5) retries
                                              2018-05-17 14:39:00.646682-0400 Go[17875:17114244] [log]  [ERROR] HandleWRMEvent:53 /BuildRoot/Library/Caches/com.apple.xbs/Sources/AVConference/AVConference-1020.14/AVConference.subproj/Sources/WRMClient.m:53: WRMClient: invalid configuration event with kMessageID 0.
                                              2018-05-17 14:39:00.653248-0400 Go[17875:17114645] [log] VCRC [ERROR] AFRCSetTxCap:1410 Invalid parameter dwTxCap 0
                                              2018-05-17 14:39:02.625455-0400 Go[17875:17114119] [Warning] Remote loader crashed for request:  { URL: http://init.ess.apple.com/WebObjects/VCInit.woa/wa/getBag?ix=4 }
                                              2018-05-17 14:39:02.625555-0400 Go[17875:17114119] [Warning]  => Retrying... (2/5) retries
                                              2018-05-17 14:39:03.091496-0400 Go[17875:17114744] [log]  [ERROR] _AUIOSpkrProc:430 speaker sample buffer is too small (1280). Expected=4096 frames=1024 bytesPerFrame=4 channels=1! BufferCount=1 size=4096
                                              2018-05-17 14:39:03.154555-0400 Go[17875:17114744] [log]  [ERROR] _AUIOSpkrProc:430 speaker sample buffer is too small (1280). Expected=4096 frames=1024 bytesPerFrame=4 channels=1! BufferCount=1 size=4096
                                              2018-05-17 14:39:03.218734-0400 Go[17875:17114744] [log]  [ERROR] _AUIOSpkrProc:430 speaker sample buffer is too small (1280). Expected=4096 frames=1024 bytesPerFrame=4 channels=1! BufferCount=1 size=4096
                                                • Re: GKVoiceChat replacement?
                                                  PBK Level 7 Level 7 (3,795 points)

                                                  I got it to work.  I needed to do the

                                                       [allChannel start];

                                                  BEFORE

                                                       allChannel.active=YES;

                                                  not AFTER.

                                                    • Re: GKVoiceChat replacement?
                                                      mgoemmel Level 1 Level 1 (10 points)

                                                      I know your post is pretty old,  but I'm struggling at the same problem. My GKVoiceChat routines worked for some time, but now they are broken. I've tried anything suggested in this thread, but nothing. Does voice chat in your app still work with iOS 13.4.1?

                                                       

                                                      Regards

                                                      Markus

                                                        • Re: GKVoiceChat replacement?
                                                          PBK Level 7 Level 7 (3,795 points)

                                                          I do not know.  It works on 13.3.1.  You are welcome to try it out on these apps:

                                                              iPlayingCards

                                                              Go Game Connect

                                                           

                                                          One thing I discovered was that you need to ask permission to use the microphone by adding to the info.plist "Privacy - Microphone Usage Description"

                                                            • Re: GKVoiceChat replacement?
                                                              mjm23 Level 1 Level 1 (0 points)

                                                              I tried with iPlayingCards. Downloaded on two devices on the same wifi network and it worked. I could get audio/mic working through both devices. Then I put one device to cellular and it didn't work. Then, I tried to get a friend on a totally separate wifi network to download the app and try. They were able to get the audio/mic working on two devices on their network but when we tried connecting together (two devices on different wifi networks) the audio and mic did not work.

                                                               

                                                              I suspect voicechat only works when the devices are on the same network, but anyone with evidence to suggest otherwise, I'd appreciate hearing from you.

                                                                • Re: GKVoiceChat replacement?
                                                                  Brian Greenstone Level 2 Level 2 (40 points)

                                                                  The players definitely don't need to be on the same network.  It *should* work fine in any circumstances, but this is Apple we're talking about, so all bets are off.  They stopped caring about Game Center a very long time ago.  That being said, at least they finally fixed several cricital Game Center bugs that I reports... 5 years earlier.

                                                                   

                                                                  -Brian

                                                                  • Re: GKVoiceChat replacement?
                                                                    PBK Level 7 Level 7 (3,795 points)

                                                                    Yes, it seems that, today, VoiceChat works when the two devices are on the same WiFi network and does not work when the two devices are connected through a cellular network.  I do not know if it works if you connect both devices through different WiFi networks.  All of the VoiceChat API's (GKVoiceChat, GKMatch voiceChatWithName) are agnostic as to whether the connection to Game Center is through WiFi or Cellular so this must be a bug on Apple's part, today.

                                                                • Re: GKVoiceChat replacement?
                                                                  Brian Greenstone Level 2 Level 2 (40 points)

                                                                  Apple seemed to have fixed most of the voice chat issues in iOS 12.  The only reminaing issue is that it causes the app to momentarily lock up while the OS attempts to make the voice chat connection.  The original version of GKVoiceChat never did that, but at least that's the only annoyance I still see with it.  Other than that it has been working normally for me in Air Wings.

                                                                   

                                                                  -Brian