United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4780440 : REGRESSION: loud clicks during playback

Details
Type:
Bug
Submit Date:
2002-11-18
Status:
Closed
Updated Date:
2003-08-02
Project Name:
JDK
Resolved Date:
2003-02-19
Component:
client-libs
OS:
windows_2000
Sub-Component:
javax.sound
CPU:
x86
Priority:
P2
Resolution:
Fixed
Affected Versions:
1.4.1
Fixed Versions:
1.4.2 (b17)

Related Reports
Backport:

Sub Tasks

Description

Name: jl125535			Date: 11/18/2002


FULL PRODUCT VERSION :
java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)

java version "1.4.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_01-b03)
Java HotSpot(TM) Client VM (build 1.4.0_01-b03, mixed mode)

The behaviour is virtually identical in 1.4.1_01.  The 16bit sounds sound slightly different ?!?  But the click still occurs on 8bit. 

FULL OPERATING SYSTEM VERSION :
Microsoft Windows 2000 [Version 5.00.2195]


A DESCRIPTION OF THE PROBLEM :
We are getting louds clicks when playing 8-bit mono WAV
files through the javax.media.sound.sampled API.  When
these files are converted to 16-bit mono WAV files, the
clicking problems disappear.

A scan through the bug database reveals bug 4266439 which
was previously fixed 1999-11-10.  What we are seeing
appears to exactly match the symptoms of this bug - is it
possible that it has re-appeared?

We are often looping very short WAV files, and this bug can
therefore be quite apparent.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Play very short 8-bit WAV file (can provide if
necessary).  Loop Repeatedly.  Listen to result.

EXPECTED VERSUS ACTUAL BEHAVIOR :
Sound should play acceptably.  Instead, loud clicks / pops
are heard as the sound loops.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.net.URL;
import java.io.*;

public class AudioTest
{
    public static void main(String[] args)
    {
        new AudioTest();
        System.exit(0);
    }

    public AudioTest()
    {
        try
        {
            Clip theClip = (Clip) AudioSystem.getLine(
                new Line.Info(Clip.class));
            AudioInputStream ais1 = 
                AudioSystem.getAudioInputStream(
                    new File("test8bitmono.wav"));
            AudioInputStream ais2 = 
                AudioSystem.getAudioInputStream(
                    new File("test8bitstereo.wav"));
            AudioInputStream ais3 = 
                AudioSystem.getAudioInputStream(
                    new File("test16bitmono.wav"));
            AudioInputStream ais4 = 
                AudioSystem.getAudioInputStream(
                    new File("test16bitstereo.wav"));
            AudioInputStream[] aiss = new AudioInputStream[4];
            aiss[0] = ais1;
            aiss[1] = ais2;
            aiss[2] = ais3;
            aiss[3] = ais4;

            for (int i=0; i < aiss.length; i++)
            {
                AudioInputStream ais = aiss[i];
                System.out.println("ais = " + ais.getFormat());
                theClip.open(ais);
                theClip.loop(Clip.LOOP_CONTINUOUSLY);

                try
                {
                    Object o = new Object();
                    synchronized(o)
                    {
                        o.wait(2000);
                    }
                }
                catch (InterruptedException iex)
                {
                }
                theClip.close();
            }
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }
}

---------- END SOURCE ----------

Release Regression From : 1.3.1
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.

(Review ID: 159396) 
======================================================================
Verified in Sol 9, RH8.0, win 2000 Professional SP3.

###@###.### 2003-03-03

                                    

Comments
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
mantis-beta
tiger

FIXED IN:
mantis-beta
tiger

INTEGRATED IN:
mantis-b17
mantis-beta
tiger
tiger-b14

VERIFIED IN:
mantis-beta


                                     
2004-06-14
EVALUATION


###@###.### 2002-11-21
	Cannot reproduce the regression, i.e. the clicks are there, but continually from 1.3.0 to 1.4.2beta. Due to the new resampler in 1.4.1 and above, the clicks have a different timbre now (not as much "treble", i.e. aliasing). Contacted the submitter to see if he cannot hear clicks with 1.3.0, 1.3.1, or 1.4.0.

	However, since there are indeed clicks, this bug is valid as a non-regression bug. Changed the synopsis (was: "REGRESSION: Bug 4266439 (loud clicks on 8-bit sound) has returned"). After mantis code freeze, commit to tiger.


###@###.### 2003-01-29
	I can reproduce the regression with 8000Hz files: with 1.3.1 and 1.4.0 it plays back fine, but with 1.4.1 and later there are regular pops audible in the sound. This should be fixed asap! (changed synopsis from "loud clicks when looping short 8-bit clips").
                                     
2004-06-11
PUBLIC COMMENTS

REGRESSION: Bug 4266439 (loud clicks on 8-bit sound) has returned
                                     
2004-06-10
WORK AROUND


###@###.### 2002-11-21
	Before opening the clip with such very small loops, convert it to 16 bit.
                                     
2002-11-21



Hardware and Software, Engineered to Work Together