Comments (10)
Hey Tonio,
Try making the suggested changes, and then removing the explicit setInputBlock: and setOutputBlock: methods (which perform an explicit Block_copy), and let me know what happens.
Best,
Alex
On Apr 3, 2012, at 1:06 PM, Tonio Loewald wrote:
When I tried to incorporate novocaine into my own project I get a lot of tricky warnings and link errors. It's kind of neat how you've integrated C++ and Obj-C++ into a minimal number of source files, but I wonder if you're confusing the compiler/linker
I get warnings which I frankly do not understand surrounding the blocks. ("Capturing 'self' ...")
Probably related: I get warnings about these declarations:
@property (nonatomic, retain) OutputBlock outputBlock; @property (nonatomic, retain) InputBlock inputBlock;
It wants me to use copy instead of retain.
I assume that my project settings are wrong in some subtle way (I've tried to match them to yours) — but I want to understand what's going on since I need to integrate this stuff into a much larger project.
Reply to this email directly or view it on GitHub:
#3
from novocaine.
Thank you for your reply!
I made the changes and now I only get one warning:
Capturing 'self' strongly in this block is likely to lead to a retain cycle
As far as I can tell this is OK -- we're handing the block over once and we want it to be retained for the lifetime of the containing object... I tried experimentally explicitly releasing the blocks on release but that did not make the compiler happy...
I'm also getting mysterious link errors (again I've spent quite a while trying to chase them down) -- maybe you'll be able to tell instantly:
Undefined symbols for architecture i386:
"RingBuffer::RingBuffer(long long, long long)", referenced from:
-[ACViewController viewWillAppear:] in ACViewController.o
"RingBuffer::AddNewInterleavedFloatData(float const*, long long, long long)", referenced from:
___35-[ACViewController viewWillAppear:]_block_invoke_0 in ACViewController.o
"OBJC_CLASS$_Novocaine", referenced from:
objc-class-ref in ACViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
from novocaine.
Is your ACViewController named ACViewController.mm?
It must be an Objective-C++ file to work.
On Apr 4, 2012, at 10:57 AM, Tonio Loewald wrote:
Thank you for your reply!
I made the changes and now I only get one warning:
Capturing 'self' strongly in this block is likely to lead to a retain cycle
As far as I can tell this is OK -- we're handing the block over once and we want it to be retained for the lifetime of the containing object... I tried experimentally explicitly releasing the blocks on release but that did not make the compiler happy...
I'm also getting mysterious link errors (again I've spent quite a while trying to chase them down) -- maybe you'll be able to tell instantly:
Undefined symbols for architecture i386:
"RingBuffer::RingBuffer(long long, long long)", referenced from:
-[ACViewController viewWillAppear:] in ACViewController.o
"RingBuffer::AddNewInterleavedFloatData(float const*, long long, long long)", referenced from:
___35-[ACViewController viewWillAppear:]_block_invoke_0 in ACViewController.o
"OBJC_CLASS$_Novocaine", referenced from:
objc-class-ref in ACViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Reply to this email directly or view it on GitHub:
#3 (comment)
from novocaine.
Yes I banged my head on that particular wall earlier :-)
I've got it compiling and running.
- For some reason I had to explicitly add it to the compile list (I figured out it wasn't compiling the Novocaine files at all...)
- I explicitly disabled ARC for the Novocaine files (otherwise hordes of errors)
- I'm still getting the "Capturing self strongly" bug...;
It all seems to be working (I'm chasing down some memory management stuff caused by mixing ARC and non-ARC code).
from novocaine.
Ohhhh, yeah Novocaine isn't built to work with ARC at all. If you do get it working, please make a branch of Novocaine, and point me to it. ARC is something I'd definitely like to support in the future.
Best,
Alex
On Apr 4, 2012, at 11:43 AM, Tonio Loewald wrote:
Yes I banged my head on that particular wall earlier :-)
I've got it compiling and running.
- For some reason I had to explicitly add it to the compile list (I figured out it wasn't compiling the Novocaine files at all...)
- I explicitly disabled ARC for the Novocaine files (otherwise hordes of errors)
- I'm still getting the "Capturing self strongly" bug...;
It all seems to be working (I'm chasing down some memory management stuff caused by mixing ARC and non-ARC code).
Reply to this email directly or view it on GitHub:
#3 (comment)
from novocaine.
Okay, I'm going to open a separate issue about ARC compatibility, and close this one, if that's alright with you.
from novocaine.
It's all good now. One thing I found a bit confusing is that the execution context for the input and output blocks doesn't allow you deal with memory allocation (the code I'm writing uses ARC, I've blocked ARC for the Novocaine files, and the blocks are this no-man's land where I can't seem to use manual OR automatic memory management.
My solution was to refactor anything requiring memory allocation out to methods executing in a normal context. No problems at all now except the "Capturing 'self'..." warning.
from novocaine.
Okay, so just to be clear — Novocaine will work without errors when using ARC, you just have to disable it explicitly in those files?
from novocaine.
p.s. for the record: I'm using Novocaine under ARC, with AudioFileReader.mm, AudioFileWriter.m, RingBuffer.mm and Novocaine.m all flagged -fno-objc-arc. No problems so far.
from novocaine.
I found that if I put self. in front of a member variable inside a block that had the arc-retain warning, that warning would go away.
from novocaine.
Related Issues (20)
- Audio distortion isuue while playing on iphone speaker HOT 1
- 1
- use of @autoreleasepool in renderCallback and inputCallback HOT 1
- inputblock + outputblock + forceOutputToSpeaker = Error: Couldn't render the output unit (-50) HOT 1
- Can't play an audio file that was downloaded from server but the data is the same HOT 1
- Music from the Internet HOT 1
- What exactly comes from the newAudio variable?
- Bluetooth Audio? HOT 3
- updateMeters and averagePowerForChannel equivalents for Novocaine? HOT 2
- Setting deployment target to 8.0 causes demo app to crash HOT 2
- Is there anyway to properly convert the audio array (float*) into UTF 8? HOT 7
- m4a files
- Gapless
- RingBuffer.h - class RingBuffer syntax error HOT 3
- Use of deprecated AudioSession APIs on Novocaine.m HOT 2
- How to 8000hz/16000hz get or put as short* array for audio ?
- Is this library suitable to make a lack-in amplifier from microphone input?
- Couldn't initialize the output unit ('!cat') on Device only HOT 1
- Mac Catalyst (UIKit for Mac) support
- Does default sample rate cause resampling and setting buffer size for minimum latency? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from novocaine.