1

I try to create app with possibility to recognize music tracks, however each time I call block:

dispatch_async(self.internalQueue, ^{
   self.gnAudioVisualizeAdapter = [[GnAudioVisualizeAdapter alloc] initWithAudioSource:self.gnMic audioVisualizerDelegate:self];
  [self.gnMusicIDStream audioProcessStartWithAudioSource:(id )self.gnAudioVisualizeAdapter error:&musicIDStreamError];
});

I get error informing about deadlock

2014-10-20 13:29:59.954 BTTest[2193:595084] -[__NSArrayM enqueueObj:]: unrecognized selector sent to instance 0x17804f210

2014-10-20 13:29:59.976 BTTest[2193:595084] *** -[NSCondition lock]: deadlock ( '(null)')

2014-10-20 13:29:59.977 BTTest[2193:595084] *** Break on _NSLockError() to debug.

I just Copy&paste several methods from sample sdk into fresh project. Does anybody had similar problem on iOS?

Edit: Ok after few hours of digging I found solution: Add -ObjC into "other linker flags" now no info about deadlock... just "Error: 0xffffffceError: 0xffffd591"

The Tosters
  • 417
  • 3
  • 15
  • So you need to add the `-ObjC` linker flag to force the compiler to add the category `NSMutableArray+NSQueue.h`. However, do you still get a deadlock on that line? I have the same issue, where it appears to be deadlocking on `audioProcessStartWithAudioSource`. – Ric Santos Oct 30 '14 at 02:22
  • No, after adding this flag all worked as expected. other errors on console was due to wrong audio session management. I was able to fix it quite fast. – The Tosters Oct 30 '14 at 08:55

1 Answers1

1

As mentioned in the edit and comments, the -ObjC linker flag is required for the compiler to include the category NSMutableArray+NSQueue.h.

The code itself is not deadlocking, but rather the call to audioProcessStartWithAudioSource:: starts of a loop that is executed synchronously and does not return unless there is an error.

Ric Santos
  • 15,419
  • 6
  • 50
  • 75
  • please read second line logged by system. It clearly states that deadlock is detected and reported. – The Tosters Nov 02 '14 at 13:06
  • That second line occurs after the unrecognized selector causes an exception. Once this was resolved by adding `-ObjC` do you still get that log statement occurring? – Ric Santos Nov 03 '14 at 00:30
  • 1
    No, after adding flag it disappears. I referred your answer in which you stated that "The code itself is not deadlocking". At this moment this topic is solved. – The Tosters Nov 03 '14 at 10:40