RFC: Fix for exceptions thrown in PulseAudio backend (WAS: Re: PulseAudio capture issue)
Jon VanAlten
jon.vanalten at redhat.com
Mon Jul 12 08:19:23 PDT 2010
Hi Omair,
Thanks for taking a look.
----- "Omair Majid" <omajid at redhat.com> wrote:
> On 07/07/2010 10:37 AM, jon.vanalten at redhat.com wrote:
> > Hi,
> >
> > I've attached a patch that addresses the problems from this example,
> along with a few other tweaks. A more detailed description is on the
> bugzilla. Comments? OK to commit?
> >
> > thanks,
> >
> > jon
>
>
> The patch looks good to me. Please go ahead and commit.
Done. http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=e35661d7528d
>
> Cheers,
> Omair
>
> >
> >
> > ----- "jon vanalten"<jon.vanalten at redhat.com> wrote:
> >
> >> Confirmed.
> >>
> >> $java -version
> >> java version "1.6.0_18"
> >> OpenJDK Runtime Environment (IcedTea6 1.8)
> >> (fedora-39.b18.fc12-x86_64)
> >> OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)
> >>
> >> If com.sun.media.sound provider is specified in sound.properties,
> this
> >> example works fine. If org.classpath.icedtea.pulseaudio provider
> is
> >> used, exceptions abound. Fails at different points, giving
> different
> >> exceptions, depending on the output (WAV/AU/etc) chosen.
> >>
> >> I went ahead and opened a bug against this.
> >>
> >> http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=517
> >>
> >> cheers,
> >>
> >> jon
> >>
> >> ----- "Andrew John Hughes"<ahughes at redhat.com> wrote:
> >>
> >>> Forwarding this to the IcedTea discussion list distro-pkg-dev;
> the
> >>> PulseAudio provider is (AFAIK) unique to IcedTea, so the tests
> with
> >>> 'java-6-sun' (which I presume is the proprietary Oracle JDK) will
> >> be
> >>> using a completely different provider.
> >>>
> >>> ---------- Forwarded message ----------
> >>> From: August Sodora<augsod at gmail.com>
> >>> Date: 5 July 2010 21:46
> >>> Subject: PulseAudio capture issue
> >>> To: jdk6-dev at openjdk.java.net
> >>>
> >>>
> >>> Hello all,
> >>> I've been attempting to write a simple program to capture audio
> >> from
> >>> the microphone and found a piece of sample code that seemed to
> >>> demonstrate the basic idea but also possibly indicates a bug in
> the
> >>> openjdk implementation of the pulse interface. Running the
> example
> >>> with java-6-openjdk produces an exception when the TargetDataLine
> >> is
> >>> closed but it runs successfully with java-6-sun. The exception is
> >>> reproduced below:
> >>> java.lang.IllegalStateException: Line cant be closed if it isnt
> >> open
> >>> at
> >>>
> >>
> org.classpath.icedtea.pulseaudio.PulseAudioTargetDataLine.close(PulseAudioTargetDataLine.java:84)
> >>> at
> >>>
> >>
> javax.sound.sampled.AudioInputStream$TargetDataLineInputStream.close(AudioInputStream.java:484)
> >>> at
> >>>
> >>
> javax.sound.sampled.AudioInputStream.close(AudioInputStream.java:389)
> >>> at
> >>>
> >>
> java.io.SequenceInputStream.nextStream(SequenceInputStream.java:106)
> >>> at java.io.SequenceInputStream.read(SequenceInputStream.java:210)
> >>> at java.io.SequenceInputStream.read(SequenceInputStream.java:211)
> >>> at java.io.InputStream.read(InputStream.java:102)
> >>> at
> >>>
> >>
> com.sun.media.sound.WaveFileWriter.writeWaveFile(WaveFileWriter.java:249)
> >>> at
> >> com.sun.media.sound.WaveFileWriter.write(WaveFileWriter.java:147)
> >>> at javax.sound.sampled.AudioSystem.write(AudioSystem.java:1354)
> >>> at AudioRecorder02$CaptureThread.run(AudioRecorder02.java:221)
> >>> And the example source can be found at
> >>>
> >>
> http://www.developer.com/java/other/article.php/2105421/Java-Sound-Capturing-Microphone-Data-into-an-Audio-File.htm#Complete
> >>> Program Listings
> >>> uname -a
> >>> Linux ubuntu 2.6.32-23-generic #37-Ubuntu SMP Fri Jun 11 08:03:28
> >> UTC
> >>> 2010 x86_64 GNU/Linux
> >>> Steps to reproduce:
> >>> 1. Copy the program listing into a file name
> AudioRecorder02.java
> >>> 2. javac AudioRecorder02.java
> >>> 3. sudo update-java-alternatives -s java-6-openjdk
> >>> 4. java AudioRecorder02
> >>> 5. Select "Capture" followed by "Stop"
> >>> 6. The above exception will be produced
> >>> If in step 3, one replaces java-6-openjdk with java-6-sun, the
> >>> program
> >>> runs successfully.
> >>> I'd be interested in investigating this further if that would be
> >>> useful.
> >>> Augie
> >>>
> >>>
> >>> --
> >>> Andrew :-)
> >>>
> >>> Free Java Software Engineer
> >>> Red Hat, Inc. (http://www.redhat.com)
> >>>
> >>> Support Free Java!
> >>> Contribute to GNU Classpath and the OpenJDK
> >>> http://www.gnu.org/software/classpath
> >>> http://openjdk.java.net
> >>>
> >>> PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
> >>> Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8
More information about the distro-pkg-dev
mailing list