Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (603)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2]
  ignore  |  Print  
  No sound under Linux + JRE 1.6 update 16  (Read 10755 times)
0 Members and 1 Guest are viewing this topic.
Offline gouessej
« Reply #30 - Posted 2010-07-29 11:34:55 »

Ah, I see.
I'm thinking the best solution will be to try and create a SourceDataLine for each chosen Mixer, and check for compatibility based on static parameters that the user can change to fit their needs (things like range of sample-rates, required controls, etc).  If none of the available Mixers are able to meet those parameters, the thrown SoundSystemException should indicate what the specific problem was.  I'll start working on this concept when I get home this evening, and when its implemented, maybe I can have you beta-test it for me to make sure it works in your particular case.
It is a good idea, I agree with your conclusion. We should call Mixer.isLineSupported() with some very basic SourceDataLine instances using very common audio formats that should be supported even by the poorest implementation of Java Sound. Skipping explicitly the camera and JSAE in my case is still a useful step because when JSAE should not be used, isLineSupported returns true even though you use the audio format of a sample it is not able to play Sad

Offline paulscode

Senior Devvie


Medals: 12


Staff Sergeant


« Reply #31 - Posted 2010-07-29 19:17:33 »

isLineSupported returns true even though you use the audio format of a sample it is not able to play Sad
In this case, do you know if the exception is thrown before the start() method is called?  If it happens when the SourceDataLine/Clip is created or buffer is attached, it would be possible for me to create a test line to reveal the problem and handle it in my code.  But if it doesn't happen until start() is called (or if no exception is thrown at all), I'm not sure of a better workaround than the one you are using.

We love death.  The US loves life.  That is the difference between us.  -Osama bin Laden, mass murderer
Offline gouessej
« Reply #32 - Posted 2010-07-30 09:21:08 »

In this case, do you know if the exception is thrown before the start() method is called?  If it happens when the SourceDataLine/Clip is created or buffer is attached, it would be possible for me to create a test line to reveal the problem and handle it in my code.  But if it doesn't happen until start() is called (or if no exception is thrown at all), I'm not sure of a better workaround than the one you are using.
I remember that the attachment fails, it says "attachBuffer returns null" or something like that. I will send you the trace in 8 hours when I'm back home. I remember that there are already a lot of worrying messages displayed when creating a SoundSystem instance far before playing any sample.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline paulscode

Senior Devvie


Medals: 12


Staff Sergeant


« Reply #33 - Posted 2010-07-30 09:40:39 »

I remember that the attachment fails, it says "attachBuffer returns null" or something like that.
Excellent, then I should be able to test for the problem within the LibraryJavaSound plug-in, so you won't need that bug-fix any more.

We love death.  The US loves life.  That is the difference between us.  -Osama bin Laden, mass murderer
Offline gouessej
« Reply #34 - Posted 2010-07-30 10:56:42 »

Excellent, then I should be able to test for the problem within the LibraryJavaSound plug-in, so you won't need that bug-fix any more.
It is really fine but I will have to write a bug report concerning the fact that Java Sound Audio Engine tries to use my microphone instead of using my sound card with a small test case (get the mixer, get a clip from it, play a basic sound). Can you provide me a very basic AU file?

Offline gouessej
« Reply #35 - Posted 2010-07-30 17:30:08 »

The stack trace is below:
Quote
Error in class 'ChannelJava Sound'
    Unable to attach buffer to clip in method 'attachBuffer'
    ERROR MESSAGE:
        Audio Device Unavailable
    STACK TRACE:
        com.sun.media.sound.HeadspaceMixer.nResume(Native Method)
        com.sun.media.sound.HeadspaceMixer.implOpen(HeadspaceMixer.java:346)
        com.sun.media.sound.AbstractMixer.open(AbstractMixer.java:286)
        com.sun.media.sound.AbstractMixer.open(AbstractMixer.java:323)
        com.sun.media.sound.MixerClip.open(MixerClip.java:162)
        paulscode.sound.libraries.ChannelJavaSound.attachBuffer(ChannelJavaSound.java:276)
        paulscode.sound.libraries.SourceJavaSound.play(SourceJavaSound.java:298)
        paulscode.sound.Library.play(Library.java:587)
        paulscode.sound.Library.play(Library.java:556)
        paulscode.sound.SoundSystem.CommandPlay(SoundSystem.java:1892)
        paulscode.sound.SoundSystem.CommandQueue(SoundSystem.java:2388)
        paulscode.sound.CommandThread.run(CommandThread.java:121)

Offline paulscode

Senior Devvie


Medals: 12


Staff Sergeant


« Reply #36 - Posted 2010-07-30 19:00:06 »

Can you provide me a very basic AU file?
Here, I converted one of the test sounds I use a lot for testing purposes:
test.au

We love death.  The US loves life.  That is the difference between us.  -Osama bin Laden, mass murderer
Offline gouessej
« Reply #37 - Posted 2010-07-30 19:52:04 »

Here, I converted one of the test sounds I use a lot for testing purposes:
test.au
Thanks.

Offline gouessej
« Reply #38 - Posted 2010-08-08 12:26:06 »

I get this even though it works with my fix:
Quote
Error in class 'ChannelJava Sound'
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'     
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'     
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'     
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'     
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'     
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'     
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'     
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'     
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'     
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'     
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'     
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'     
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'     
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'     
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'     
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'     
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'     
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'     
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'     
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'     
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'     
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'     
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'     
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'
    Buffer null in method 'attachBuffer'
Error in class 'ChannelJava Sound'
    AudioFormat null in method 'resetStream'
Error in class 'ChannelJava Sound'
    AudioFormat null in method 'resetStream'
Error in class 'ChannelJava Sound'
    AudioFormat null in method 'resetStream'
Error in class 'ChannelJava Sound'
    AudioFormat null in method 'resetStream'
Error in class 'ChannelJava Sound'
    Pan control not supported
Error in class 'ChannelJava Sound'
    Sample rate control not supported

Offline paulscode

Senior Devvie


Medals: 12


Staff Sergeant


« Reply #39 - Posted 2010-08-08 23:55:18 »

The first message about sample rate isn't much of a problem (unless you want to change the pitch or use the new Doppler effect).

The second message is somewhat problematic - 3D sound will not really be "3D" without a Pan control (volume differences between left and right speaker).

The other two messages are caused by a logic error in my code (I had assumed that all the channels are associated with sources, which of course rarely ever the case).  This shouldn't effect functionality, just generate the annoying messages.  I'll have this fixed in the next release.

We love death.  The US loves life.  That is the difference between us.  -Osama bin Laden, mass murderer
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline gouessej
« Reply #40 - Posted 2010-08-09 09:03:05 »

The first message about sample rate isn't much of a problem (unless you want to change the pitch or use the new Doppler effect).

The second message is somewhat problematic - 3D sound will not really be "3D" without a Pan control (volume differences between left and right speaker).

The other two messages are caused by a logic error in my code (I had assumed that all the channels are associated with sources, which of course rarely ever the case).  This shouldn't effect functionality, just generate the annoying messages.  I'll have this fixed in the next release.
Let me know when it is ready Smiley It will allow me to remove my crappy fix. Will your next release contain a fix for my problem with the webcam used instead of the sound card?

Offline paulscode

Senior Devvie


Medals: 12


Staff Sergeant


« Reply #41 - Posted 2010-08-09 09:31:05 »

Will your next release contain a fix for my problem with the webcam used instead of the sound card?
Yes it will.  Sorry for the delay, I have trouble finding time for programming these days.  The bug fixes are all done, but I still need to work out a thread synchronization problem that has surfaced related to the new stream-position checking stuff I've added.  It shouldn't be too much longer.

We love death.  The US loves life.  That is the difference between us.  -Osama bin Laden, mass murderer
Offline gouessej
« Reply #42 - Posted 2010-08-10 10:19:52 »

Sorry for the delay
Don't be sorry, you already do your best, thanks.

Offline nsigma
« Reply #43 - Posted 2010-08-13 12:07:17 »

The first message about sample rate isn't much of a problem (unless you want to change the pitch or use the new Doppler effect).

The second message is somewhat problematic - 3D sound will not really be "3D" without a Pan control (volume differences between left and right speaker).

Just back from holiday - this thread still going?!  Smiley

You're probably aware of the JSResources site, but if not might want to check this link - http://www.jsresources.org/faq_audio.html#controls_of_dad_line  Main point is that if you're picking one of the direct audio mixers(?), you probably won't ever get a Pan control, though you might get a Balance one.

Praxis LIVE - open-source intermedia toolkit and live interactive visual editor
Digital Prisoners - interactive spaces and projections
Offline paulscode

Senior Devvie


Medals: 12


Staff Sergeant


« Reply #44 - Posted 2010-08-13 20:04:32 »

Main point is that if you're picking one of the direct audio mixers(?), you probably won't ever get a Pan control
I've noticed that as well.  I am definitely going to try and write a single-line mixing algorithm of my own, which will solve all the "mixer headaches" that have been popping up.  Once I have the formula, I might even be able to write a sound system for Android (could even use a 3D sound system, for example when stereo headphones are connected).  That'll be my next goal after I get this version out the door (its looking more like later this weekend - been extra busy at work).

We love death.  The US loves life.  That is the difference between us.  -Osama bin Laden, mass murderer
Offline gouessej
« Reply #45 - Posted 2010-08-14 23:02:35 »

I've noticed that as well.  I am definitely going to try and write a single-line mixing algorithm of my own, which will solve all the "mixer headaches" that have been popping up.  Once I have the formula, I might even be able to write a sound system for Android (could even use a 3D sound system, for example when stereo headphones are connected).  That'll be my next goal after I get this version out the door (its looking more like later this weekend - been extra busy at work).
If you succeed, your sound library will become an excellent "candidate" to be integrated in 3D engines that support both J2SE and Android like Ardor3D, JME 3 and JPCT.

Pages: 1 [2]
  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.

Mr.CodeIt (10 views)
2014-12-23 03:34:11

rwatson462 (38 views)
2014-12-15 09:26:44

Mr.CodeIt (31 views)
2014-12-14 19:50:38

BurntPizza (62 views)
2014-12-09 22:41:13

BurntPizza (99 views)
2014-12-08 04:46:31

JscottyBieshaar (60 views)
2014-12-05 12:39:02

SHC (74 views)
2014-12-03 16:27:13

CopyableCougar4 (77 views)
2014-11-29 21:32:03

toopeicgaming1999 (138 views)
2014-11-26 15:22:04

toopeicgaming1999 (127 views)
2014-11-26 15:20:36
Resources for WIP games
by kpars
2014-12-18 10:26:14

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
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!