java don't outputs sound to pulse audio by default

Bug #1980601 reported by ilya paschuk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Raspbian
New
Undecided
Unassigned

Bug Description

package: openjdk-17-jre

steps to reproduce

write a clean raspberry pi os bullseye image
update all packages
install pulseaudio and openjdk-17-jre
use any java application which uses java sound api for playback
when playback is running, call pactl list sink-inputs

expected behavior:
sink input should be in the list

actual behavior:
nothing in the returned list

an other way to demonstrate this is to connect any bluetooth headphones and try to play sound from java

expected:
sound should go through the bluetooth device

actual:
sound go through the standard audio jack

it is not working because Java ignores pulse and sends it's output to alsa directly

possible fix:

append the following lines to /etc/java-17-openjdk/sound.properties

javax.sound.sampled.Clip=com.sun.media.sound.DirectAudioDeviceProvider
javax.sound.sampled.Port=com.sun.media.sound.PortMixerProvider
javax.sound.sampled.SourceDataLine=com.sun.media.sound.DirectAudioDeviceProvider
javax.sound.sampled.TargetDataLine=com.sun.media.sound.DirectAudioDeviceProvider

it fixes the problem, but I don't understand why

java 17 from the repository, raspberry pi os bullseye 64 bit, raspberry pi 4 model b

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.