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

Example code pops/skips and bufferFill runs forever. #56

Open
wcarss opened this issue May 22, 2014 · 1 comment
Open

Example code pops/skips and bufferFill runs forever. #56

wcarss opened this issue May 22, 2014 · 1 comment

Comments

@wcarss
Copy link

wcarss commented May 22, 2014

tl;dr: is it possible to use this library without it popping and crackling

Hi, I've been playing with audiolet today trying to do some funky text-to-music synthesis in the browser. First, thank you for making this! I would be totally unable to have the fun of making my project without your efforts.

I began by running a few of the examples, and proceeded to follow the tutorial in the wiki. The endlessly generated aimless music blew my socks off! But... it started to pop and crackle after about 30 seconds. At first I thought this may be due to the complexity of the PChoose and PSequences and the Infinitys -- so I went back to an example I'd tried earlier: the simple chord demo.

Play it once, it's fine. Play it ten times, still alright. Play it 50 times... and every play afterward will crackle and pop. "Maybe it's also too complicated", I thought, so I tried just a simple sine note -- got the same result.

I've hit this running Firefox 29.0 (after applying that JavaScriptNode -> ScriptProcessor fix from jussi-kalliokoski/sink.js#20) and Chrome 35.0.1916.114 on Ubuntu 10.10, running in a virtual machine. I thought maybe it's a VM thing, so I tried it externally in Chrome 34.0.1847.137 m on Windows 7 with the same results. Then I considered that it might be my laptop -- it's an i5 with 4GB of RAM, but it feels sluggish some days -- but my roommate got the same results on his substantially beefier desktop.

Doing some profiling and digging into the code, I found that even playing a single note will leave the function bufferFill running about every 80-100ms at the top of the stack forever, as though it got orphaned from a setInterval call, and the memory usage of the page steadily climbs over time -- gc kicks in and drops it, but about every 3-4 gcs, the growth period doubles. I tried to go in and hunt it down, but the timer/worker code is tanglier than I can wrangle.

So my questions: is the bufferFill function a red herring, and this is business as usual? Is it just a fact of life that web audio skips and pops and there's an old webkit bug somewhere, or is this a bug in our layer? Maybe even a bug in sink.js's worker implementation?

Thanks again, for making this and for reading. Any light shed would be welcome; even just an adjustment of my expectations. :)

@rohansahai
Copy link

Having the same issue as above! Would love to hear any advice or more information.

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

2 participants