Modify

Opened 19 months ago

Closed 19 months ago

Last modified 19 months ago

#22973 closed defect (fixed)

mp3 support is broken

Reported by: Adrian Owned by: Don-vip
Priority: normal Milestone:
Component: Plugin javafx Version: tested
Keywords: template_report mp3 javafx openjfx Cc:

Description

What steps will reproduce the problem?

  1. Open a .gpx file
  2. From the layer context menu, import audio and open an .mp3 file
  3. In the audio menu, select Play

What is the expected result?

The mp3 file plays and an arrow moves along the gpx track.

What happens instead?

There is a warning that JOSM was compiled without Java FX support and then an UnsupportedAudioFileException.

Please provide any additional information below. Attach a screenshot if possible.

Mp3 support was added under #2089. The status report doesn't say whether my JDK includes jfx support - it does. If it doesn't, you get an alert when installing the javafx plugin, and I'm not getting that alert.

I tried with the macOS package and there was the same warning and error. The macOS package contains a JRE which includes openjfx.

With a traditional svn and ant build, I tried commenting out lines 55-57 of build.xml

                <not>
                    <available classname="javafx.scene.media.Media"/>
                </not>

This did not fix the issue. I tried it because of the warning that JOSM was compiled without Java FX support.

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2023-05-01 18:25:03 +0200 (Mon, 01 May 2023)
Revision:18721
Build-Date:2023-05-02 01:30:57
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (18721 en_GB) Mac OS X 11.7.7
OS Build number: macOS 11.7.7 (20G1345)
Memory Usage: 274 MB / 4096 MB (92 MB allocated, but free)
Java version: 17.0.7+7-LTS, Azul Systems, Inc., OpenJDK 64-Bit Server VM
Look and Feel: com.apple.laf.AquaLookAndFeel
Screen: Display 725375437 1920×1200 (scaling 1.00×1.00)
Maximum Screen Size: 1920×1200
Best cursor sizes: 16×16→16×16, 32×32→32×32
Environment variable LANG: en_GB.UTF-8
System property file.encoding: UTF-8
System property sun.jnu.encoding: UTF-8
Locale info: en_GB
Numbers with default locale: 1234567890 -> 1234567890
Dataset consistency test: No problems found

Plugins:
+ ImportImagePlugin (36013)
+ InfoMode (35978)
+ PicLayer (1.0.2)
+ apache-commons (36034)
+ cadastre-fr (36021)
+ editgpx (36054)
+ ejml (35924)
+ geotools (36068)
+ http2 (35921)
+ imagery_offset_db (35978)
+ jackson (36034)
+ javafx (36034)
+ jaxb (35952)
+ jts (36004)
+ log4j (36034)
+ measurement (35978)
+ opendata (36076)
+ photo_geotagging (35933)
+ poly (35976)
+ reverter (36043)
+ turnrestrictions (36011)
+ undelete (36011)
+ utilsplugin2 (36011)
+ waydownloader (36011)

Last errors/warnings:
- 00097.682 W: JOSM compiled without Java FX support. Falling back to Java Sound API
- 00097.699 E: org.openstreetmap.josm.io.audio.AudioException: javax.sound.sampled.UnsupportedAudioFileException: URL of unsupported format. Cause: javax.sound.sampled.UnsupportedAudioFileException: URL of unsupported format
- 00097.700 E: org.openstreetmap.josm.io.audio.AudioException: javax.sound.sampled.UnsupportedAudioFileException: URL of unsupported format

Attachments (0)

Change History (5)

comment:1 by taylor.smock, 19 months ago

Component: Core audioPlugin javafx
Owner: changed from team to Don-vip

org.openstreetmap.josm.io.audio.AudioException: javax.sound.sampled.UnsupportedAudioFileException: URL of unsupported format. Cause: javax.sound.sampled.UnsupportedAudioFileException: URL of unsupported format

I've managed to reproduce locally, and the stack trace is as follows:

org.openstreetmap.josm.io.audio.AudioException: javax.sound.sampled.UnsupportedAudioFileException: URL of unsupported format
	at org.openstreetmap.josm.io.audio.JavaSoundPlayer.play(JavaSoundPlayer.java:66)
	at org.openstreetmap.josm.io.audio.AudioPlayer.run(AudioPlayer.java:339)
Caused by: javax.sound.sampled.UnsupportedAudioFileException: URL of unsupported format
	at java.desktop/javax.sound.sampled.AudioSystem.getAudioInputStream(Unknown Source)
	at org.openstreetmap.josm.io.audio.JavaSoundPlayer.play(JavaSoundPlayer.java:64)

After a bit of debugging, it looks like there was another stack trace,

java.lang.IllegalAccessException: class org.openstreetmap.josm.io.audio.AudioPlayer cannot access a member of class org.openstreetmap.josm.plugins.javafx.io.audio.JavaFxMediaPlayer with modifiers ""
	at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:392)
	at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:674)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:489)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
	at org.openstreetmap.josm.io.audio.AudioPlayer.<init>(AudioPlayer.java:283)
	at org.openstreetmap.josm.io.audio.AudioPlayer.getInstance(AudioPlayer.java:248)
	at org.openstreetmap.josm.io.audio.AudioPlayer.play(AudioPlayer.java:164)
	at org.openstreetmap.josm.gui.layer.markerlayer.AudioMarker.play(AudioMarker.java:71)
	at org.openstreetmap.josm.gui.layer.markerlayer.AudioMarker.play(AudioMarker.java:84)
	at org.openstreetmap.josm.gui.layer.markerlayer.AudioMarker.actionPerformed(AudioMarker.java:40)
	at org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer$MarkerMouseAdapter.mouseReleased(MarkerLayer.java:602)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:298)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6626)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3389)
	at java.desktop/java.awt.Component.processEvent(Component.java:6391)
	at java.desktop/java.awt.Container.processEvent(Container.java:2266)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:746)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:744)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:743)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

So the problem is probably due to the JavaFX audio player constructor visibility. Which is easy enough to fix.

comment:2 by taylor.smock, 19 months ago

Resolution: fixed
Status: newclosed

In 36086/osm:

Fix #22973: mp3 support is broken

This occurred due to the constructor for the JavaFxMediaPlayer being private.

comment:3 by taylor.smock, 19 months ago

In 36087/osm:

See #22973 (dist): mp3 support is broken

This occurred due to the constructor for the JavaFxMediaPlayer being private.

comment:4 by Adrian, 19 months ago

I have installed the new version of the javafx plugin, and mp3 playback is now working. Thank you for the quick fix.

comment:5 by taylor.smock, 19 months ago

No problem. It was trivial to fix once someone noticed the problem. It probably got broken (accidentally) when we moved the JavaFX player out of JOSM core and into the javafx plugin.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Don-vip.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.