Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 03-18-2009, 12:10 AM   #1 (permalink)
Registered Member
 
Join Date: Dec 2008
Posts: 421
Default 3.0 breaks SoundEngine.cpp

/Users/rbertrand/Desktop/Iphone Projects/fakesms/Classes/SoundEngine.cpp:706: error: jump to label 'end'
/Users/rbertrand/Desktop/Iphone Projects/fakesms/Classes/SoundEngine.cpp:682: error: from here
/Users/rbertrand/Desktop/Iphone Projects/fakesms/Classes/SoundEngine.cpp:686: error: crosses initialization of 'OSStatus err'
/Users/rbertrand/Desktop/Iphone Projects/fakesms/Classes/SoundEngine.cpp:706: error: jump to label 'end'
/Users/rbertrand/Desktop/Iphone Projects/fakesms/Classes/SoundEngine.cpp:679: error: from here
/Users/rbertrand/Desktop/Iphone Projects/fakesms/Classes/SoundEngine.cpp:686: error: crosses initialization of 'OSStatus err'
/Users/rbertrand/Desktop/Iphone Projects/fakesms/Classes/SoundEngine.cpp:706: error: jump to label 'end'
/Users/rbertrand/Desktop/Iphone Projects/fakesms/Classes/SoundEngine.cpp:670: error: from here
/Users/rbertrand/Desktop/Iphone Projects/fakesms/Classes/SoundEngine.cpp:686: error: crosses initialization of 'OSStatus err'
/Users/rbertrand/Desktop/Iphone Projects/fakesms/Classes/SoundEngine.cpp:761: error: jump to label 'end'
/Users/rbertrand/Desktop/Iphone Projects/fakesms/Classes/SoundEngine.cpp:721: error: from here
/Users/rbertrand/Desktop/Iphone Projects/fakesms/Classes/SoundEngine.cpp:722: error: crosses initialization of 'bool isFormatVBR'
__________________
Finally My Iphone Apps: Max Rep Pro, My Referee!, Collaged, Operation, Whack-A-Mole, Fake Em' Out
Bertrand21 is offline   Reply With Quote
Old 03-20-2009, 02:23 PM   #2 (permalink)
Registered Member
 
scotopia's Avatar
 
Join Date: Oct 2008
Posts: 1,661
Default

Dang; my apps use this engine... If they are still built for 2.0 or whatnot, will they crash on an iPhone running 3.0; or is it only that you cannot build it for 3.0?
scotopia is offline   Reply With Quote
Old 03-20-2009, 08:46 PM   #3 (permalink)
Registered Member
 
Join Date: Dec 2008
Posts: 421
Default

No it works if you build with 2.x.x but building with 3.0 kills it
__________________
Finally My Iphone Apps: Max Rep Pro, My Referee!, Collaged, Operation, Whack-A-Mole, Fake Em' Out
Bertrand21 is offline   Reply With Quote
Old 03-22-2009, 07:01 PM   #4 (permalink)
Registered Member
 
tawpie's Avatar
 
Join Date: Jul 2008
Posts: 328
Default

Quote:
Originally Posted by Bertrand21 View Post
No it works if you build with 2.x.x but building with 3.0 kills it
get we had better get to the redesign... splains why crash landing was pulled.
__________________
"Hardware will break. Software comes broken" Unknown
Calc-12E <-- ditch your old calculator.
CPR•Choking <-- Review your training, just in case. (Free)
All of Nature NW <-- scrolls in x and y, with pinch zoom AND scrollable text to boot. It can be done ('taint easy tho)
tawpie is offline   Reply With Quote
Old 03-22-2009, 07:23 PM   #5 (permalink)
Registered Member
 
Join Date: Sep 2008
Location: London, UK
Posts: 793
Default

Quote:
Originally Posted by tawpie View Post
get we had better get to the redesign... splains why crash landing was pulled.
and why they implemented AVAudioplayer etc. and also why I never used SoundEngine...been bitten too many times by code that suddenly is nolonger supported.
wuf810 is offline   Reply With Quote
Old 03-24-2009, 11:08 AM   #6 (permalink)
Registered Member
 
scotopia's Avatar
 
Join Date: Oct 2008
Posts: 1,661
Default

Quote:
Originally Posted by wuf810 View Post
and why they implemented AVAudioplayer etc. and also why I never used SoundEngine...been bitten too many times by code that suddenly is nolonger supported.
Yeah I had a sneaking suspicion this was why the soundEngine.cpp was yanked... oh well. But if it still works on 3.0 iphones when the app is built for 2.0 (or whatever) it's not terrible, as it won't "break" anything already made correct? We'd just have to change it if we want to build for 3.0; is my thinking on target?
scotopia is offline   Reply With Quote
Old 04-08-2009, 01:36 AM   #7 (permalink)
Registered Member
 
Join Date: Apr 2008
Posts: 329
Default

Guys, I have SoundEngine working in the 3.0 simulator. I do not have the OS on a phone, so I can't verify that. Both of my games use SoundEngine, and like others in this thread, I got the same errors when compiling for 3.0. However, all you need to do is replace all the AssertNoError calls with:

if ( result != noErr )
return result;


and then remove the end: line.

Once you do this, it will compile, and run just fine in the simulator. I'm getting full audio, with no problems. Would anyone who is running 3.0 on a device be willing to replace these lines and try it out for themselves?
Delirium is offline   Reply With Quote
Old 04-17-2009, 05:44 PM   #8 (permalink)
Registered Member
 
tawpie's Avatar
 
Join Date: Jul 2008
Posts: 328
Default

Quote:
Originally Posted by Delirium View Post
Once you do this, it will compile, and run just fine in the simulator. I'm getting full audio, with no problems. Would anyone who is running 3.0 on a device be willing to replace these lines and try it out for themselves?
Delirium...

I finally got around to incorporating your fix and for a device build, the compiler complains about returning a value (result) in a void function which is easy enough to handle.

Before I spend too much time experimenting, it would appear that the AssertNoError function is there to print an error message, and then skip merrily along to the "end:" label/line so that all of the stuff in between isn't executed. And it seems the goto is what is causing the problem. Of course there are a number of ways to handle this, is my read of the situation correct?

I wonder partly because the AssertNoOALError function isn't mentioned as being problematic and it does the same thing.

I only have one device and really can't take it "out of service" to test 3.0, so I'm a bit stuck helping confirm this on device. Sorry.
__________________
"Hardware will break. Software comes broken" Unknown
Calc-12E <-- ditch your old calculator.
CPR•Choking <-- Review your training, just in case. (Free)
All of Nature NW <-- scrolls in x and y, with pinch zoom AND scrollable text to boot. It can be done ('taint easy tho)

Last edited by tawpie; 04-17-2009 at 05:51 PM.
tawpie is offline   Reply With Quote
Old 04-17-2009, 11:44 PM   #9 (permalink)
Registered Member
 
Join Date: Apr 2008
Posts: 329
Default

Quote:
Originally Posted by tawpie View Post
And it seems the goto is what is causing the problem. Of course there are a number of ways to handle this, is my read of the situation correct?
Yes, you are correct. The good news is SoundEngine will work, at least in the Simulator, with a few minor modifications, which should allow many legacy 2.0 apps to run under 3.0 if one chooses to compile for it. I'm betting it works on the device as well. Like you, I have no way to test it yet though.
Delirium is offline   Reply With Quote
Old 04-25-2009, 05:19 PM   #10 (permalink)
New Member
 
Join Date: Nov 2008
Posts: 39
Default

I can now confirm that this fix lets it work on 3.0 devices as well
__________________
New App, Touch Ski 3D!

TouchArcade Review:
"I actually found it hard to put the game down in order to write this post (just one more run down the slopes...)" - TouchArcade.com
http://toucharcade.com/2009/04/10/to...on-the-slopes/

Video Preview: http://www.naquatic.com/video/

=====

Naquatic Software

Touch Ski 3D Lite, Free!

Turtle Bounce, Free!

Corners, Free!
Smittens is offline   Reply With Quote
Old 04-29-2009, 06:52 PM   #11 (permalink)
Registered Member
 
Join Date: Apr 2008
Posts: 329
Default

Quote:
Originally Posted by Smittens View Post
I can now confirm that this fix lets it work on 3.0 devices as well
Excellent! Thanks for trying it out!
Delirium is offline   Reply With Quote
Old 05-08-2009, 12:05 PM   #12 (permalink)
Registered Member
 
Join Date: Oct 2008
Posts: 164
Default

I see the SoundEngine stuff has been taken care of, but has anyone tried the OpenGL portion of Crash Landing on 3.0, such as the initialization stuff and Texture2D? I'm still timid about updating my personal phone (and development device) to a beta OS. With Apple's recent announcement, though, I may have to.

As an aside, if someone with 3.0 is willing to try out my game to see if it works, I'll provide a promo code. If it's broken, then I'll have to update to the Beta ASAP.
__________________
Sproing - Updated September 17th, now with online high scores and challenges using Scoreloop!
gizmotoy is offline   Reply With Quote
Old 05-09-2009, 02:37 PM   #13 (permalink)
Developer
 
Join Date: Mar 2009
Location: Oregon
Posts: 30
Default

Thank god this thread exists =)

Thank you very much for posting a fix.

I took the changes posted here and made a small tweak. Instead of replacing all the AssertNoErrors in the code, I changed the macro:

#define AssertNoError(inMessage, inHandler) \
if(result != noErr) \
{ \
printf("%s: %d\n", inMessage, (int)result); \
}

Compiling fine and dandy now!
Mich is offline   Reply With Quote
Old 05-11-2009, 08:13 AM   #14 (permalink)
New Member
 
Join Date: Oct 2008
Posts: 2
Default

Hello.

I think the right way to correct the code is to move some declarations.

line 687 : OSStatus err = AudioFil....

becomes

line 687 : err = AudioFil....

Move the declaration "OSStatus err" after line 669.

Do the same with line 723.
clarexine is offline   Reply With Quote
Old 05-11-2009, 11:21 AM   #15 (permalink)
Registered Member
 
Join Date: Apr 2008
Posts: 115
Default

Ok, I'm slightly confused

So, Apple says that you must test your app on 3.0 to ensure no compatibility issues are present before submitting now. Well, if we have to change code in order to fix problems for 3.0, how does one go about testing and submitting a 2.2.1 app?

Here's what I'm thinking: So, I've got a 2.2.1 app using OpenGL and SoundEngine ready to submit, but now I've got to download and test on 3.0. Obviously compiling and running the app works fine XCode 2.2.1. But now code needs to change when testing in XCode 3.0? Since it looks like you can't submit an app built with XCode 3.0, what's the point of testing it on there? Wouldn't changing the code break being able to build in XCode 2.2.1?

I've submitted apps before using 2.2.1 and the current app uses the same base code as those ( OpenGL and SoundEngine....no Interface Builder stuff ). Can I not assume that my new app will work fine on 3.0 and just skip the test and submit as is? What's the chance that it won't work on 3.0? It should be fine given the other apps using the same code base already work, right?

Anyone have any thoughts on this?

Thanks!

Last edited by RegularKid; 05-11-2009 at 01:18 PM.
RegularKid is offline   Reply With Quote
Old 05-11-2009, 06:48 PM   #16 (permalink)
Registered Member
 
Join Date: Sep 2008
Location: London, UK
Posts: 793
Default

Quote:
Originally Posted by RegularKid View Post
Ok, I'm slightly confused

So, Apple says that you must test your app on 3.0 to ensure no compatibility issues are present before submitting now. Well, if we have to change code in order to fix problems for 3.0, how does one go about testing and submitting a 2.2.1 app?

Here's what I'm thinking: So, I've got a 2.2.1 app using OpenGL and SoundEngine ready to submit, but now I've got to download and test on 3.0. Obviously compiling and running the app works fine XCode 2.2.1. But now code needs to change when testing in XCode 3.0? Since it looks like you can't submit an app built with XCode 3.0, what's the point of testing it on there? Wouldn't changing the code break being able to build in XCode 2.2.1?

I've submitted apps before using 2.2.1 and the current app uses the same base code as those ( OpenGL and SoundEngine....no Interface Builder stuff ). Can I not assume that my new app will work fine on 3.0 and just skip the test and submit as is? What's the chance that it won't work on 3.0? It should be fine given the other apps using the same code base already work, right?

Anyone have any thoughts on this?

Thanks!
running on 3.0 is not the same as compiled for 3.0. Therefore you compile your app using SDK 3.0 but build for 2.2. If it works then its fine to "run" on a beta 3 device and anything below 3.0...

M.
wuf810 is offline   Reply With Quote
Old 05-11-2009, 09:08 PM   #17 (permalink)
Registered Member
 
tawpie's Avatar
 
Join Date: Jul 2008
Posts: 328
Default

I think the whole point of early testing with 3.0 on a device is so that there isn't as large a pool of broken apps when 3.0 releases to the general public and so that we devs don't go as ballistic when it takes forever to get an update through after the firmware does go live. I would plan on the queue being massive and the wait times long.

FWIW, I finally took a bunch of deep breaths and upgraded my only device to 3.0b5 after I discovered that my app was broken on the simulator. Phew, it's fine on the device. But I had to test because I send touches through to a scrollView, something that is explicitly mentioned in the release notes. Along the way I discovered two methods that are depreciated so I'll take care of them now. SoundEngine with fixes, BTW, works fine on my 2G iPhone. THANKS and props to Delirium.

Does anyone know if there is a thread started anywhere that lists whether or not a particular app actually breaks with 3.0b5 on device? I checked out the apps I own, and several (Ocharina being the most notable) are broken. Smule knows about it already. Anyway, it might be nice if those of us that have upgraded our devices and own apps were to give a warning to those devs that have broken apps but maybe like me are afraid of bricking their only test platform.
__________________
"Hardware will break. Software comes broken" Unknown
Calc-12E <-- ditch your old calculator.
CPR•Choking <-- Review your training, just in case. (Free)
All of Nature NW <-- scrolls in x and y, with pinch zoom AND scrollable text to boot. It can be done ('taint easy tho)
tawpie is offline   Reply With Quote
Old 05-31-2009, 10:52 PM   #18 (permalink)
Registered Member
 
tawpie's Avatar
 
Join Date: Jul 2008
Posts: 328
Default

@Smittens: I just happened to stumble across this on my gen1 iPhone. Let it go to sleep, or force it to sleep with the top button. Can you check if sounds still work after wake-from-sleep? Grazie

In my app the sound no longer sounds at all after wake-from-sleep.

Anybody else observe this with soundengine?
__________________
"Hardware will break. Software comes broken" Unknown
Calc-12E <-- ditch your old calculator.
CPR•Choking <-- Review your training, just in case. (Free)
All of Nature NW <-- scrolls in x and y, with pinch zoom AND scrollable text to boot. It can be done ('taint easy tho)
tawpie is offline   Reply With Quote
Old 05-31-2009, 11:47 PM   #19 (permalink)
Registered Member
 
tawpie's Avatar
 
Join Date: Jul 2008
Posts: 328
Default

UNCLE!

I had originally used soundengine because it provided "low latency" sound which allowed me to sync it well with my user interface elements.

But the sysSounds example works well enough for my rather elementary needs so I gave up and switched to system sounds for OS 3.0.
__________________
"Hardware will break. Software comes broken" Unknown
Calc-12E <-- ditch your old calculator.
CPR•Choking <-- Review your training, just in case. (Free)
All of Nature NW <-- scrolls in x and y, with pinch zoom AND scrollable text to boot. It can be done ('taint easy tho)
tawpie is offline   Reply With Quote
Old 06-02-2009, 09:43 PM   #20 (permalink)
New Member
 
Join Date: Jun 2009
Posts: 2
Default

Quote:
Originally Posted by tawpie View Post
@Smittens: I just happened to stumble across this on my gen1 iPhone. Let it go to sleep, or force it to sleep with the top button. Can you check if sounds still work after wake-from-sleep? Grazie

In my app the sound no longer sounds at all after wake-from-sleep.

Anybody else observe this with soundengine?
I can confirm I am seeing this with 3b5, I don't remember seeing it on 2.2.
minisamus is offline   Reply With Quote
Old 06-09-2009, 12:12 AM   #21 (permalink)
Registered Member
 
tawpie's Avatar
 
Join Date: Jul 2008
Posts: 328
Default

Quote:
Originally Posted by minisamus View Post
I can confirm I am seeing this with 3b5, I don't remember seeing it on 2.2.
Just an update... I installed 3.0 GM and behold, sound works after wake from sleep. SoundEngine sound that is, I'm testing with my "old" binary. This is a launch day iPhone.

Sway Lite's selection screen still has the hickup in scrolling the selection islands while the background music is playing. But magically at least it'll let the game play.

Might suggest retesting with 3.0 GM before you tear too much hair out.
__________________
"Hardware will break. Software comes broken" Unknown
Calc-12E <-- ditch your old calculator.
CPR•Choking <-- Review your training, just in case. (Free)
All of Nature NW <-- scrolls in x and y, with pinch zoom AND scrollable text to boot. It can be done ('taint easy tho)
tawpie is offline   Reply With Quote
Old 06-10-2009, 11:38 AM   #22 (permalink)
Registered Member
 
DenVog's Avatar
 
Join Date: Jan 2009
Location: Silicon Valley, USA
Posts: 500
Smile

Quote:
Originally Posted by Mich View Post

I took the changes posted here and made a small tweak. Instead of replacing all the AssertNoErrors in the code, I changed the macro:

#define AssertNoError(inMessage, inHandler) \
if(result != noErr) \
{ \
printf("%s: %d\n", inMessage, (int)result); \
}

Compiling fine and dandy now!
Thanks for sharing this. HUGE help.
DenVog is offline   Reply With Quote
Old 06-13-2009, 05:39 PM   #23 (permalink)
Registered Member
 
Join Date: Aug 2008
Posts: 36
Default

Quote:
Originally Posted by DenVog View Post
Thanks for sharing this. HUGE help.
genius
GabeJacobs is offline   Reply With Quote
Old 06-25-2009, 02:05 AM   #24 (permalink)
New Member
 
Join Date: Oct 2008
Posts: 28
Smile Thanks for ur help..............

It Works For me on device also...
jayaprada is offline   Reply With Quote
Old 07-04-2009, 04:12 AM   #25 (permalink)
Registered Member
 
Join Date: Dec 2008
Posts: 14
Default

strange i have cpu_capabilities.h error

have tried all fixes
Alexman is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Online Users: 283
16 members and 267 guests
alexy, carendt242, entity2light, Guilerriree, hds, jyu, kalygraphix, kristapsz, LunarMoon, Mac393, m_kaminsky@yahoo.com, phuongth, Pilly170, Rossco, tralhavet, XXX
Most users ever online was 779, 05-11-2009 at 09:55 AM.
» Stats
Members: 24,234
Threads: 39,013
Posts: 171,110
Top Poster: smasher (2,570)
Welcome to our newest member, Hunkawebsolution
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:39 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0