None of the sound libraries work for me under with Processing 3.5.4 on Linux Mint 20. The basic Sound , Beads and Minim all give the same error when trying to run any of their included demo sketches :
javax.sound.sampled.LineUnavailableException: line with format PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not supported.
at com.sun.media.sound.DirectAudioDevice$DirectDL.implOpen(DirectAudioDevice.java:513)
at com.sun.media.sound.AbstractDataLine.open(AbstractDataLine.java:121)
at com.jsyn.devices.javasound.JavaSoundAudioDevice$JavaSoundInputStream.start(Unknown Source)
at com.jsyn.engine.SynthesisEngine$EngineThread.run(Unknown Source)
javax.sound.sampled.LineUnavailableException: line with format PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not supported.
at com.sun.media.sound.DirectAudioDevice$DirectDL.implOpen(DirectAudioDevice.java:513)
at com.sun.media.sound.AbstractDataLine.open(AbstractDataLine.java:121)
at com.jsyn.devices.javasound.JavaSoundAudioDevice$JavaSoundOutputStream.start(Unknown Source)
at com.jsyn.engine.SynthesisEngine$EngineThread.run(Unknown Source)
java.lang.NullPointerException
at com.jsyn.devices.javasound.JavaSoundAudioDevice$JavaSoundOutputStream.write(Unknown Source)
at com.jsyn.devices.javasound.JavaSoundAudioDevice$JavaSoundOutputStream.write(Unknown Source)
at com.jsyn.engine.SynthesisEngine$EngineThread.run(Unknown Source)
java.lang.RuntimeException: AudioInput stop attempted when no line created.
at com.jsyn.devices.javasound.JavaSoundAudioDevice$JavaSoundInputStream.stop(Unknown Source)
at com.jsyn.engine.SynthesisEngine$EngineThread.run(Unknown Source)
java.lang.RuntimeException: AudioOutput stop attempted when no line created.
at com.jsyn.devices.javasound.JavaSoundAudioDevice$JavaSoundOutputStream.stop(Unknown Source)
at com.jsyn.engine.SynthesisEngine$EngineThread.run(Unknown Source)
All other scripts work, examples, I/O video, etc.
Sound works on the computer no issues - even Java sound demos (I tried this one Java Sound API: Java Sound Demo ) work fine.
Any suggestions on where to even start exploring this? I’ve already reinstalled Processing with no luck.
Thanks -
Rob A.
The issue is probably at your end sound libraries work OK for me on my Linux MInt-20.1 box.
Linux tux-PC-2163 5.8.0-41-generic #46~20.04.1-Ubuntu SMP Mon Jan 18 17:52:23 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
PulseAudio can be problematic, but asfaik that usually only affects vanilla sound library.
I figured it out. I was using Processing provided by the Mint Software Manager which turns out is a Flatpak. I used that as it was identified as the same version of Processing (3.5.4) available as a tgz from the Processing website. At least for me, the Flatpak bundled libs dont work with the sound library.
I removed the Flatpak, downloaded and extracted the file from the Processing website and it all works properly!.
(As a note I generally try to install from the software manager when possible to ensure dependencies all get taken care of.)
-Rob A>
Flatpak looks to be a bit of nightmare you are at the mercy of a maintainer who may or may not have set correct permissions.
1 Like
Yes, AppImage is great for this sort of thing, Flatpak and Snap are hit and miss for anything that involves development, unless you run without any of the sandboxing requirements.
The other thing to be aware of is that only OpenJDK as distributed by distros tends to have an actual PulseAudio backend (it’s GPL without CPE) so will interface with it directly by default, whereas the Oracle and other OpenJDK’s have an ALSA backend, so will interface indirectly via that by default. Then some sound libraries might use the alternative ALSA backend that wants exclusive use of the soundcard and will fail without. Working out which you have and which causes the most problems is all part of the game.
Or if you stick with Beads you could also look at using JACK instead.
1 Like
Flatpak looks to be a bit of nightmare you are at the mercy of a maintainer who may or may not have set correct permissions.
Should of actually tried to understand this when I read your post, @monkstone
Long story short - yes - the packager didn’t set the sandbox permissions correctly.
I ended up installing this handy tool (also a flatpak) that lets you view and change flatpak sandbox permissions: How To Easily Configure Flatpak Apps Permissions With Flatseal
Two minutes later I checked the settings and toggled access to pulseaudio, now sound works.
-Rob A>
2 Likes