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

Already on GitHub? Sign in to your account

chrome 21 problems getting sinks #34

Closed
Karbonforms opened this Issue May 30, 2012 · 12 comments

Comments

Projects
None yet
5 participants

Not getting any sinks in chrome 21.

this at line 5660:

function Sink (readFn, channelCount, bufferSize, sampleRate) {
    var sinks   = Sink.sinks,
        dev;
    for (dev in sinks){
        if (sinks.hasOwnProperty(dev) && sinks[dev].enabled){
            try{
                return new sinks[dev](readFn, channelCount, bufferSize, sampleRate);
            } catch(e1){
                console.log(dev); // added by me
                console.log(e1); //added by me
            }
        }
    }

    throw Sink.Error(0x02);

is hitting the throw every time.

When dev variable is 'webaudio' or 'webkit', I get a "SYNTAX_ERR: DOM Exception 12", "Error: An invalid or illegal string was specified." which is traced to line 6281:

        node        = context.createJavaScriptNode(bufferSize, 0, channelCount),

Seems "createJavaScriptNode" is misbehaving?

Owner

oampo commented May 30, 2012

This seems to be an issue with sink.js (which Audiolet uses for output) and the Web Audio API more broadly. See jussi-kalliokoski/audiolib.js#69 (comment) for an explanation of what's going on. I'm not sure there's too much that can be done to help until any changes to the API stabilise and filter down to sink.js. All part of the joy of working with developing web technologies I'm afraid :(

Yeah, I realise we're on the cutting edge here. I'll just test/develop using Chrome stable from a VM for now. Cheers Joe.

@oampo oampo reopened this May 30, 2012

Owner

oampo commented May 30, 2012

No problems. I'll leave this open for now until it's no longer an issue so other people aren't caught out.
Cheers for the report,
Joe

I get the same error in the beta release of Safari 6.

Owner

oampo commented Jun 20, 2012

Yeah, sounds like the changes have gone into Safari too.

@jussi-kalliokoski - any word on when this might be fixable?

Just installed Beta 2 of Safari 6 and it works!

I decided to roll in the fix, regardless of whether it may break in the future. For now it actually looks like it will break because main thread audio processing might be removed altogether.

@oampo oampo closed this in d5712d9 Jun 27, 2012

Owner

oampo commented Jun 27, 2012

Thanks Jussi. Yeah, I've been following the arguments in the bug - that will mean big changes to both Audiolet and audiolib.js I'd imagine. Interesting times...

Well, existing demos will break, no doubt, but I'll be sure to get support for main thread audio processing in sink.js, regardless of whether the Web Audio API will support it by default or via hacks. :) Which means we can tell angry people just to upgrade to the latest version, heh.

I suppose with Audiolet you could make something that would have the graphs in the main thread but the actual logic would happen in the worker and get best of the both worlds. With audiolib.js that won't work since there's less / incompatible abstraction. That said, audiolib.js already works in a worker (and actually I have a cool mechanism to inject it into a worker along with the plugins, at least in my mind it's cool, heh) so it's not that much of a biggie. However, I'll probably rewrite all of audiolib.js at some point to optimize for performance rather than ease of writing more modules at the core, sort of utility functions in the spirit of C, and then an abstraction layer (or a few) on top of that.

Hey Joe and Jussi, thanks for your diligence in trying to get this fixed :) I just updated to the latest Chrome today and noticed it had broken and was very worried.

Joe, would you mind providing an updated build file with the new sink? I don't have juicer installed on my machine to run a build myself :P

Thanks again guys!

Owner

oampo commented Jun 29, 2012

Jussi - Yeah, I think Audiolet will eventually become more of a wrapper over the Web Audio API as it becomes more widely supported.

Nicolas - Done and done!

Thank you sir! You are a gentleman and a scholar :D

I've been doing a LOT of work on JSaw recently :) got an extra burst of motivation to keep me going.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment