Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8173619

Error when creating many MediaPlayers

XMLWordPrintable

    • x86_64
    • linux_ubuntu

      FULL PRODUCT VERSION :
      openjdk version "1.8.0_121"
      OpenJDK Runtime Environment (build 1.8.0_121-8u121-b13-0ubuntu1.16.10.2-b13)
      OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Linux lemon 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

      A DESCRIPTION OF THE PROBLEM :
      When creating a large number of MediaPlayers, I get this exception:

      MediaException: PLAYBACK_HALTED : Could not open audio device for playback.
          at javafx.scene.media.MediaException.haltException(MediaException.java:150)
          at javafx.scene.media.MediaPlayer$_PlayerStateListener.lambda$onHalt$7(MediaPlayer.java:2557)
          at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
          at java.security.AccessController.doPrivileged(Native Method)
          at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
          at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
          at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
          at com.sun.glass.ui.gtk.GtkApplication.lambda$null$5(GtkApplication.java:139)
          at java.lang.Thread.run(Thread.java:745)

      See more on this StackOverflow post: https://stackoverflow.com/questions/41842315/issue-when-creating-lots-of-mediaplayers


      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      MediaException: PLAYBACK_HALTED : Could not open audio device for playback.
          at javafx.scene.media.MediaException.haltException(MediaException.java:150)
          at javafx.scene.media.MediaPlayer$_PlayerStateListener.lambda$onHalt$7(MediaPlayer.java:2557)
          at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
          at java.security.AccessController.doPrivileged(Native Method)
          at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
          at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
          at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
          at com.sun.glass.ui.gtk.GtkApplication.lambda$null$5(GtkApplication.java:139)
          at java.lang.Thread.run(Thread.java:745)

      REPRODUCIBILITY :
      This bug can be reproduced often.

      CUSTOMER SUBMITTED WORKAROUND :
      I found a workaround by remove the audio from the file. This will not allocate any OS audio resources. This actually works better than muting the file, but it's still worth reporting this bug.

      ffmpeg -i [in-file] -c:v copy -an [outfile].mp4

            almatvee Alexander Matveev
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: