Minim Not Working on Ubuntu Server

Hello! I am trying to port over a processing sketch onto a Ubuntu server. Its being run in a headless mode, and I’m not sure if that has any effect on whats going on. For some reason I get

==== JavaSound Minim Error ====
==== Unable to return a SourceDataLine: unsupported format - PCM_SIGNED 44100.0 Hz, 16 bit, st
ereo, 4 bytes/frame, little-endian
==== JavaSound Minim Error ====
==== Couldn’t acquire an output.
LineWord2.pde:314:0:314:0: NullPointerException

Whenever I try to run my sketch. This sketch is relatively advanced, it is an audio visualizer tool that has to write data to external files, so there could be multiple things that minim is not correctly doing.
For good measure I created a simple sketch that only plays a .mp3, and even that was saying it couldnt load the file and throwing a null pointer exception. Both of these sketches run perfectly fine on windows.

1 Like

It is good that you tried some simple code. If you have a chance, try any of the provided examples that comes with the library. This will help future forum goers experiencing your same challenge.

Because it is a server, I am going to go ahead and guess that it has not sound hardware installed. Maybe do a bit of research on internet about making minim work on a server? Not sure if headless is an issue here. As I understand, headless if for the graphics and user input part. Not sure if it goes all the way and cover sound as well.

Could you comment who is your server provider for the record? You could also contact them and inquire about this issue and they might be able to assist you as well.


1 Like

I actually did try one of the provided examples from minim, I can’t seem to remember the exact name but it was about as basic as you could go, just playing a sound.

I’ve done a decent amount of research, and was able to only find a few other threads online dealing with issues similar to mine. Additionally MinimServer is the name of an existing UPnP AV music server, so that can make it a little hard to find relevant topics with certain search terms.

I’ll look into the absence sound hardware being an issue here. If it is the issue there could be an audio equivalent of headless mode.

My server provider is Google Cloud Platform.

I think Minim relies on JavaSound and I’m not sure there’s a headless JavaSound device provider so you’re almost certainly out of luck with this. You may need to fork code from Minim to work without JavaSound or use another library like Beads that can run headless.


man, thats unfortunate to hear. This is the last leg of a 3 month project, so It would feel terrible to have to scrap it at this point.

Using another library like beads doesnt seem very possible, like I mentioned earlier its a relatively complicated project, and I don’t think I could even port it to beads if I wanted to.
If it was potentially possible to fork over code from Minim to work without JavaSound, would I run into further errors with the other platforms its built on? Namely, Tritonus and MP3SPI. (That sounds like a tough and cumbersome project, and I’d like to avoid it if possible)
I believe its possible to add a GUI to a server, it just takes a large amount of bandwidth. Maybe that would be a solution?
Any other ideas?

I’m having a pretty hard time finding much information about JavaSound in headless mode or on a server. Are you sure thats the issue?

Actually, second thought that might work. Firstly, make sure your JDK on the server is the full version, not just the headless one (sound providers are packaged with the desktop dependencies as far as I know). Then, if the server doesn’t have an actual sound device, you could look at creating a fake ALSA device. This might fool JavaSound into working.

See eg.


Man, this stuff is killing me.

Running aplay -l shows that there is not soundcards found. So I went a head and started making a dummy alsa device.

I installed everything alsa related that I would need. But when starting to modprobe the kernels, I get module not found in the directory error. I tried a few fixes but nothing seems to work. Even when using insmod, this checks all the kernel directories I believe, I still cant find any of the modules I need to start making the dummy alsa device.

The alsa-wiki is incredibly confusing, and kinda conflicts with the rest of the research I’ve done.
Maybe I missed a step somewhere?

Im still trying to get used to linux, and I know nothing about alsa so any help is greatly appreciated.