Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got a very minimalistic setup of ubuntu precise, created using debootstrap. So please don't assume that any packages are installed just because they usually are. On that system, I'd like to play some sounds from a java applet. However, this always fails with the following error message:

javax.sound.midi.MidiUnavailableException: Can not open line
Caused by: java.lang.IllegalArgumentException: No line matching interface
        SourceDataLine supporting format PCM_SIGNED 44100.0 Hz,
        16 bit, stereo, 4 bytes/frame, little-endian is supported.
    at javax.sound.sampled.AudioSystem.getLine(
    at javax.sound.sampled.AudioSystem.getSourceDataLine(
    ... 35 more

As the messages mention a soft synthesizer, and pcm lines, I expect that the lack of some midi daemon is not the issue here. As far as I can tell, the alsa kernel modules are loaded, including snd_hda_intel, snd_pcm, snd_seq_midi among others. I've also included the alsa-base and alsa-utils packages in my installation. alsa-mixer looks good, using “HDA Intel PCH” as its default device.

What other packages, configuration settings or daemon startups does java require to make its sound output work?

share|improve this question
up vote 2 down vote accepted

I've solved this myself. Using strace (I love this tool!), I found out that java attempts to access various alsa sound control devices. Most of them don't exist (ENOENT), but the first and primary one gives (EPERM) indicating insufficient permissions.

From there, the fix was obvious: the device in question belongs to the audio group, but the user running the java applet in question does not. Adding him to that group made the error message disappear.

I'm still not hearing any sound, but that might be due to some other problem, located within the applet itself.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.