Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
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 2434 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?



my favorite OS:
Java 1.5 -> 1.4 converter:
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 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


Pages: [1]
  ignore  |  Print  

EgonOlsen (73 views)
2018-06-10 19:43:48

EgonOlsen (54 views)
2018-06-10 19:43:44

EgonOlsen (73 views)
2018-06-10 19:43:20

DesertCoockie (253 views)
2018-05-13 18:23:11

nelsongames (154 views)
2018-04-24 18:15:36

nelsongames (153 views)
2018-04-24 18:14:32

ivj94 (895 views)
2018-03-24 14:47:39

ivj94 (156 views)
2018-03-24 14:46:31

ivj94 (807 views)
2018-03-24 14:43:53

Solater (171 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!