Failed on Hello_Beads

143 views
Skip to first unread message

Marauder Slide

unread,
Mar 8, 2020, 8:36:25 PM3/8/20
to beadsproject
I have installed everything in Netbeans, created a Maven project, and created the first Hello_Beads

import net.beadsproject.beads.core.AudioContext;
import net.beadsproject.beads.data.Buffer;
import net.beadsproject.beads.ugens.WavePlayer;

public class Hello_Beads {

    public static void main(String[] args) {
        AudioContext ac = new AudioContext();
        WavePlayer wp = new WavePlayer(ac, 440f, Buffer.SINE);
        ac.out.addInput(wp);
        ac.start();
    }
}

It compiles, and it is possible to run it. However it just ends with the message

-- exec-maven-plugin:1.5.0:exec (default-cli) @ mybeads ---
AudioContext : no AudioIO specified, using default => net.beadsproject.beads.core.io.JavaSoundAudioIO.
JavaSoundAudioIO: Chosen mixer is Port PCH [hw:0].
Exception in thread "Thread-0" java.lang.IllegalArgumentException: Line unsupported: interface SourceDataLine supporting format PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, big-endian
    at java.desktop/com.sun.media.sound.PortMixer.getLine(PortMixer.java:131)
    at net.beadsproject.beads.core.io.JavaSoundAudioIO.create(Unknown Source)
    at net.beadsproject.beads.core.io.JavaSoundAudioIO$1.run(Unknown Source)
    at java.base/java.lang.Thread.run(Thread.java:834)

What is the problem?

Marauder Slide

unread,
Mar 10, 2020, 12:05:05 PM3/10/20
to beadsproject
Hello?

Is there anyone there?

Or should I give up on Beads before I have even started?

Ollie Bown

unread,
Mar 10, 2020, 6:18:47 PM3/10/20
to beadsp...@googlegroups.com
Hi Magnus,

what system are you on? Linux perhaps?
The problem seems to be that what Beads thinks is the default audio driver isn’t coming up as something that is usable.

You should be able to use JavaSoundAudioIO to find a suitable audio driver. The code will be something like this.

JavaSoundAudioIO jsaio = new JavaSoundAudioIO(512);   //<— you may have to throw in some other audio format parameters here.
jsaio.printMixerInfo(); //run this to see what system audio options you have
jsaio.selectMixer(0);  //zero is the default which isn’t working, try other numbers
AudioContext ac = new AudioContext(jsaio);  //<— you may have to throw in some other audio format parameters here.

The documentation for JavaSoundAudioIO and AudioContext should give you some more pointers.

Let us know how you go. 

Best,

Ollie


--
You received this message because you are subscribed to the Google Groups "beadsproject" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beadsproject...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beadsproject/0527a12d-f63f-4087-aa11-ace6ec233ad1%40googlegroups.com.

Marauder Slide

unread,
Mar 11, 2020, 7:45:34 AM3/11/20
to beadsproject
Your guess is correct. Yes, I run Linux.

Thanks. Now I have a starting point.

Message has been deleted

Marauder Slide

unread,
Mar 17, 2020, 6:25:39 PM3/17/20
to beadsproject
I run on Ubuntu 18.04 LTS. This Hello World works.

public class Hello_Beads {

    private static void linuxHw() {

        JavaSoundAudioIO jsaio = new JavaSoundAudioIO(512);   //<— you may have to throw in some other audio format parameters here.
        jsaio.printMixerInfo();        //run this to see what system audio options you have
        jsaio.selectMixer(1);         //zero is the default which isn’t working, try other numbers

        AudioContext ac = new AudioContext(jsaio);     //<— you may have to throw in some other audio format parameters here.       
        WavePlayer wp = new WavePlayer(ac, 440f, Buffer.SINE);
        ac.out.addInput(wp);
        ac.start();
    }

    public static void main(String[] args) {
        linuxHw();
    }
}

That is Ollies code but the mixer number 1.

Robert Bremel

unread,
Mar 17, 2020, 6:29:57 PM3/17/20
to beadsp...@googlegroups.com
I hope you get this to run.  

You seem to have gotten into the same type of problems I did about a year and a half ago when I tried to do a build on my (Windows) machine.  

It is also  why I posted a message a little while ago asking whether it would be possible to make a Docker version.   I work in bioinformatics and Docker has revolutionized things in the past couple of years because what you are encountering happened all the time.  Now, the last time I checked, there are over a thousand biocontainers. 

I have some things I would like to do with beads but this is a bit of a diversion tactic on my part so I don't have time to fiddle around trying to make things work.

_RDB



On Tue, Mar 17, 2020 at 5:19 PM Marauder Slide <magnus.s...@gmail.com> wrote:
--
You received this message because you are subscribed to the Google Groups "beadsproject" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beadsproject...@googlegroups.com.

INTERLICHTSPIELHAUS

unread,
Mar 17, 2020, 6:45:14 PM3/17/20
to beadsp...@googlegroups.com, magnus.s...@gmail.com
I'm also on Ubuntu 18.04

I also remember having issues initially,
but got things working after experimentation with the following :

private void initiateAudioContext() {
if (this.topPanel.getSoundServer().equals(DrumConfiguration.JACK_AUDIO_SERVER)) {
this.audioContext = new AudioContext(new AudioServerIO.Jack(), 512,
new IOAudioFormat(44100, 16, 0, 2, true, false));
} else {
this.audioContext = new AudioContext();
// this.audioContext = new AudioContext(new JavaSoundAudioIO(), 512,
// new IOAudioFormat(48000, 16, 2, 2, true, true));
}
}

--
You received this message because you are subscribed to the Google Groups "beadsproject" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beadsproject...@googlegroups.com.

Ollie Bown

unread,
Mar 17, 2020, 7:00:02 PM3/17/20
to beadsp...@googlegroups.com
Thanks for chiming in guys.

Modernising Beads would be great. I still think the core of the library is strong. More generally, Docker is one of several things we might do. I’m very keen on proper Gradle support. This IO stuff could be improved ever so slightly, and in theory should mean that Beads can work in a couple of other key contexts: Android is one of them. Web apps via a Java>JavaScript interface such as GWT would be another (we did all of this as a proof of concept 10 years ago!). Support for Kotlin could be interesting. The list is endless. The API could also be cleaned up a little too.

Another massive one is an update to the Processing library, which just needs a bit of fixin of the automated package re-structure (Processing requires a flat package structure, which we automate).

As you may have seen me say before, (1) I really have no good idea how many people use Beads, (2) it’s being developed as part of our HappyBrackets project but has not been a priority for a long time.

I’m always keen to get support from the community. This would make a really great student internship project too, and I’d be happy to sign a letter of support on such an activity — I’m a senior lecturer at UNSW Australia, and I could also supervise this in the form of a research or capstone project. Please spread the word if you think there might be anyone interested in this kind of support.

Hope you’re enjoying the library and making cool sounds,

Ollie

Justin Neal

unread,
Apr 15, 2020, 6:53:16 PM4/15/20
to beadsproject
I got the same error running the exact same code.  I've been trying to figure out how to fix it with no luck.  Did you ever figure this out?

Justin Neal

unread,
Apr 15, 2020, 6:53:16 PM4/15/20
to beadsproject
Never mind,  I got it to work. I had to use select.Mixer(2) to access my primary sound drive.
Reply all
Reply to author
Forward
0 new messages