Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running SFBAudioEngine on iPhone #12

Closed
Monika-Tapadiya opened this issue Feb 6, 2012 · 3 comments
Closed

Error running SFBAudioEngine on iPhone #12

Monika-Tapadiya opened this issue Feb 6, 2012 · 3 comments
Assignees

Comments

@Monika-Tapadiya
Copy link

Hello ,
I have issue in running this application on iphone device . It is working fine for iphone simulator but crashing on iphone 4.3 os .
I added flac file in application's resources and it is crashing at below code in AudioPlayer.cpp

/ Store the decoded audio
if(0 != framesDecoded) {

LOGGER_INFO("com.widevision.Test", "Frames->>>>" <<mFramesDecoded);
CARingBufferError result = mRingBuffer->Store(bufferList, framesDecoded, startingFrameNumber + startTime);
if(kCARingBufferError_OK != result)
LOGGER_ERR("com.wv.Test", "CARingBuffer::Store failed: " << result);

                        LOGGER_INFO("", "Frames--------" <<mFramesDecoded);
                        OSAtomicAdd64Barrier(framesDecoded, &mFramesDecoded);
                   }

And Here is the crash log

Feb 6 14:54:39 iPhone SimplePlayer-iOS[1852] : OpenOutput
Feb 6 14:54:40 iPhone SimplePlayer-iOS[1852] : Resetting output
Feb 6 14:54:40 iPhone SimplePlayer-iOS[1852] : Enqueuing "file://localhost/var/mobile/Applications/DC638145-12AC-47CD-8727-BCDA8AA91086/SimplePlayer-iOS.app/Track.flac"
Feb 6 14:54:40 iPhone SimplePlayer-iOS[1852] : AudioUnitSetProperty (19, kAudioUnitScope_Input) failed: -10851
Feb 6 14:54:42 iPhone SimplePlayer-iOS[1852] : Decoding starting for "file://localhost/var/mobile/Applications/DC638145-12AC-47CD-8727-BCDA8AA91086/SimplePlayer-iOS.app/Track.flac"
Feb 6 14:54:42 iPhone SimplePlayer-iOS[1852] : Decoder format: 2 ch, 44100 Hz, 'lpcm' (0x0000002c) 16-bit little-endian signed integer, deinterleaved
Feb 6 14:54:42 iPhone SimplePlayer-iOS[1852] : Decoder channel layout: kAudioChannelLayoutTag_Stereo (0x00650002)
Feb 6 14:54:42 iPhone SimplePlayer-iOS[1852] : StartOutput
Feb 6 14:54:42 iPhone SimplePlayer-iOS[1852] : Frames->>>>0
Feb 6 14:54:42 iPhone SimplePlayer-iOS[1852] : Frames--------0

Printing Frames -- >> 0

Help Please !!!

@0x8badf00d
Copy link

When I ran the app on my device in debug mode it crashed with EXC_BAD_ACCESS. Looking at the crash log on my device: EXC_ARM_DA_ALIGN got me thinking its memory alignment issue and it was at this line -> OSAtomicAdd64Barrier(framesDecoded, &mFramesDecoded); // mFramesDecoded is misaligned.

I had declared the alignment explicitly. In AudioPlayer.h:

int64_t mFramesDecoded __attribute__ ((aligned (8)));; int64_t mFramesRendered __attribute__((aligned (8))); int64_t mFramesRenderedLastPass __attribute__((aligned (8)));

And in DecoderStateData.h:

SInt64 mTimeStamp __attribute__((aligned (8))); SInt64 mTotalFrames __attribute__((aligned (8))); volatile SInt64 mFramesRendered __attribute__((aligned (8))); SInt64 mFrameToSeek __attribute__((aligned (8)));

This only prevented app from crashing. Although audio wouldn't play. Need to further debug the problem.

@sbooth
Copy link
Owner

sbooth commented Feb 7, 2012

The last time I tried this on my iPhone was before iOS 5 came out, so I will investigate a bit when I have some free time.

@Monika-Tapadiya
Copy link
Author

Ok Fine !!

I will wait for your reply

@ghost ghost assigned sbooth Mar 11, 2012
@sbooth sbooth closed this as completed Aug 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants