GKVoiceChat replacement?

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?

Replies

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

Thanks.

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!

bump - to place above spam

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

I got it to work. I needed to do the

[allChannel start];

BEFORE

allChannel.active=YES;

not AFTER.

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

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

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"

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

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.

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

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.

I finally also got voice chat to work again. The solution was to not play any other game sound while voice chat is active. In the past the game sound was muted by iOS automatically, now you have to do it yourself. If you try to play even one sound, the voice chat stops immediately.

But I have one question to the guys who seems to have more voice chat experience here (by the way AirWings is pretty cool): the volume the voice chat is playing is 100%, not matter if the volume slider is at 0 or 100, and not matter if I call setVolume:0.0 or setVolume:1.0, no matter if I call this before or after I active the voice chat etc. It is really very loud. Does anybody has an idea what I'm doing wrong?

Thanks a lot for any help

Markus