From klausj at phonetik.uni-muenchen.de Thu Jan 3 07:18:53 2008 From: klausj at phonetik.uni-muenchen.de (Klaus Jaensch) Date: Thu, 3 Jan 2008 16:18:53 +0100 (CET) Subject: DirectSound multi-channel recording In-Reply-To: <47024031.1060407@bome.com> References: <47024031.1060407@bome.com> Message-ID: Hi Florian, Happy New Year to all ! > Hi Klaus, > > when I implemented Java Sound's DirectSound implementation, the > DirectSound specs stated (and I could verify by way of tests) > that requesting more than 16-bits or more than 2 channels would > just "expand" the soundcard's stereo, 16-bit signal to the > required format. So you could get 8 channels with 32-bits, but it > was just 4 times the stereo signal, and the 32-bits was just > extrapolated from the original 16-bits signal. > > That's why it was limited to maximum of 2 channels and 16 bits, > to not wrongly provide a line with e.g. 24 bits, where the lower > 8 bits are just extrapolated. > Yes, I understand. No good idea of the DirectSound programmers. > Further, using multi channel will raise the problem "which > channels?", that's why we need an additional parameter to specify > a channel mask. > The MS docs gives a good introduction: > http://www.microsoft.com/whdc/device/audio/multichaud.mspx > > Now, AudioFormat.properties are the intended way of specifying a > channel mask, and "validBitsPerSample", and so on. However, when > defining AudioFormat.properties, we must make sure that they are > usable in the same way on Linux, Solaris, possibly MacOS. > > But the main, first problem remains how to prevent DirectSound > from emulating multi-channel/high resolution audio. Java Sound > must never wrongly pretend a certain quality... > For my tests I used a soundcard to connect 8-channels to an digital mixing console, so there were no particular assignments to the channels. Maybe the channel masking/mapping can be done in a further step. I see that the return values of method DataLine.Info.isFormatSupported(AudioFormat format) should not be changed. But maybe DataLine.Info should provide the information that the line possibly has more format/channel capabilities, e.g. with a method: boolean isPossiblySupportingOtherFormats(). The DirectSound implentation should return true, while another implementation (ALSA ?) which definitely knows about the device capabilities could return false. Then if the DataLine.open(AudioFormat format) method would not check the AudioFormat by calling DataLine.Info.isFormatSupported(AudioFormat format) it would be possible to record multi-channel without pretending non-existing quality or channels. To keep compatibility entirely, unchecked opening of the line could be signalized by an AudioFormat property (e.g. FORCE_UNCHECKED_OPEN). Regards, Klaus > Regards, > Florian > > > On 9/24/2007 11:22 AM, Klaus Jaensch wrote: > > Hello, > > > > I would like to record multi-channel 24-bit audio with the > > DirectSound JavaSound implementation under Windows. > > > > But the audio formats defined in > > > > j2se/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp > > > > are limited to 8/16bit and 1 or 2 channels. > > > > I would like to discuss how this limitation could be removed. > > > > For testing multichannel capabilities of JavaSound I extended > > channelsArray up to 8 channels and bitsArray for > > 24/32 bit recordings, then compiled dsound.dll and tested recording. > > It worked fine, so it's a pity that the recording formats are restricted > > to basic formats. > > > > The question is how to make multi-channel possible without changing > > the supported defaults formats, which can be queried by > > isFormatSupported(AudioFormat). > > > > Regards, > > > > Klaus > > > > ------------------------------------------ > > Klaus Jaensch > > Muenchen > > Germany > > > > Institut fuer Phonetik und Sprachverarbeitung > > Schellingstr.3/II > > 80799 M?nchen > > > > EMail: klausj at phonetik.uni-muenchen.de > > -- > Florian Bomers > Bome Software > > ------------------------------------------------------- > Music Software, Development Tools: http://www.bome.com > Java Sound extensions, plugins: http://www.tritonus.org > The Java Sound Resources: http://www.jsresources.org > ------------------------------------------------------- > Please quote this email in your reply. Thanks! > ------------------------------------------ Klaus Jaensch Muenchen Germany Institut fuer Phonetik und Sprachverarbeitung Schellingstr.3/II 80799 M?nchen Phone (Work): +49-(0)89-2180-2806 Fax: +49-(0)89-2180-5790 EMail: klausj at phonetik.uni-muenchen.de From david_w_32903 at yahoo.com Wed Jan 9 04:19:06 2008 From: david_w_32903 at yahoo.com (David Welch) Date: Wed, 9 Jan 2008 04:19:06 -0800 (PST) Subject: Errors in MixerMidiChannel.C Message-ID: <549615.38997.qm@web37909.mail.mud.yahoo.com> I have identified a pattern of errors in MixerMiddiChannel.C, but I lack the resources to test my proposed changes. The errors prevent programChange() from working. There may well be more errors! ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: DifMixerMidiChannel.txt Url: http://mail.openjdk.java.net/pipermail/sound-dev/attachments/20080109/cd4d1340/attachment.txt -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: NewMixerMidiChannel.txt Url: http://mail.openjdk.java.net/pipermail/sound-dev/attachments/20080109/cd4d1340/attachment-0001.txt From Andrey.Pikalev at Sun.COM Wed Jan 9 05:49:56 2008 From: Andrey.Pikalev at Sun.COM (Andrey Pikalev) Date: Wed, 09 Jan 2008 16:49:56 +0300 Subject: Errors in MixerMidiChannel.C In-Reply-To: <549615.38997.qm@web37909.mail.mud.yahoo.com> References: <549615.38997.qm@web37909.mail.mud.yahoo.com> Message-ID: <4784D104.3060801@sun.com> Hi David, We can't accept your contribution until you sign Sun Contributor Agreement. You can do this following the guidelines at http://openjdk.java.net/contribute/ Thanks, Andrey. David Welch wrote: > I have identified a pattern of errors in > MixerMiddiChannel.C, but I lack the resources to test > my proposed changes. The errors prevent > programChange() from working. There may well be more errors! > > > ____________________________________________________________________________________ > Never miss a thing. Make Yahoo your home page. > http://www.yahoo.com/r/hs > From Tim.Bell at Sun.COM Wed Jan 9 13:47:52 2008 From: Tim.Bell at Sun.COM (Tim Bell) Date: Wed, 09 Jan 2008 13:47:52 -0800 Subject: Errors in MixerMidiChannel.C Message-ID: <47854108.70400@sun.com> Hello This source file is from the closed portion of the JDK[1], which means the license terms are not compatible with this forum. I removed it from this thread. If you have agreed to the JRL (Java Research License)[2] you may continue this discussion with other JRL researchers over here: https://jdk-collaboration.dev.java.net/servlets/ForumMessageList?forumID=1463 If you do not yet have the 'jdk.Researcher' role assigned, please read the jdk.Researcher terms here: https://jdk.dev.java.net/terms.html Then go to this web page: https://jdk.dev.java.net/servlets/ProjectMembershipRequest and request the jdk.Researcher role to gain access to the jdk-collaboration.dev.java.net forum. We all hope to remove the closed areas of the JDK someday, but for the moment these are the rules we must operate under. Refer to: [1] https://jdk7.dev.java.net [2] http://java.net/jrl.html Best regards - Tim Bell mailman administrator, openjdk.java.net From david_w_32903 at yahoo.com Mon Jan 21 01:00:00 2008 From: david_w_32903 at yahoo.com (David Welch) Date: Mon, 21 Jan 2008 01:00:00 -0800 (PST) Subject: MixerMidiChannel.c superceded by HAE.CPP Message-ID: <790520.66254.qm@web37912.mail.mud.yahoo.com> Well, I have egg on my face! The code I was looking at has been replaced by HAE.CPP. The errors I encountered in JDK 1.5 have been fixed in this new package. ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ