Summary: | Problems using javax.sound | ||
---|---|---|---|
Product: | classpath | Reporter: | Panagiotis Issaris <takis> |
Component: | classpath | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bug-classpath, psj, tromey |
Priority: | P3 | ||
Version: | 0.20 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2006-02-18 00:20:28 |
Description
Panagiotis Issaris
2006-02-17 13:26:27 UTC
If you've got JamVM and Oscar installed you can reproduce it by using a few commands: jamvm -jar lib/oscar.jar orb install "MP3 Player" start 5 mp3 play file:/tmp/test.mp3 Which in more detail with Oscar's output will look like this: takis@zeus:/opt/Oscar$ jamvm -jar lib/oscar.jar Welcome to Oscar. ================= Enter profile name: takis -> obr install "MP3 Player" Installing: MP3 Player -> ps START LEVEL 1 ID State Level Name [ 0] [Active ] [ 0] System Bundle (1.0.5) [ 1] [Active ] [ 1] Shell Service (1.0.2) [ 2] [Active ] [ 1] Shell TUI (1.0.0) [ 3] [Active ] [ 1] Bundle Repository (1.1.2) [ 4] [Installed ] [ 1] mp3 player (0.0.2) -> start 4 A new command has been installed mp3 play|stop <stream URL> Ex : mp3 play http://sofsis.cl:8000/128.mp3 Ex : mp3 play file:/opt/mp3player/test.mp3 -> mp3 play file:/tmp/test.mp3 javax.sound.sampled.LineUnavailableException: no Clip available at javax.sound.sampled.AudioSystem.getLine (AudioSystem.java:387) at javazoom.jl.player.JavaSoundAudioDevice.createSource (JavaSoundAudioDevice.java:101) at javazoom.jl.player.JavaSoundAudioDevice.writeImpl (JavaSoundAudioDevice.java:148) at javazoom.jl.player.AudioDeviceBase.write (AudioDeviceBase.java:133) at javazoom.jl.player.JavaSoundAudioDevice.test (JavaSoundAudioDevice.java:205) at javazoom.jl.player.JavaSoundAudioDeviceFactory.testAudioDevice (JavaSoundAudioDeviceFactory.java:83) at javazoom.jl.player.JavaSoundAudioDeviceFactory.createAudioDevice (JavaSoundAudioDeviceFactory.java:42) at javazoom.jl.player.FactoryRegistry.createAudioDevice (FactoryRegistry.java:87) at javazoom.jl.player.advanced.AdvancedPlayer.<init> (AdvancedPlayer.java:66) at javazoom.jl.player.advanced.AdvancedPlayer.<init> (AdvancedPlayer.java:58) at insa.mp3.PlayerActivator.playMp3 (PlayerActivator.java:130) at insa.mp3.PlayerActivator.execute (PlayerActivator.java:94) at org.ungoverned.osgi.bundle.shell.Activator$ShellServiceImpl.executeCommand (Activator.java:280) at org.ungoverned.osgi.bundle.shelltui.ShellTuiActivator$ShellTuiRunnable.run (ShellTuiActivator.java:172) at java.lang.Thread.run (Thread.java:674) The file is indeed accessible as can be seen: If the file is non-existing it goes like this: -> mp3 play file:/tmp/void.mp3 java.io.FileNotFoundException: No such file or directory: /tmp/void.mp3 at gnu.java.nio.channels.FileChannelImpl.open (Native Method) at gnu.java.nio.channels.FileChannelImpl.<init> (FileChannelImpl.java:124) at gnu.java.nio.channels.FileChannelImpl.create (FileChannelImpl.java:116) at java.io.FileInputStream.<init> (FileInputStream.java:110) at gnu.java.net.protocol.file.Connection.connect (Connection.java:191) at gnu.java.net.protocol.file.Connection.getInputStream (Connection.java:251) at java.net.URL.openStream (URL.java:684) at insa.mp3.PlayerActivator.playMp3 (PlayerActivator.java:123) at insa.mp3.PlayerActivator.execute (PlayerActivator.java:94) at org.ungoverned.osgi.bundle.shell.Activator$ShellServiceImpl.executeCommand (Activator.java:280) at org.ungoverned.osgi.bundle.shelltui.ShellTuiActivator$ShellTuiRunnable.run (ShellTuiActivator.java:172) at java.lang.Thread.run (Thread.java:674) With friendly regards, Takis Okay, I think I figured out what the problem is as the GNU Classpath task pages states: "We don't have a provider for javax.sound.sampled. Perhaps we could have one based on Jack or GStreamer." So apparantly, it is simply not implemented yet :) My example works fine on Kaffe, which is using Tritonus (www.tritonus.org) in addition to GNU Classpath for its Java classlibraries. Would the GNU Classpath developers consider integrating Tritonus in GNU Classpath or are there any licensing problems (GPL+exception vs LGPL)? Is anyone aware of anyone starting on such an implementation? If not, could anyone give some hints on what would be needed? Confirmed. We probably won't directly incorporate Tritonus into the Classpath release, though I don't think the idea has been fully discussed. However we ought to work with Tritonus -- if I set it up here I can play sounds and whatnot using jamvm+classpath+tritonus. One idea would be to write our own back end using Jack or GStreamer or the like. As far as I know nobody is actively working on this at the moment. Can you test this with the latest Classpath release with the experimental GStreamer peer enabled (--with-gstreamer-peer)? There's not enough information in this bug report to replicate the bug easily. Assuming fixed. |