Version 1.46 (finally!)

[quote=“jules”]
Builds ok here. Are you using an old SDK? XCode 3 and SDK 10.5 is probably the best to go for now.[/quote]

I’m using XCode 3, and have tried both the 10.4 and 10.5 SDKs. Both give the same error. I tried compiling the demo app to compare settings, but the demo won’t compile due to the z_Byte issue mentioned above.

Interestingly, the debug version of my project works, so next I’ll do a comparision of the debug and release settings and see if that sheds some light on the issue.

I found the error in my mac project: I had defined SDKROOT_ppc to be something other than the 10.5 SDK. Removing that build setting fixed my link issues.

I’ve updated the amalgamated file from the SVN and recompiled my application. The result has been the same as it had been before. GDB (MinGW version) showed me where the problem resides. The application throws ‘signal SIGSEGV, Segmentation fault.’ when starts playing.

Here is the detailed desription of the problem:
If I do not call the setAudioDevice member function in my application while initializing then there are no errors at all and everything is going smoothly.
But if I only call setAudioDevice to set device name and sample rate to play at other than the default one while initializing, then when I start playing a TransportSource a segmentation fault is thrown.

The debug showed me the following:

[code]void ResamplingAudioSource::getNextAudioBlock (const AudioSourceChannelInfo& info)
{


float* dl = info.buffer->getSampleData (0, info.startSample);
float* dr = (info.buffer->getNumChannels() > 1) ? info.buffer->getSampleData (1, info.startSample) : 0;

const float* const bl = buffer.getSampleData (0, 0);
const float* const br = buffer.getSampleData (1, 0);

int nextPos = (bufferPos + 1) % bufferSize;

for (int m = info.numSamples; --m >= 0;)
{
    const float alpha = (float) subSampleOffset;
    const float invAlpha = 1.0f - alpha;

    *dl++ = bl [bufferPos] * invAlpha + bl [nextPos] * alpha; // <<<==== here is the stub



}
[/code]

dl is null
dr is null
bl is not null
br is not null

Well, that’s the all info I wanted to say.
What do you think, Julian?

that seems a strange place to crash, because it’s obviously getting no input channels. But this morning I have fixed a couple of audio bugs, including one in DSound, so maybe grab the tip and see if it helps.

I’m getting this on VC8:

e:\opt\juce\extras\juce demo\src…/…/…/juce_amalgamated.cpp(18228) : fatal error C1083: Cannot open include file: ‘Movies.h’: No such file or directory

Quicktime is already commented out in juce_Config.h but I still get the compilation error.

//#define JUCE_QUICKTIME 1

Cheers

Julian, please, run your last JUCE Demo program under Windows, open a file to play, start playing and choose another audio device other than a default one (like “Realtek HD Audio output” name). Possiblly, you’ll see the problem I’m talking about, as I’ve been seeing it regularly.

I think that’s the thing I just fixed, actually…

…now, setAudioDevice does not select a new sound device and does not return any errors. No matter what sound device you select, it keeps playing to the same sound card - to the default one…

id like to confirm the z_Byte bug.
au plugin project would not compile

i get 8 errors the first one being:

/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:371: error: ‘z_Byte’ does not name a type

Hi red_muze
I solved the problem in this manner:

  1. I compiled Juce (Debug and Release) uncommenting the two
    following instructions in the file “juce_Config.h”:
    #define JUCE_PLUGINHOST_VST 1
    #define JUCE_PLUGINHOST_AU 1

  2. On examples “juce demo”, “the jucer” and "example projects"
    I uncommented the two following instruction from
    the respective files “juce_AppConfig.h”:
    #define JUCE_PLUGINHOST_VST 1
    #define JUCE_PLUGINHOST_AU 1
    Now all this examples compiles and run OK.

  3. For the “audio plugins” (VST_Mac version) examples
    (the file “juce_AppConfig.h” do not exist for this example),
    I make a local copy, on the directory:
    "<…>/extras/audio plugins/demo/src/"
    of the following files:
    “juce_amalgamated.cpp”
    “juce_amalgamated.h”
    "juce_amalgamated.mm"
    then I changed the conde inside “includes.h”:
    #include "…/…/…/…/juce_amalgamated.h"
    to:
    #define JUCE_PLUGINHOST_VST 1
    #define JUCE_PLUGINHOST_AU 1
    #include "juce_amalgamated.h"
    Then, inside XCode, I changed the reference to file
    "juce_amalgamated.mm"
    to poit to my local copy.
    Now the plugin compile and run OK.

Hi all and fiopa.

Thanks to fiopa, I can compile Juce.
But I cannot compile Jucedemo.
My Xcode said internal compiler error: Bus error and point juce_amalgmeted.h38475.


template
void iterate (EdgeTableIterationCallback& iterationCallback,
const int clipLeft,
int clipTop,
const int clipRight,
int clipBottom,
const int subPixelXOffset) const <- here
{
if (clipTop < top)
clipTop = top;

compiler error: Bus error
Please submit a full bug report,
with preprocessed source if appropriate.
See URL:http://developer.apple.com/bugreporter for instructions.
{standard input}:442002:FATAL:.abort detected. Assembly stopping.
from /Users/toshi/Documents/juce/extras/juce demo/build/macosx/…/…/src/juce_LibrarySource.mm:12:
from /Users/toshi/Documents/juce/extras/juce demo/build/macosx/…/…/src/…/…/…/juce_amalgamated.mm:10,
In file included from /Users/toshi/Documents/juce/extras/juce demo/build/macosx/…/…/src/…/…/…/juce_amalgamated.cpp:203894,
/Developer/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon/strings.h:1:2: warning: #warning Strings.h is not available on Mac OS X
/Users/toshi/Documents/juce/extras/juce demo/build/macosx/…/…/src/…/…/…/juce_amalgamated.h:38475: internal compiler error: Bus error
Build failed

What happened???
Please help me.

Mac Book G4, 10.4.10 & Xcode 2.5.

Well… the same compiler works for me and everyone else… No idea! You’re not running with less than a gig of ram, are you?

Hi Toshi…there’s a couple of weird things. Xcode thinks Strings.h(or in reality strings.h) is being included(in Carbon framework and not the std lib), which from the amalgamation file would only be included if BSD or NEED_BSD_STRINGS is defined. Julian has setup search headers to be inside FlatCarbon, so that explains that error(I removed that from the project) and changed #include <Carbon.h> to #include <Carbon/Carbon.h> and #include <Quicktime/Movies.h> in the appropriate errors that follow.

I have the same setup as you, so I downloaded Juce from sourceforge(not the tip)

I modified juce.xcconfig to the following(I don’t have the old 10.3 SDK installed)

[code]
ARCHS = i386 ppc

// These settings let you build for compatibility with 10.3 onwards.

MACOSX_DEPLOYMENT_TARGET_ppc = 10.4
MACOSX_DEPLOYMENT_TARGET = 10.4

// In XCode 3, this is the best SDK to use…
//SDKROOT = $(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk

// (if you’re building in XCode 2.5, you might need to use this line
// instead of the 10.5 line above…)
SDKROOT = $(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk[/code]

And sure enough I get the exact same errors as you. Which seem to be related to the zlib library but there is a namespace defined around it, so that’s odd. I found the amalgamation file a little resource intensive for my little laptop, but I had compiled it in the past, so to get up and going how about…

I suggest that because you can compile the library(and so can I from the download) you remove juce_AppConfig.h and juce_LibrarySource.mm file from the demo project and add the library file created from the library project.

One last warning, in the library project in juce_Config.h uncomment the #define JUCE_QUICKTIME 1 otherwise you’ll get linker errors in the juce demo.

And success!

:smiley:

To help Julian…

seems to be the problem. (or part of it). A bit of a head scratcher!

Ok, does it help to add these lines to juce_GZipDecompressorInputStream.cpp, line 69:

#include "zlib/zutil.c" #undef Byte #undef Bytef }

That’ll stop zlib’s definitions from being left around to pollute other files.

(Remember that after you apply this mod you’ll need to run the amalgamator to rebuild the juce_amalgated.cpp file)

I just checked out a fresh copy of the source tree and tried building PluginHost. Here’s what I see: 1>------ Build started: Project: PluginHost, Configuration: Debug Win32 ------ 1>Compiling... 1>juce_LibrarySource.cpp 1>d:\juce\trunk\juce_amalgamated.cpp(221968) : error C2065: 'Byte' : undeclared identifier 1>d:\juce\trunk\juce_amalgamated.cpp(221968) : error C2059: syntax error : ')' 1>d:\juce\trunk\juce_amalgamated.cpp(226654) : error C2065: 'Bytef' : undeclared identifier 1>d:\juce\trunk\juce_amalgamated.cpp(226654) : error C2059: syntax error : ')' 1>d:\juce\trunk\juce_amalgamated.cpp(226656) : error C2059: syntax error : ')'
Commenting out the #undefs fixes the problem though. I’m just thought I’d mention my experience here.

Whoops, didn’t mean to check that in just yet… Yes, it just needs the undef Bytef line removed. I’ve tidied it up now.

Thanks for jules & justin, I can compile juce and juce demo now.
I upload my memo for helping new comer.

Power Book G4 1.67GHz 1GBRAM 10.4.8 (Japanese environment)

juce

1, download juce 1.46 from source forge
2, download xcode 2.5
3, download vstsdk2.4 and copy to ~/stuff/
4, uncomment “juce_Config.h”:
#define JUCE_PLUGINHOST_VST 1
#define JUCE_PLUGINHOST_AU 1
5, comment & uncomment “juce.xcconfig”
//SDKROOT = (DEVELOPER_SDK_DIR)/MacOSX10.5.sdk <- uncomment SDKROOT = (DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk <- comment

6, build (wait 20min…)

juce demo

1, uncommenting “juce_AppConfig.h”:
#define JUCE_PLUGINHOST_VST 1
#define JUCE_PLUGINHOST_AU 1
2, add USER_HEADER_SEARCH_PATHS “~/stuff/vstsdk2.4”(see Juce.xcodeproj)
3, build

Is the svn tip now compiling on the mac? I just downloaded 1.46, and am getting the aforementioned z_Byte undefined problem when compiling the demos.

Could the standard download be updated with the fixes for this problem?

The tip has been compiling on my mac for a while. It now definitely doesn’t include that z_byte undef.