[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Sc-devel] Re: [sc-users] strange diskin crash



thanks james, for finding my typo and for Updater tip!
still no joy...

so, here is the simplest way i can crash the lang (crash report:
http://koncon.nl/~ttlalim/uploads/diskin_crash.txt)

s.boot;

// choose 153 setreo file paths
CocoaDialog.getPaths({ arg paths;
       ~paths = paths
});

b = Buffer.cueSoundFile(s, ~paths.choose, 0, 2);

x = { DiskIn.ar(2, b.bufnum) }.play; // !crashes here!

b.close;

is this my user mistake, or maybe a bug?

grtz,
tom

On Nov 14, 2007 4:33 AM, James Harkins <jamshark70@xxxxxxxxx> wrote:
>
> At what point does it crash? Immediately when you execute the start
> function, or sometime after that?
>
> Does it happen the first time you run the function, or do you have to run it
> several times before it crashes?
>
> Can you get the crash log out of the console viewer? Applications >
> utilities > console > ~/Library/Logs > CrashReporter >
> SuperCollider.crash.log
>
> A couple of potential issues on your code... the synthdef includes no
> instructions to free itself when the file is over, meaning that the clean-up
> code in the forked function will never execute. I don't recall offhand if
> DiskIn works as an input to FreeSelfWhenDone, but it makes sense to me that
> it should.
>
> Is there a typo here? The function is actually interpreted as an argument to
> 'not', and the 'if' call consequently has no true or false branch. That
> shouldn't cause the language to crash, though.
>
> if(x.isPlaying.not{b.close; b.free; doneAction.value});
>
> if(x.isPlaying.not) {b.close; b.free; doneAction.value};
>
> Also, as a matter of personal preference, I'm not crazy about the
> "busy-wait" style of checking for a certain condition. ("Busy-wait" means
> running a routine to recheck a condition repeatedly until the action is
> needed.) Since you're using NodeWatcher, the clean-up can wait passively for
> a signal from the watcher.
>
> NodeWatcher.register(x);
> u = Updater(x, { |node, msg|
>  if(msg == \n_end) {
>  b.close; b.free; doneAction.value;
>  u.remove;
>  }
> });
>
> I think this is more elegant. Plus, it means that the clean-up will happen
> immediately, instead of up to 0.1 seconds later.
>
> hjh
>
>
>
>
>
> On Nov 11, 2007, at 7:37 PM, tom tlalim wrote:
>
>
> i'm getting unexpected lang crashes when keeping 159 paths in memory
> and trying to play them with diskin.
> this doesn't happen with smaller amounts of paths...
>
> any ideas why?
> thnx,
> t
>
>
> (
> CocoaDialog.getPaths({ arg paths;
>  ~paths = paths
> });
> )
>
> // cue and play right away
> (
> SynthDef("help-Diskin", { arg bufnum = 0;
>  Out.ar(0, DiskIn.ar(2, bufnum));
> }).load(s);
> )
>
> (
> ~start_sound = {|doneAction|
> var x, m, b;
> x = Synth.basicNew("help-Diskin");
> m = { arg buf; x.addToHeadMsg(nil, [\bufnum,buf.bufnum])};
> NodeWatcher.register(x);
> b = Buffer.cueSoundFile(s,~paths.choose,0,2, completionMessage: m);
> t = {loop{ if(x.isPlaying.not{b.close; b.free; doneAction.value});
> 0.1.wait}}.fork;
> CmdPeriod.doOnce({x.free; b.close; b.free; t.stop;});
> }
> )
>
> ~start_sound.value
> _______________________________________________
> sc-users mailing list
> sc-users@xxxxxxxxxxxxxxx
> http://www.create.ucsb.edu/mailman/listinfo/sc-users
>
>
>
>
>
> : H. James Harkins
>
> : jamshark70@xxxxxxxxxxxxxxxxx
>
> : http://www.dewdrop-world.net
>
> .::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:
>
>
>
>
> "Come said the Muse,
>
> Sing me a song no poet has yet chanted,
>
> Sing me the universal."  -- Whitman
>
> _______________________________________________
> sc-users mailing list
> sc-users@xxxxxxxxxxxxxxx
> http://www.create.ucsb.edu/mailman/listinfo/sc-users
>
>