Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (590)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  javax.sound.sampled and ALSA  (Read 1695 times)
0 Members and 1 Guest are viewing this topic.
Offline TheBohemian

Junior Devvie




Java will rule them all!


« Posted 2004-01-28 21:36:42 »

Does anyone know how to set-up Sun reference implementation for Linux to find non-hardware mixer devices? That's because I am using the nvidia soundstorm alsa driver which is missing support for hardware mixing. I have configured alsa's 'default' device to use the dmix plugin which allows multiple applications to use the same mixer simultanously if they request the default device instead of a hardware device (aka plughw or hw).

For ESoundD, XMMS etc. this works really nice but now Java does the showstopper: If Java acquires the hw device all other applications block Sad

Does anyone know a solution or workaround for this?

cya

TheBohemian

---------------------------------------
my favorite OS: http://jnode.sf.net
Java 1.5 -> 1.4 converter: http://retroweaver.sf.net
Offline BorgKnight

Senior Newbie




Space whales rock!


« Reply #1 - Posted 2004-09-14 00:09:09 »

I've got a similar problem. I'm running ALSA drivers, and I *think* I've got the dmix plugin enabled. Now,from what I read, this allows Linux to use the famed DirectAudioDevices (i.e.: non-sucky JavaSound) as well as mixing multiple lines/channels together.

My game already sounds like a charm under Windows with DirectSound-implemented JS, using both Clips (in menus) and SourceDataLines (in game) playing multiple concurrent sounds, so it's not like I'm a total JavaSound noob.

I've got the following problems:

A - The same code that detects multiple/infinite channels for my sound card (mobo-nforce2) under WinXP detects only ONE such line under Linux. Using Mixer.getMaxLines(DataLine.Info). Assuming problem B doesnt exist (see below), this would theoretically allows me to only play one sound at a time. That ain't enough.

B - When my game does its first Clip.open(AudioInputStream ais), it throws a "javax.sound.sampled.LineUnavailableException: line with format PCM_SIGNED, 22050.0 Hz, 16 bit, stereo, little-endian, audio data not supported." Funny thing is I check the availability of my line and the mixer tells me I've got (only) one (see A), in the same format as my Clip object.

So my guess is dmix is not enabled correctly, which prevents my game from doing soft-level mixing and returning multiple/infinite channels to my code. Another process/app is somehow hijacking my only line, causing both problems to be sound showstoppers (I wish that was a pun).

Can somebody tell me if my above assumptions are correct ?? Are there people who have played *multiple*, *concurrent* sounds under Linux, on 1.4.2 or Tiger, using DirectAudioDevices (NOT the high-latency Java Sound soft mixer engine ! ) and lived to tell? If so, PLEASE reply to this thread, you've just become my new friend ! Wink

thanks
BK  

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

trollwarrior1 (29 views)
2014-11-22 12:13:56

xFryIx (71 views)
2014-11-13 12:34:49

digdugdiggy (50 views)
2014-11-12 21:11:50

digdugdiggy (44 views)
2014-11-12 21:10:15

digdugdiggy (38 views)
2014-11-12 21:09:33

kovacsa (62 views)
2014-11-07 19:57:14

TehJavaDev (67 views)
2014-11-03 22:04:50

BurntPizza (64 views)
2014-11-03 18:54:52

moogie (80 views)
2014-11-03 06:22:04

CopyableCougar4 (80 views)
2014-11-01 23:36:41
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!