Thanks Steve
no more sound after phone call interruption - SimpleAudioEngine
(69 posts) (15 voices)-
Posted 1 year ago #
-
Just did some testing, I think TomTheTurret is a bit of a red herring. I've been doing all my testing with the FadeToGrey demo. That works fine with the new CDAudioManager when calls are declined.
You can actually kill the sound effects in TomTheTurret simply by putting the phone in standby and then waking it.
Posted 1 year ago # -
@StevePerks, make sure you're implementing Steve's new method. This is the code I'm using in the init of our subclassed SAE:
[CDAudioManager configure:kAMM_FxPlusMusicIfNoOtherAudio]; [[CDAudioManager sharedManager] setResignBehavior:kAMRBStopPlay autoHandle:YES];Posted 1 year ago # -
Okay, the bad news is I found another issue. Simply putting the phone to sleep and then waking kills the sound effects.
The good news is I've fixed all the issues I've discovered with the latest CDAudioManager in my git clone. I would appreciate it if people could test it. Please ignore TomTheTurret for now, that code hasn't been updated for 4.x. If you want something to test with use FadeToGrey.
As tehsuck said - make sure you have the resign behavior set. kAMM_FxPlusMusicIfNoOtherAudio is actually default but it is probably good practice to set it explicitly.
I haven't tested on 3.x yet, that is a job for tomorrow.
These are all my test cases which now pass.
-
Incoming call - hang up from calling phone.
Incoming call - decline call on iPhone.
Incoming call - accept call on iPhone.
Incoming call - accept call and fast task switch back to app during call.
Alarm triggered during app usage.
Put phone to sleep then wake (i.e. push power button)
Fast task switch to iPod and start music.
Fast task switch to iPod and stop music.Posted 1 year ago # -
^ yes, it has been a bit of a nightmare. That test case of switching back to the app during a phone call was particularly nasty.
Thanks for your help sabshire.
Posted 1 year ago # -
Okay, the bad news is I found another issue. Simply putting the phone to sleep and then waking kills the sound effects.
@Steve - what OS / hardware are you using? I'm using iPhone 4 w/ 4.0 and the code you posted yesterday, and I *do not* have the sleep / resume issue with our game. It works as it should. So not sure why you were seeing that?
Also - I did just download the latest source from GIT, and did some tests on my iPhone 4 w/ iOS 4.0 and I'm having all sorts of random results with sound returning from an incoming call - locally declining after about ~3 rings. A few times everything came back as it should, once it came back without background music, once it came back without ANY sounds. So I guess it's still having random issues.
Posted 1 year ago # -
I'm using a 3gs with 4.0 and it seems to be working really well. Tried a lot variations, and all seems to be working for me. One thing to note for me though is that I am manually calling the applicationDidBecomeActive and applicationWillResignActive messages for CDAudioManager.
Posted 1 year ago # -
Okay, I have yet another version but I am pretty happy with this one. The problem with effects dropping out when the phone was put to sleep was definitely occurring so I thought I'd track down what the issue was. It appeared to be related to me using old 2.x compatible methods for doing things. So - I've taken out all the 2.x compatible stuff and replaced it with shiny new 3.x methods. The upside is things seem to work much better now, the downside is CocosDenshion is now only compatible with 3.x but given Apple's stance on 2.x I don't see that as a big issue.
I've tested on 4.01 iPhone, 3.2 WiFi iPad and 3.1.3 iPod Touch 1st Gen.
Edit: new code is in the development branch of cocos2d.
Posted 1 year ago # -
@Steve
Thank you for the hard work.
Where is the new code?
Here: http://github.com/steveoldmeadow/cocos2d-iphone/tree/develop/CocosDenshion/CocosDenshion ???
RRdaS
Posted 1 year ago # -
@RRdaS - it is in the development branch of cocos2d now:
http://github.com/cocos2d/cocos2d-iphone/tree/develop/CocosDenshion/CocosDenshion/
Posted 1 year ago # -
@Steve
Thank you very much.
RRdaS
Posted 1 year ago # -
@Steve, new version works well too. Thanks for the hard work! Much Appreciated!
Posted 1 year ago # -
@tehsuck - yes I was already using the new resign method, thanks anyway.
@Steve - just tested with your latest source on my 3GS/OS4.01 and can confirm that the sound now works as expected. I've tried various call scenarios (including rejecting calls) and putting the device to sleep. Thank you very much for the time you've put into this.
Posted 1 year ago # -
@sabshire and @StevePerks - thanks for testing and letting me know it works.
Posted 1 year ago # -
hi, sorry i'm a little late; in the hustle and bustle of finishing up my app i forgot about this thread. i really wish these forums had some kind of email subscription/notification!
@Steve Oldmeadow: just tried out the latest code in the develop branch and it works absolutely flawlessly over here!! i tried several different situations (including all of the ones you mentioned) and it handled 'em all! I'm using the kAMM_FxOnly mode. Thanks a ton for the hard work!
@mike950 you made red ball? awesome, nice job on that! :)
Posted 1 year ago # -
Hmm I must be doing something wrong somewhere because I still seem to be having the issue. Tried using the files from both the dev branch and the cloned source. Using an iPhone 4 with 4.0.1 and I still lose sound effects when I get and decline a phone call.
In ApplicationDidFinish Launching I have
// The audio engine for playing background music SimpleAudioEngine *sae = [SimpleAudioEngine sharedEngine]; [CDAudioManager configure:kAMM_FxPlusMusicIfNoOtherAudio]; [[CDAudioManager sharedManager] setResignBehavior:kAMRBStopPlay autoHandle:YES]; if (sae != nil) { [sae preloadBackgroundMusic:@"jazzbg.mp3"]; if (sae.willPlayBackgroundMusic) { sae.backgroundMusicVolume = [userDefaults floatForKey:@"music"]; } if (sae.backgroundMusicVolume > 0.0f) { [[SimpleAudioEngine sharedEngine] playBackgroundMusic:@"jazzbg.mp3"]; } sae.effectsVolume = [userDefaults floatForKey:@"soundFX"]; // Preload sound effects [sae preloadEffect:@"rock.caf"]; [sae preloadEffect:@"bug.caf"]; [sae preloadEffect:@"alarm.caf"]; }Later I do:
SimpleAudioEngine *sae = [SimpleAudioEngine sharedEngine]; rockFx = [[sae soundSourceForFile:@"rock.caf"] retain]; bugFx = [[sae soundSourceForFile:@"bug.caf"] retain]; alarmFx = [[sae soundSourceForFile:@"alarm.caf"] retain];And to play a sound I call.
[rockFx play];(I was just using [[SimpleAudioEngine sharedEngine] playEffect:@"rock.caf"]; before but changed it after looking at fade to grey to see if that would help at all).
My log:
2010-08-04 12:16:52.500 BeansnBits[2938:307] cocos2d: GL_VENDOR: Imagination Technologies 2010-08-04 12:16:52.513 BeansnBits[2938:307] cocos2d: GL_RENDERER: PowerVR SGX 535 2010-08-04 12:16:52.517 BeansnBits[2938:307] cocos2d: GL_VERSION: OpenGL ES-CM 1.1 IMGSGX535-48.11.3 2010-08-04 12:16:52.523 BeansnBits[2938:307] cocos2d: GL_MAX_TEXTURE_SIZE: 2048 2010-08-04 12:16:52.527 BeansnBits[2938:307] cocos2d: GL_MAX_MODELVIEW_STACK_DEPTH: 16 2010-08-04 12:16:52.530 BeansnBits[2938:307] cocos2d: GL supports PVRTC: YES 2010-08-04 12:16:52.534 BeansnBits[2938:307] cocos2d: GL supports BGRA8888 textures: NO 2010-08-04 12:16:52.537 BeansnBits[2938:307] cocos2d: GL supports NPOT textures: YES 2010-08-04 12:16:52.540 BeansnBits[2938:307] cocos2d: GL supports discard_framebuffer: YES 2010-08-04 12:16:52.544 BeansnBits[2938:307] cocos2d: compiled with NPOT support: YES 2010-08-04 12:16:52.547 BeansnBits[2938:307] cocos2d: compiled with VBO support in TextureAtlas : YES 2010-08-04 12:16:52.550 BeansnBits[2938:307] cocos2d: compiled with Affine Matrix transformation in CCNode : YES 2010-08-04 12:16:52.554 BeansnBits[2938:307] cocos2d: compiled with Profiling Support: NO 2010-08-04 12:16:52.562 BeansnBits[2938:307] cocos2d: cocos2d v0.99.4 2010-08-04 12:16:52.569 BeansnBits[2938:307] cocos2d: Using Director Type:CCTimerDirector 2010-08-04 12:16:52.629 BeansnBits[2938:307] cocos2d: cocos2d v0.99.4 2010-08-04 12:16:52.634 BeansnBits[2938:307] cocos2d: Using Director Type:CCDisplayLinkDirector 2010-08-04 12:16:52.787 BeansnBits[2938:307] Current scale is 2.000000 2010-08-04 12:16:52.797 BeansnBits[2938:307] winsize w 640.000000 winsize h 960.000000 2010-08-04 12:16:53.175 BeansnBits[2938:307] cocos2d: Frame interval: 1 2010-08-04 12:16:54.433 BeansnBits[2938:307] Using OpenFeint version 7022010 (2.5). https://api.openfeint.com/ 2010-08-04 12:16:54.453 BeansnBits[2938:307] Denshion::CDAudioManager - Other audio is not playing audio will be exclusive 2010-08-04 12:16:54.748 BeansnBits[2938:307] Denshion::CDSoundEngine - mixer output rate set to 44100.00 AudioStreamBasicDescription: 2 ch, 44100 Hz, 'lpcm' (0x00000C2C) 8.24-bit little-endian signed integer, deinterleaved 2010-08-04 12:16:55.121 BeansnBits[2938:307] Denshion::CDSoundEngine - generate buffers 0 to 63 2010-08-04 12:16:55.126 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2400 2010-08-04 12:16:55.130 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2401 2010-08-04 12:16:55.132 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2402 2010-08-04 12:16:55.135 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2403 2010-08-04 12:16:55.137 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2404 2010-08-04 12:16:55.140 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2405 2010-08-04 12:16:55.142 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2406 2010-08-04 12:16:55.145 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2407 2010-08-04 12:16:55.148 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2408 2010-08-04 12:16:55.151 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2409 2010-08-04 12:16:55.153 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2410 2010-08-04 12:16:55.155 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2411 2010-08-04 12:16:55.158 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2412 2010-08-04 12:16:55.160 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2413 2010-08-04 12:16:55.163 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2414 2010-08-04 12:16:55.165 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2415 2010-08-04 12:16:55.168 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2416 2010-08-04 12:16:55.171 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2417 2010-08-04 12:16:55.173 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2418 2010-08-04 12:16:55.176 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2419 2010-08-04 12:16:55.178 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2420 2010-08-04 12:16:55.181 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2421 2010-08-04 12:16:55.183 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2422 2010-08-04 12:16:55.185 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2423 2010-08-04 12:16:55.188 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2424 2010-08-04 12:16:55.191 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2425 2010-08-04 12:16:55.194 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2426 2010-08-04 12:16:55.196 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2427 2010-08-04 12:16:55.198 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2428 2010-08-04 12:16:55.201 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2429 2010-08-04 12:16:55.203 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2430 2010-08-04 12:16:55.206 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2431 2010-08-04 12:16:55.208 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2432 2010-08-04 12:16:55.211 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2433 2010-08-04 12:16:55.214 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2434 2010-08-04 12:16:55.216 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2435 2010-08-04 12:16:55.219 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2436 2010-08-04 12:16:55.221 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2437 2010-08-04 12:16:55.223 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2438 2010-08-04 12:16:55.226 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2439 2010-08-04 12:16:55.228 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2440 2010-08-04 12:16:55.231 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2441 2010-08-04 12:16:55.233 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2442 2010-08-04 12:16:55.236 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2443 2010-08-04 12:16:55.239 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2444 2010-08-04 12:16:55.241 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2445 2010-08-04 12:16:55.244 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2446 2010-08-04 12:16:55.246 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2447 2010-08-04 12:16:55.248 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2448 2010-08-04 12:16:55.251 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2449 2010-08-04 12:16:55.253 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2450 2010-08-04 12:16:55.255 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2451 2010-08-04 12:16:55.258 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2452 2010-08-04 12:16:55.262 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2453 2010-08-04 12:16:55.264 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2454 2010-08-04 12:16:55.266 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2455 2010-08-04 12:16:55.269 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2456 2010-08-04 12:16:55.271 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2457 2010-08-04 12:16:55.273 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2458 2010-08-04 12:16:55.276 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2459 2010-08-04 12:16:55.278 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2460 2010-08-04 12:16:55.281 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2461 2010-08-04 12:16:55.284 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2462 2010-08-04 12:16:55.286 BeansnBits[2938:307] Denshion::CDSoundEngine - buffer created 2463 2010-08-04 12:16:55.289 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 0 2010-08-04 12:16:55.291 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 1 2010-08-04 12:16:55.294 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 2 2010-08-04 12:16:55.296 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 3 2010-08-04 12:16:55.299 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 4 2010-08-04 12:16:55.301 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 5 2010-08-04 12:16:55.303 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 6 2010-08-04 12:16:55.307 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 7 2010-08-04 12:16:55.310 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 8 2010-08-04 12:16:55.312 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 9 2010-08-04 12:16:55.314 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 10 2010-08-04 12:16:55.317 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 11 2010-08-04 12:16:55.319 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 12 2010-08-04 12:16:55.322 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 13 2010-08-04 12:16:55.324 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 14 2010-08-04 12:16:55.326 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 15 2010-08-04 12:16:55.330 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 16 2010-08-04 12:16:55.332 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 17 2010-08-04 12:16:55.335 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 18 2010-08-04 12:16:55.337 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 19 2010-08-04 12:16:55.340 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 20 2010-08-04 12:16:55.342 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 21 2010-08-04 12:16:55.345 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 22 2010-08-04 12:16:55.347 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 23 2010-08-04 12:16:55.349 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 24 2010-08-04 12:16:55.353 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 25 2010-08-04 12:16:55.355 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 26 2010-08-04 12:16:55.358 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 27 2010-08-04 12:16:55.361 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 28 2010-08-04 12:16:55.363 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 29 2010-08-04 12:16:55.365 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 30 2010-08-04 12:16:55.367 BeansnBits[2938:307] Denshion::CDSoundEngine - try to generate source 31 2010-08-04 12:16:55.370 BeansnBits[2938:307] Denshion::CDSoundEngine - total sources 32 2010-08-04 12:16:55.373 BeansnBits[2938:307] Denshion::CDSoundEngine - source def 0 0 0 2010-08-04 12:16:55.379 BeansnBits[2938:307] -------------- source Group Info -------------- 2010-08-04 12:16:55.383 BeansnBits[2938:307] Group: 0 start:0 total:32 2010-08-04 12:16:55.386 BeansnBits[2938:307] ----- mute:0 nonInterruptible:0 2010-08-04 12:16:55.388 BeansnBits[2938:307] ----- Source statuses ---- 2010-08-04 12:16:55.390 BeansnBits[2938:307] Source status:0 index=0 locked=0 2010-08-04 12:16:55.393 BeansnBits[2938:307] Source status:1 index=1 locked=0 2010-08-04 12:16:55.395 BeansnBits[2938:307] Source status:2 index=2 locked=0 2010-08-04 12:16:55.397 BeansnBits[2938:307] Source status:3 index=3 locked=0 2010-08-04 12:16:55.401 BeansnBits[2938:307] Source status:4 index=4 locked=0 2010-08-04 12:16:55.403 BeansnBits[2938:307] Source status:5 index=5 locked=0 2010-08-04 12:16:55.405 BeansnBits[2938:307] Source status:6 index=6 locked=0 2010-08-04 12:16:55.408 BeansnBits[2938:307] Source status:7 index=7 locked=0 2010-08-04 12:16:55.410 BeansnBits[2938:307] Source status:8 index=8 locked=0 2010-08-04 12:16:55.413 BeansnBits[2938:307] Source status:9 index=9 locked=0 2010-08-04 12:16:55.415 BeansnBits[2938:307] Source status:10 index=10 locked=0 2010-08-04 12:16:55.417 BeansnBits[2938:307] Source status:11 index=11 locked=0 2010-08-04 12:16:55.419 BeansnBits[2938:307] Source status:12 index=12 locked=0 2010-08-04 12:16:55.423 BeansnBits[2938:307] Source status:13 index=13 locked=0 2010-08-04 12:16:55.425 BeansnBits[2938:307] Source status:14 index=14 locked=0 2010-08-04 12:16:55.428 BeansnBits[2938:307] Source status:15 index=15 locked=0 2010-08-04 12:16:55.430 BeansnBits[2938:307] Source status:16 index=16 locked=0 2010-08-04 12:16:55.433 BeansnBits[2938:307] Source status:17 index=17 locked=0 2010-08-04 12:16:55.435 BeansnBits[2938:307] Source status:18 index=18 locked=0 2010-08-04 12:16:55.437 BeansnBits[2938:307] Source status:19 index=19 locked=0 2010-08-04 12:16:55.440 BeansnBits[2938:307] Source status:20 index=20 locked=0 2010-08-04 12:16:55.442 BeansnBits[2938:307] Source status:21 index=21 locked=0 2010-08-04 12:16:55.445 BeansnBits[2938:307] Source status:22 index=22 locked=0 2010-08-04 12:16:55.448 BeansnBits[2938:307] Source status:23 index=23 locked=0 2010-08-04 12:16:55.450 BeansnBits[2938:307] Source status:24 index=24 locked=0 2010-08-04 12:16:55.453 BeansnBits[2938:307] Source status:25 index=25 locked=0 2010-08-04 12:16:55.455 BeansnBits[2938:307] Source status:26 index=26 locked=0 2010-08-04 12:16:55.457 BeansnBits[2938:307] Source status:27 index=27 locked=0 2010-08-04 12:16:55.459 BeansnBits[2938:307] Source status:28 index=28 locked=0 2010-08-04 12:16:55.462 BeansnBits[2938:307] Source status:29 index=29 locked=0 2010-08-04 12:16:55.464 BeansnBits[2938:307] Source status:30 index=30 locked=0 2010-08-04 12:16:55.466 BeansnBits[2938:307] Source status:31 index=31 locked=0 2010-08-04 12:16:55.471 BeansnBits[2938:307] Denshion::CDSoundEngine - testing get gain for source 1 2010-08-04 12:16:55.478 BeansnBits[2938:307] Denshion::CDLongAudioSource - Loading new audio source jazzbg.mp3 2010-08-04 12:16:55.817 BeansnBits[2938:307] Denshion::CDBufferManager generating new buffer id 0 2010-08-04 12:16:55.825 BeansnBits[2938:307] Denshion::CDSoundEngine - Loading openAL buffer 0 rock.caf 2010-08-04 12:16:55.835 BeansnBits[2938:307] Denshion::CDSoundEngine - Loading buffer 0 2010-08-04 12:16:55.838 BeansnBits[2938:307] Denshion::CDSoundEngine - =============== Buffer Loaded =============== 2010-08-04 12:16:55.844 BeansnBits[2938:307] Denshion::CDBufferManager buffer loaded 0 rock.caf 2010-08-04 12:16:55.846 BeansnBits[2938:307] Denshion::SimpleAudioEngine preloaded rock.caf 2010-08-04 12:16:55.849 BeansnBits[2938:307] Denshion::CDBufferManager generating new buffer id 1 2010-08-04 12:16:55.852 BeansnBits[2938:307] Denshion::CDSoundEngine - Loading openAL buffer 1 bug.caf 2010-08-04 12:16:55.862 BeansnBits[2938:307] Denshion::CDSoundEngine - Loading buffer 1 2010-08-04 12:16:55.867 BeansnBits[2938:307] Denshion::CDSoundEngine - =============== Buffer Loaded =============== 2010-08-04 12:16:55.870 BeansnBits[2938:307] Denshion::CDBufferManager buffer loaded 1 bug.caf 2010-08-04 12:16:55.873 BeansnBits[2938:307] Denshion::SimpleAudioEngine preloaded bug.caf 2010-08-04 12:16:55.876 BeansnBits[2938:307] Denshion::CDBufferManager generating new buffer id 2 2010-08-04 12:16:55.878 BeansnBits[2938:307] Denshion::CDSoundEngine - Loading openAL buffer 2 alarm.caf 2010-08-04 12:16:55.892 BeansnBits[2938:307] Denshion::CDSoundEngine - Loading buffer 2 2010-08-04 12:16:55.896 BeansnBits[2938:307] Denshion::CDSoundEngine - =============== Buffer Loaded =============== 2010-08-04 12:16:55.899 BeansnBits[2938:307] Denshion::CDBufferManager buffer loaded 2 alarm.caf 2010-08-04 12:16:55.902 BeansnBits[2938:307] Denshion::SimpleAudioEngine preloaded alarm.caf 2010-08-04 12:16:55.965 BeansnBits[2938:307] applicationDidBecomeActive 2010-08-04 12:16:55.979 BeansnBits[2938:307] cocos2d: surface size: 640x960 2010-08-04 12:16:56.937 BeansnBits[2938:307] cocos2d: Frame interval: 15 2010-08-04 12:17:07.367 BeansnBits[2938:307] Denshion::SimpleAudioEngine sound source created for rock.caf 2010-08-04 12:17:07.370 BeansnBits[2938:307] Denshion::SimpleAudioEngine sound source created for bug.caf 2010-08-04 12:17:07.372 BeansnBits[2938:307] Denshion::SimpleAudioEngine sound source created for alarm.caf 2010-08-04 12:17:07.374 BeansnBits[2938:307] cocos2d: Frame interval: 1 2010-08-04 12:17:16.951 BeansnBits[2938:307] cocos2d: CCSpriteSheet: resizing TextureAtlas capacity from [4] to [6]. 2010-08-04 12:17:16.952 BeansnBits[2938:307] cocos2d: CCSpriteSheet: resizing TextureAtlas capacity from [1] to [2]. 2010-08-04 12:17:16.954 BeansnBits[2938:307] cocos2d: CCSpriteSheet: resizing TextureAtlas capacity from [2] to [4]. 2010-08-04 12:17:16.955 BeansnBits[2938:307] cocos2d: CCSpriteSheet: resizing TextureAtlas capacity from [1] to [2]. 2010-08-04 12:17:16.957 BeansnBits[2938:307] cocos2d: CCSpriteSheet: resizing TextureAtlas capacity from [2] to [4]. 2010-08-04 12:17:17.200 BeansnBits[2938:307] cocos2d: deallocing <CCTextureCache = 00635000 | num of textures = 5> 2010-08-04 12:17:37.962 BeansnBits[2938:307] Denshion::CDAudioManager - Audio session interrupted 2010-08-04 12:17:38.073 BeansnBits[2938:307] Denshion::CDLongAudioSource - audio player interrupted 2010-08-04 12:17:38.890 BeansnBits[2938:307] cocos2d: Frame interval: 15 2010-08-04 12:17:38.909 BeansnBits[2938:307] applicationWillResignActive 2010-08-04 12:17:38.919 BeansnBits[2938:307] Denshion::CDAudioManager - handling resign active 2010-08-04 12:17:42.069 BeansnBits[2938:307] cocos2d: Frame interval: 1 2010-08-04 12:17:42.783 BeansnBits[2938:307] applicationDidBecomeActive 2010-08-04 12:17:42.789 BeansnBits[2938:307] Denshion::CDAudioManager - Other audio is not playing audio will be exclusive 2010-08-04 12:17:43.352 BeansnBits[2938:307] Denshion::CDAudioManager - audio manager handling become activeAny ideas?
Sorry for the long post :)Posted 1 year ago # -
@Novaoblivion - you aren't using the correct version of the code.
The correct version logs this message after it has handled the resign active, you're using the old "handling" code.
"Denshion::CDAudioManager - handled resign active"Maybe you screwed something up with git.
Posted 1 year ago # -
Strange I did git pull again and it said already up-to-date but now I have the correct version haha. Sorry for the stupid question and thanks for the fix! :)
Posted 1 year ago # -
Steve, I was also having this problem and the code in the develop branch fixed my problem. Thanks again for your hard work.
Posted 1 year ago # -
The bug seems to be back with iOS 4.2 beta 3 (on iPad at least), does someone notice it too ?
A simple lock/unlock and no more sounds, although there is no problem with multitasking.
Hopefully the 4.2 final will fix it...Posted 1 year ago # -
@Niark - the problem also occurs with a 2nd gen iPod Touch running 4.2 beta 3. It is a bug in the OS. The audio session is interrupted when the device is locked but not resumed when the device is unlocked.
I've posted on the official forums and filed a bug report. The issue is easily reproduced using Apple's own oalTouch example code so hopefully it will be fixed before final release.
Thanks for reporting it.
Posted 1 year ago # -
is this in the newest version, of still in the dev branch?
Posted 1 year ago # -
@arcticfire - the latest code is in the 99.5 rc0 release.
Posted 1 year ago # -
I just installed 4.2GM on my iPad and checked couple of my games - in some cases there was normal audio after resume , in some other games (including Cocos2D games) there was no audio after resume, only music.
I think it could be somehow connected with 'unlock' click sound that is playing after application is resumed. Maybe this system sound is disabling our sound engine for a while, and our sound engine should try to restore couple times?
Posted 1 year ago # -
After checking CocosDension code (99.4) i found in CocosDension.h callback with two methods "audioSessionInterrupted" and "audioSessionResumed" for stopping and resuming sound effects. But this callback is not registered with my standard initialization
([CDAudioManager initAsynchronously:kAMM_FxPlusMusicIfNoOtherAudio];)When I add button to manually call "audioSessionResumed" after resuming (call, or turning off screen) my sound is resumed
Any idea how to setup this callback? Its located in "- (id)init:(UInt32) audioSessionCategory " but i dont know how to use it
Posted 1 year ago # -
@KosmoMike - all the answers you need are in this thread. I already said the 4.2GM lock/unlock issue is a bug in the OS that I have reported to Apple. However, I'm not optimistic that it will be fixed in the final 4.2 release so the latest version of CocosDenshion in the development branch of cocos2d has a workaround.
Secondly, if you want CocosDenshion to automatically handle audio session interruption then you need this line of code:
[[CDAudioManager sharedManager] setResignBehavior:kAMRBStopPlay autoHandle:YES];Posted 1 year ago #
Reply »
You must log in to post.