title: AudioSessionSetActive fails after interruption
body: <p>I was trying to figure out what actually happens for weeks and I have no idea why I cannot continue playback after interruption, so probably you guys know an answer. AudioSessionSetActive(TRUE) always returns '!cat' which is kAudioSessionIncompatibleCategory  while re-activation if my app plays in background and I am in different app. Although it works fine and continues playback if I caught interruption while being in my app. </p>
  
  <p>Original code actually has all AudioSession and AudioQueue calls wrapped in macros which prints OSStatus if it means error, but I removed it for better readability. Also, [self pause] just toggles pause, so basically it calls AudioQueueStart(audioQueue, NULL) on upause but it doesn't work ofcourse if AudioSession fails.</p>
  
  <p>Audio Session initialization code:</p>
  
  <pre><code>AudioSessionInitialize(NULL, NULL, _audioSessionInterruptionListener, self);
  UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback;
  AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(sessionCategory), &amp;sessionCategory);
  AudioSessionAddPropertyListener(kAudioSessionProperty_AudioRouteChange, _audioSessionPropertyListener, self);
  AudioSessionSetActive(TRUE);
  </code></pre>
  
  <p>Interruption handler code:</p>
  
  <pre><code>- (void)handleInterruptionChangeToState:(AudioQueuePropertyID)inInterruptionState 
  {
      if(inInterruptionState == kAudioSessionBeginInterruption)
      {
  
          NSLog(@"+Interruption"); 
  
          if(self.state == NX_STATE_PLAY) 
          {
              [self pause];
              AudioSessionSetActive(FALSE);
  
              isPausedByInterruption = YES;
          }
      }
      else if(inInterruptionState == kAudioSessionEndInterruption) 
      {
          if(isPausedByInterruption) 
          {
              AudioSessionSetActive(TRUE);
              [self pause];
  
              isPausedByInterruption = FALSE;
          }
  
          NSLog(@"-Interruption");
      }
  }
  </code></pre>
  
  <p>This streamer source code can be found here <a href="https://bitbucket.org/and/amaudiostreamer/src/122de41fe6c0/AMAudioStreamer/AMAudioStreamer/Classes/NxAudioStreamer.m" rel="noreferrer">https://bitbucket.org/and/amaudiostreamer/src/122de41fe6c0/AMAudioStreamer/AMAudioStreamer/Classes/NxAudioStreamer.m</a> if it's gonna help somehow to resolve an issue..</p>