From owner-freebsd-java Mon Jun 19 14:44:11 2000 Delivered-To: freebsd-java@freebsd.org Received: from ares.trc.adelaide.edu.au (ares.trc.adelaide.edu.au [129.127.246.5]) by hub.freebsd.org (Postfix) with ESMTP id 4661537B686 for ; Mon, 19 Jun 2000 14:44:03 -0700 (PDT) (envelope-from glewis@ares.trc.adelaide.edu.au) Received: (from glewis@localhost) by ares.trc.adelaide.edu.au (8.9.3/8.9.3) id HAA78923; Tue, 20 Jun 2000 07:13:45 +0930 (CST) (envelope-from glewis) From: Greg Lewis Message-Id: <200006192143.HAA78923@ares.trc.adelaide.edu.au> Subject: Re: Native JDK sound In-Reply-To: <394E8AD9.25790642@ox.com> from Rob Furphy at "Jun 19, 2000 05:04:25 pm" To: Rob Furphy Date: Tue, 20 Jun 2000 07:13:45 +0930 (CST) Cc: "freebsd-java@FreeBSD.ORG" X-Mailer: ELM [version 2.4ME+ PL70 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Rob Furphy wrote: > Thought I'd share what I've found in case anyone is also looking into > this. I'm not looking into it, but I'm very interested :) > I have tested the Java2D demo in the JDK build under every patchset back > to patchset 5(had to rebuild that one). > The good news is that under patchset 5 the sound does indeed > work(mostly). The bad news is that patchset 6 > and subsequent patchsets do not have working sound (But we knew that). But I didn't :). My reading of the reports I received at the time was that it stopped working between 6 and 7, not 5 and 6. That actually makes quite a big difference. > There seems to be a problem related to the HaeDevice in sun.audio. When > attempting to instanciate a > HaeMixer object an HaeException is thrown. > > I have tracked this down to the file HAE_API_freebsd.c in > src/freebsd/native/sun/audio > > The versions of this file are very different between patchset5 (which > sorta worked) and subsequent > patchsets (which don't work). Looks like the file was changed to use > "/dev/audio" instead of "/dev/dsp" > and a host of other changes to support this fundamental change. Perhaps > whoever made these changes > could look back and fix the file or offer suggestions. Ok, the deal is that in patchset 5 (and 4) I was using a slightly modified version of the Linux sound source code (just to get things to build with the libaudio enabled). Patchset 6 marks the merge with the porting team repository. Since sound worked in 1.1.8, I'd assumed that what was in the repository was better than the hack I was doing and stuck with that. Note that I had (have) no working sound card to check this with, and hadn't received any reports on it. > For the patchset 9 sound the call to ioctl() in the function > HAE_Setup(void) in the above mentioned file is > returning an error (errno 22 - "Invalid Argument") and this becomes the > exception which is thrown. > Also, the sound device is open()ed as read only, is this right? I hope > to look at this again soon, but I wanted to report in. > > Any hints or suggestions would be appreciated. BTW the audio plays > better in the native JDK > than through the Linux emulation. Well, my suggestion would be to take the code from patchset 5, and merge in anything from the version in patchset 9 that looks appropriate :). Test and send patches :). > PS. > For what it's worth here's something fun to do. Save a copy of your > patchset 9 version of the above mentioned > file. Place a copy of the patchset 5 version of the file into your > patchset 9. Rebuild the (9)JDK and install. > Sound will now work in the (9)JDK, but with some gotchas. Only ".mid" > and ".rmf" files play correctly, > ".au", ".wav" and ".aiff" files do not. Try out the Java2D demo under > the "Mix" tab. YMMV Cool! I have a sound card now, although I'm not sure if its working or not. I'll try and determine if it is and test this out. Anyone have a pointer to some setting up and testing docs for sound cards? Great work Rob! -- Greg Lewis glewis@trc.adelaide.edu.au Computing Officer +61 8 8303 5083 Teletraffic Research Centre To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message