Giter VIP home page Giter VIP logo

Comments (8)

philburk avatar philburk commented on May 29, 2024

I tried but could not reproduce this error. Maybe you have different devices.

Here is the output I get by running the attached file as a unit test.

java.version = 1.8.0_45, java.vendor = Oracle Corporation, os.arch = x86_64
INPUT device = 0, channels = 2
OUTPUT device = 0, channels = 2
Aug 01, 2016 8:52:13 AM com.jsyn.engine.SynthesisEngine start
INFO: Pure Java JSyn from www.softsynth.com, rate = 96000, RT, V16.7.5 (build 459, 2015-11-02)
2016-08-01 08:52:13.679 java[17005:13887572] 08:52:13.679 WARNING: 140: This application, or a library it uses, is using the deprecated Carbon Component Manager for hosting Audio Units. Support for this will be removed in a future release. Also, this makes the host incompatible with version 3 audio units. Please transition to the API's in AudioComponent.h.
Aug 01, 2016 8:52:15 AM com.jsyn.engine.SynthesisEngine run
INFO: JSyn synthesis thread in finally code.
java.version = 1.8.0_45, java.vendor = Oracle Corporation, os.arch = x86_64
Aug 01, 2016 8:52:16 AM com.jsyn.engine.SynthesisEngine start
INFO: Pure Java JSyn from www.softsynth.com, rate = 96000, RT, V16.7.5 (build 459, 2015-11-02)
INPUT device = 0, channels = 2
OUTPUT device = 0, channels = 2
java.version = 1.8.0_45, java.vendor = Oracle Corporation, os.arch = x86_64
INPUT device = 0, channels = 2
OUTPUT device = 0, channels = 2
Aug 01, 2016 8:52:18 AM com.jsyn.engine.SynthesisEngine run
INFO: JSyn synthesis thread in finally code.
#0: Default Audio Device, 2 inputs, 2 outputs
#1: Built-in Microphone, 2 inputs, 0 outputs
#2: Built-in Output, 0 inputs, 2 outputs
#3: Port Built-in Microphone, 0 inputs, 0 outputs
#4: Port Built-in Output, 0 inputs, 0 outputs

TestSynth.java.txt

BTW, I notice you have two calls to start() in your error log. I tried starting twice but it still worked.

from jsyn.

dhowe avatar dhowe commented on May 29, 2024

So the issue, I think, was in the 2nd call to start (in some cases, the engine apparently needed to be restarted, I'm not sure why), which used the following code:

Synth.stop();
Synth.start(flag, rate, inDevID, inDevChNum, outDevID, outDevChNum);

which appears to cause the NullPointerException. When I changed this code to:

Synth.stop();
Synth.terminate();

Synth.initialize();
Synth.start(flag, rate, inDevID, inDevChNum, outDevID, outDevChNum);

things again work ok...

from jsyn.

philburk avatar philburk commented on May 29, 2024

Thanks! I modified my test and can now reproduce the crash. It appears that JavaSound streams can take 1200 msec to close! But I was only waiting for 1000 msec. So there was a race condition.

Instead of start-stop-start-stop I has start-start-stop-stop.

The delayed stop() clobbered the stream created by the second start. I know how to fix this. Thanks for reporting it.

from jsyn.

philburk avatar philburk commented on May 29, 2024

Now I need to update the downloadable JAR files.

from jsyn.

philburk avatar philburk commented on May 29, 2024

The new JAR files are posted on the JSyn site. Please let me know if they fix the problem for you.

http://www.softsynth.com/jsyn/developers/download.php

from jsyn.

dhowe avatar dhowe commented on May 29, 2024

Question: what is the proper sequence for restarting the synth engine? Synth.stop, then Synth.start OR Synth.stop, Synth.terminate, Synth.initialize, Synth.start?

from jsyn.

philburk avatar philburk commented on May 29, 2024

You should be able to Synth.stop() then Synth.start(). If not then it is a bug.

from jsyn.

philburk avatar philburk commented on May 29, 2024

I think this is fixed now. If not then let me know and I will reopen it.

from jsyn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.