Unable to build Client/Server variant for OpenJDK-11 on ARMv7-A
John Cummings
JohnC at synel-americas.com
Thu Oct 21 22:31:44 UTC 2021
Thank you again, that solved that problem, and now another has arose.
It can run and compile on our embedded system, but sound no longer functions and I'm now at the point where I need to ask for help again. Running the same code on Java 8 sound works with no errors, running it on the newly built 11 crashes every time. It doesn't seem to be able to recognize the mixer properly in 11 and I have not been able to figure out why and whether it's a problem with my build, or a bug, or some other configuration I've still been missing.
I've tried using client, server, and zero variants, with and without fastdebug enabled, I've also tried using two different toolchains, and even got a build on the older mercurial tree working and tried that as well. I've also tried multiple different sound files, and they all have the same error. I've also tried setting the sound.properties to:
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
The only major difference I've noticed between my build of 11, and the working build of 8, is 8 also has a libjsoundalsa.so, and my 11 build does not.
Here's the output of java8 version and java11 version too:
# java8 -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) Client VM (build 25.144-b01, mixed mode)
[java -version
openjdk version "11.0.14-internal" 2022-01-18
OpenJDK Runtime Environment (build 11.0.14-internal+0-adhoc.johnc.jdk11u-dev)
OpenJDK Client VM (build 11.0.14-internal+0-adhoc.johnc.jdk11u-dev, mixed mode)
The app I've been collecting information with just gets the mixers, and any data lines and prints their values, and then plays a .wav file using SourceDataLine, and again with Clip. I use -Daudio.mixer="M1 PCM [default]" because in the Java 11 build, setting it to null for the default just returns null, and it doesn't even return the "Found Audio Mixer" line. If it helps, here is the java itself: https://pastebin.com/CCfUWTTf
The output is as follows:
Java 8 output
# java8 -Daudio.mixer="M1 PCM [default]" AudioFormats SuccessBuzzer.wav
Found audio mixer: M1 PCM [default]
Supported Lines of default mixer (M1 PCM [default]):
Mixer ClassName: com.sun.media.sound.DirectAudioDeviceProvider$DirectAudioDeviceInfo
Mixer Desc: Direct Audio Device: sun7i PCM, M1 PCM, sun7i PCM
Vendor: ALSA (http://www.alsa-project.org)
M1 PCM [default] --- interface SourceDataLine supporting 8 audio formats, and buffers of at least 32 bytes ----- com.sun.media.sound.DirectAudioDevice$DirectSDL at 873330
M1 PCM [default] --- interface Clip supporting 8 audio formats, and buffers of at least 32 bytes ----- com.sun.media.sound.DirectAudioDevice$DirectClip at 19d7047
com.sun.media.sound.DirectAudioDevice at 16ec8df --- interface TargetDataLine supporting 8 audio formats, and buffers of at least 32 bytes ----- com.sun.media.sound.DirectAudioDevice$DirectTDL at ec7777
Mixer Num Source Info Lines: 2
Mixer Num Target Info Lines: 1
interface SourceDataLine supporting 8 audio formats, and buffers of at least 32 bytes
max buffer size: -1
min buffer size: 32
Supported Audio formats:
PCM_SIGNED unknown sample rate, 16 bit, mono, 2 bytes/frame, little-endian
encoding: PCM_SIGNED
channels: 1
frame size [bytes]: 2
sample size [bit]: 16
big endian: false
line supported: true
PCM_SIGNED unknown sample rate, 16 bit, mono, 2 bytes/frame, big-endian
encoding: PCM_SIGNED
channels: 1
frame size [bytes]: 2
sample size [bit]: 16
big endian: true
line supported: true
PCM_SIGNED unknown sample rate, 16 bit, stereo, 4 bytes/frame, little-endian
encoding: PCM_SIGNED
channels: 2
frame size [bytes]: 4
sample size [bit]: 16
big endian: false
line supported: true
PCM_SIGNED unknown sample rate, 16 bit, stereo, 4 bytes/frame, big-endian
encoding: PCM_SIGNED
channels: 2
frame size [bytes]: 4
sample size [bit]: 16
big endian: true
line supported: true
PCM_SIGNED unknown sample rate, 8 bit, mono, 1 bytes/frame,
encoding: PCM_SIGNED
channels: 1
frame size [bytes]: 1
sample size [bit]: 8
big endian: false
line supported: true
PCM_UNSIGNED unknown sample rate, 8 bit, mono, 1 bytes/frame,
encoding: PCM_UNSIGNED
channels: 1
frame size [bytes]: 1
sample size [bit]: 8
big endian: false
line supported: true
PCM_SIGNED unknown sample rate, 8 bit, stereo, 2 bytes/frame,
encoding: PCM_SIGNED
channels: 2
frame size [bytes]: 2
sample size [bit]: 8
big endian: false
line supported: true
PCM_UNSIGNED unknown sample rate, 8 bit, stereo, 2 bytes/frame,
encoding: PCM_UNSIGNED
channels: 2
frame size [bytes]: 2
sample size [bit]: 8
big endian: false
line supported: true
interface Clip supporting 8 audio formats, and buffers of at least 32 bytes
Playing SuccessBuzzer.wav
Source Data Lines: PCM_SIGNED 22050.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian
encoding: PCM_SIGNED
channels: 2
frame rate [1/s]: 22050.0
frame size [bytes]: 4
sample rate [1/s]: 22050.0
sample size [bit]: 16
big endian: false
line supported: true
Clip Data Lines: PCM_SIGNED 22050.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian
encoding: PCM_SIGNED
channels: 2
frame rate [1/s]: 22050.0
frame size [bytes]: 4
sample rate [1/s]: 22050.0
sample size [bit]: 16
big endian: false
line supported: true
Target Data Lines: PCM_SIGNED 22050.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian
encoding: PCM_SIGNED
channels: 2
frame rate [1/s]: 22050.0
frame size [bytes]: 4
sample rate [1/s]: 22050.0
sample size [bit]: 16
big endian: false
line supported: true
Java 11 Output
# java -Daudio.mixer="M1 PCM [default]" AudioFor
mats SuccessBuzzer.wav# java -Daudio.mixer="M1 PCM [default]" AudioFor
mats SuccessBuzzer.wav
Found audio mixer: M1 PCM [default]
Supported Lines of default mixer (M1 PCM [default]):
Mixer ClassName: com.sun.media.sound.DirectAudioDeviceProvider$DirectAudioDeviceInfo
Mixer Desc: Direct Audio Device: sun7i PCM, M1 PCM, sun7i PCM
Vendor: ALSA (http://www.alsa-project.org)
Mixer Has 0 Source Info Lines:
Mixer Has 0 Target Info Lines:
Playing SuccessBuzzer.wav
Source Data Lines: PCM_SIGNED 22050.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian
encoding: PCM_SIGNED
channels: 2
frame rate [1/s]: 22050.0
frame size [bytes]: 4
sample rate [1/s]: 22050.0
sample size [bit]: 16
big endian: false
line supported: false
Clip Data Lines: PCM_SIGNED 22050.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian
encoding: PCM_SIGNED
channels: 2
frame rate [1/s]: 22050.0
frame size [bytes]: 4
sample rate [1/s]: 22050.0
sample size [bit]: 16
big endian: false
line supported: false
Target Data Lines: PCM_SIGNED 22050.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian
encoding: PCM_SIGNED
channels: 2
frame rate [1/s]: 22050.0
frame size [bytes]: 4
sample rate [1/s]: 22050.0
sample size [bit]: 16
big endian: false
line supported: false
java.lang.IllegalArgumentException: No line matching interface SourceDataLine supporting format PCM_SIGNED 22050.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian is supported.
at java.desktop/javax.sound.sampled.AudioSystem.getLine(AudioSystem.java:425)
at AudioFormats.main(AudioFormats.java:77)
java.lang.IllegalArgumentException: No line matching interface Clip supporting format PCM_SIGNED unknown sample rate, 16 bit, stereo, 4 bytes/frame, big-endian is supported.
at java.desktop/javax.sound.sampled.AudioSystem.getLine(AudioSystem.java:425)
at java.desktop/javax.sound.sampled.AudioSystem.getClip(AudioSystem.java:461)
at AudioFormats.main(AudioFormats.java:94)
On another application I've also had an error pointing to the DirectAudioDevice.java that also plays the same .wav file.
Caused by: java.lang.IllegalArgumentException: Line unsupported: interface SourceDataLine
at java.desktop/com.sun.media.sound.DirectAudioDevice.getLine(DirectAudioDevice.java:175)
at java.desktop/javax.sound.sampled.AudioSystem.getSourceDataLine(AudioSystem.java:572)
Here's aplay output for that file too in case that helps:
#aplay -vvv SuccessBuzzer.wav
Playing WAVE 'SuccessBuzzer.wav' : Signed 16 bit Little Endian, Rate 22050 Hz, Stereo
Hardware PCM card 0 'audiocodec' device 0 subdevice 0
Its setup is:
stream : PLAYBACK
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 22050
exact rate : 22050 (22050/1)
msbits : 16
buffer_size : 8192
period_size : 2048
period_time : 92879
tstamp_mode : NONE
tstamp_type : MONOTONIC
period_step : 1
avail_min : 2048
period_event : 0
start_threshold : 8192
stop_threshold : 8192
silence_threshold: 0
silence_size : 0
boundary : 1073741824
appl_ptr : 0
hw_ptr : 0
Max peak (4096 samples): 0x0000095f ## 7%
Max peak (4096 samples): 0x00001a62 ##### 20%
Max peak (4096 samples): 0x00001b1c ##### 21%
Max peak (4096 samples): 0x0000182c #### 18%
Max peak (4096 samples): 0x000005de # 4%
Max peak (4096 samples): 0x00000451 # 3%
Max peak (4096 samples): 0x000001d5 # 1%
________________________________
From: Aleksey Shipilev <shade at redhat.com>
Sent: Thursday, October 14, 2021 6:08 AM
To: John Cummings <JohnC at synel-americas.com>; David Holmes <david.holmes at oracle.com>; build-dev at openjdk.java.net <build-dev at openjdk.java.net>
Subject: Re: Unable to build Client/Server variant for OpenJDK-11 on ARMv7-A
On 10/13/21 7:20 PM, John Cummings wrote:
> Thank you both for the responses!
>
> I am now using the https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fopenjdk%2Fjdk11u-dev%2F&data=04%7C01%7Cjohnc%40synel-americas.com%7C6679a2c2c1de4f4bd1df08d98f13b673%7Cce62291737b444dcb33e6a5ae5e16b70%7C0%7C0%7C637698137114616983%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=1oOGb5gpta92exNuaG0f67TYyqAC4cHuuqIju8Kytw0%3D&reserved=0 <https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fopenjdk%2Fjdk11u-dev%2F&data=04%7C01%7Cjohnc%40synel-americas.com%7C6679a2c2c1de4f4bd1df08d98f13b673%7Cce62291737b444dcb33e6a5ae5e16b70%7C0%7C0%7C637698137114616983%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=1oOGb5gpta92exNuaG0f67TYyqAC4cHuuqIju8Kytw0%3D&reserved=0>
> tree that you linked and I have trimmed down my cxxflags and cflags to just -O2 and -pipe, and added
> --with-debug-level=fastdebug. I've tried with zero build, which still works, but server, client
> still crash immediately, but now they also give me an assert internal error:
>
> Server:
>
> #
> # To suppress the following error report, specify this argument
> # after -XX: or in .hotspotrc: SuppressErrorAt=/assembler_arm.hpp:240
> #
> # A fatal error has been detected by the Java Runtime Environment:
> #
> # Internal Error
> (/home/johnc/Documents/openjdk/jdk11u-dev/src/hotspot/cpu/arm/assembler_arm.hpp:240), pid=1467, tid=1468
> # assert(_disp == 0 && (_shift_imm >> 5) == 0) failed: encoding constraint
> #
> # JRE version: (11.0.14) (fastdebug build )
> # Java VM: OpenJDK Server VM (fastdebug 11.0.14-internal+0-adhoc.johnc.jdk11u-dev, mixed mode,
> serial gc, linux-)
> # Core dump will be written. Default location: /usr/lib/jvm/jdk11/server/jdk/bin/core
OK, good. This indicates that ARM backend had tried to encode some instruction that is beyond ARM
spec. It makes sense that release builds SIGILL when than happens: the instruction is garbage.
The next step is to look into hs_err and see the call stack for that assert, which would drive you
to Hotspot code. From the code inspection, that is likely to be assembler_arm.hpp:encoding2(), which
is called from pld/pldw instructions...
It looks suspiciously like:
https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugs.openjdk.java.net%2Fbrowse%2FJDK-8222825&data=04%7C01%7Cjohnc%40synel-americas.com%7C6679a2c2c1de4f4bd1df08d98f13b673%7Cce62291737b444dcb33e6a5ae5e16b70%7C0%7C0%7C637698137114616983%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=fj4NOYRZSrRqjaufbwF6l58j3xxjt9M8VvCuTKs%2BFjw%3D&reserved=0
...so maybe you want to try to apply this patch and build again:
https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcr.openjdk.java.net%2F~bulasevich%2F8222825%2Fwebrev.00.jdk11%2F&data=04%7C01%7Cjohnc%40synel-americas.com%7C6679a2c2c1de4f4bd1df08d98f13b673%7Cce62291737b444dcb33e6a5ae5e16b70%7C0%7C0%7C637698137114616983%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ilicvIKCCyC2tEhQsr4yrxtWjuKH6pU%2FDv1QaI3e30I%3D&reserved=0
--
Thanks,
-Aleksey
The information contained in this message may be privileged, confidential, and protected from disclosure. If the reader of this message is not the intended recipient, or any employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you.
More information about the build-dev
mailing list