Linux first time - need help with sound!

Hi community!

I’ve installed Linux now but have some probs getting Java3D to work properly. Sound it the problem.

What is wrong??


java.lang.UnsatisfiedLinkError: open
        at com.sun.j3d.audioengines.headspace.HaeMixer.open(Native Method)
        at com.sun.j3d.audioengines.headspace.HaeMixer.construct(HaeMixer.java:126)
        at com.sun.j3d.audioengines.headspace.HaeMixer.<init>(HaeMixer.java:94)
        at com.sun.j3d.audioengines.headspace.HaeDevice.<clinit>(HaeDevice.java:30)
        at com.sun.j3d.audioengines.headspace.J3DHaeStream.initialize(J3DHaeStream.java:69)
        at com.sun.j3d.audioengines.headspace.HeadspaceMixer.initialize(HeadspaceMixer.java:120)
        at com.sun.j3d.utils.universe.Viewer.createAudioDevice(Viewer.java:958)
        at MoveAppBoundingLeaf.init(MoveAppBoundingLeaf.java:341)
        at com.sun.j3d.utils.applet.MainFrame.run(MainFrame.java:262)

I haven’t ever had those problems with j3d.

But does your sound work with XMMS? Are you using the OSS driver?

If you haven’t setup your audio yet, then you can do the following
open a term (if your in X) and type
</>su -l
then
</>setup

then go to audio setup and select the sound card that you have installed.
If you have an onboard sound card - this might not be supported with the drivers you have installed - there are several places to look - you have the ALSA drivers
http://www.alsa-project.org/

and OSS drivers
http://www.opensound.com/linux.html

To look through. check these sites to see if you sound card is supported - I had to compile and install their latest drivers for my onboard sound (thats until I got a Sound Blaster Live because with most on-board sound, they can only do audio out because each motherboard chipset for audio is packaged differntly. The mb companies doni’t provide the necessary information for these guys to write more then just audio out).

I hope this helps.

Good to know it’s not a general problem.

Sound works fine on Linux with other apps, just not with Java3D.

No idea wether I already have or haven’t this OOS or alsa crap. How to find out?

I looked up the alsa soundcard matrix, but it seems not to support an SiS i810 that is reported by the linux hardware browser.

The ‘setup’ you mention doesn’t offer an option to configure sound.

BTW, I installed a RedHat8.

[rant]
Man - I have been a unix admin for years - but I’m not able to setup a Linux box properly - no wonder that M$ is that successful…
[/rant]

so in the setup program, you do not have a field saying
“sound card configuration” ?

try typing
/sbin/lsmod

This shows info about the modules that are loaded
You should have something simular to this in the list that is printed.
emu10k1 60832 2 (autoclean)
ac97_codec 12256 0 (autoclean) [emu10k1]
sound 69260 0 (autoclean) [emu10k1]
soundcore 6212 7 (autoclean) [emu10k1 sound]

But this doesn’t quite sound like a an audio issue since all the other sound works. Are you sure your classpath and path are setup correctly?

How did you install j3d - in a seperate directory or in the same direcotyr as your standard java install?

If its in the same directory then all you need to do is point the PATH like the following in your .bash_profile (this is in your home directory)

export PATH
#Java 1.4.1_01
export PATH=/usr/java/j2sdk1.4.1_01/bin:$PATH
export PATH=/usr/java/j2sdk1.4.1_01/jre/bin:$PATH
export PATH=/usr/java/j2sdk1.4.1_01/include:$PATH

If you have it in another dir, then make sure you include that in your path.

[quote]so in the setup program, you do not have a field saying
“sound card configuration” ?
[/quote]
Nope. Just


                        | Authentication configuration   &#9474;
                       &#9474;   Firewall configuration         &#9474;
                       &#9474;   Keyboard configuration         &#9474;
                       &#9474;   Mouse configuration            &#9474;
                       &#9474;   Network configuration          &#9474;
                       &#9474;   Printer configuration          &#9474;
                       &#9474;   System services                &#9474;
                       &#9474;   Timezone configuration


i810_audio             25224   0  (autoclean)
ac97_codec             13416   0  (autoclean) [i810_audio]
soundcore               6500   2  (autoclean) [i810_audio]

Ok? Sound module is missing. I found the following in /etc/modules.conf:


alias sound-slot-0 i810_audio
post-install sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -L >/dev/null 2>&1 || :
pre-remove sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -S >/dev/null 2>&1 ||
:

How can I be sure?? But anyway, I have them in my path (except include!) I installed J3D to /usr/java/j2sdk1.4.2/ and added a setup script to /etc/profile.d

Another more general question: does LD_LIBRARY_PATH still play any role? How are the libs from /usr/java/j2sdk1.4.2/jre/lib/i386/ found at all?

If you have it in another dir, then make sure you include that in your path.
[/quote]

Forgot to say Conzar - I deeply appreciate your help, I’m lost…

Thank you,

  • J

hey, have you tried earlier versions of the jdk like 1.4.1 or 1.3.1?
I haven’t tried the 1.4.2 yet - maybe this might be causing problems?

I’m not sure about how the LD_LIBRARY_PATH effects java but I don’t think you need to concider that at the momement.

Also, when did you select your sound card - apon install?

Yes, during initial installation. It has been recognized automatically and the test passed. To be honest, before I never had the slightes idea what kind of soundcard I have at all…

Btw, if I change a single method to catch a Throwable (Exception is NOT enough), my non-trivial app works fine without any further change of code. Just silent.

It is not even obviously slower although running on Linux now.

private void initSoundDevice( PhysicalEnvironment phenv )
    {
        try
        {
            HeadspaceMixer mixer = new HeadspaceMixer( phenv );
            mixer.initialize();
        }
        catch ( Throwable e )
        {
            Log.logger.warning( "Cannot setup sound device!" );
        }
    }

So you are using the pre-build j3d sound stuff?

Have you thought about using jmf or javazoom?

http://java.sun.com/products/java-media/jmf/
http://www.javazoom.net/javalayer/sources.html

args - now I installed the ancient 1.4.1 + Java3D 1.3 and now I have the sound working. Laggy - but working…

well, remember: 1.4.2 is just beta

[quote]args - now I installed the ancient 1.4.1 + Java3D 1.3 and now I have the sound working. Laggy - but working…
[/quote]
Sound and Linux aren’t exactly… friendly to one another. Lots of well known deficiencies in this area (I personally hate it when I get a crash when someone IM’s me while I’m watching something via Xine or Mplayer). There are some people working on it, though, but then again that’s why I’m back on Microsoft for now, too. “Working on it” just isn’t good enough for me right now.

that isn’t a sound issue - thats a gaim issue. You might need to upgrade to the latest gaim - that should solve that problem.

I can highly recommend FreeBSD 5.0 based on personal experience. The only gotcha I’d tell you to look out for right now is to disable DMA transfers for TV tuner cards. Those will get you. Oh, and GPlayer is a real pain in the ass. Use Xine or MPlayer. Other than that, you’ve got all the binaries of Linux with none of the hassle. :slight_smile: Plus the ports system rulez! ;D