Page 2 of 8
Re: stone clicking sound missing - windows 7
Posted: Fri Dec 23, 2011 10:58 am
by BadPotato
I found an easy way to make it work without unstalling anythin.. it should work on windows, linux and probably mac, but I'll explain for the windows user.
Look in your program file and try to find the a folder called something like jre version 6(it should still be there if cgoban used to work well on your computer) and try to run it in command line(start > execute ... and type "cmd"). I did it like this:
Code: Select all
C:\>"C:\Program Files\Java\jre6\bin\java.exe" -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) Client VM (build 19.1-b02, mixed mode)
If you got this output with the 1.6 version, you found the right file.
Now download the offline ".jar" of cgoban here:
==>
http://files.gokgs.com/javaBin/cgoban.jarDownload it and you put it in a place like C:\cgoban\
Then just run :
Code: Select all
"C:\Program Files\Java\jre6\bin\java.exe" -jar C:\cgoban\cgoban.jar
Cgoban should open right away. Connect to your accound and make a demo game, click on the board and you should have sound.
After that, you can make a batch file of the previous command line to make it easier.
edith: I just tested this on ArchLinux and it didn't work with 'java version 1.6.0_20'...
Re: stone clicking sound missing - windows 7
Posted: Mon Dec 26, 2011 10:53 am
by nukeu666
I'm quite sure i lost the stone click sound when the client was upgraded to 3.5.4
Re: stone clicking sound missing - windows 7
Posted: Fri Apr 20, 2012 7:04 pm
by Itaris
I have the same problem (Windows Vista and JDK 7u3 and 6u31). In the past I had no problems, but now the only solution seems to be to switch to another server like Tygem.
Re: stone clicking sound missing - windows 7
Posted: Sat Apr 21, 2012 3:23 am
by Mef
I personally haven't had any real issues with KGS sound (though I have XP, Java 6_30, and 90% of the time I have it on mute anyway) but from trying to help a lot of windows 7 users troubleshoot, there is an issue with Java7 and KGS sound, rolling back to Java 6 should fix the issue (at least most of the time...perhaps it was java 6 update 31 where it broke). Linux I'm not as sure about since I don't have a computer running linux right now, but there's another
thread where some workarounds have been posted for linux.
Re: stone clicking sound missing - windows 7
Posted: Sat Apr 28, 2012 11:32 pm
by phew
Same problem here.
JRE 1.6.0_32-b05
Windows 7 x86
I tried to uninstall JRE, and remove related folders and registry entries as much as posible, and then reboot OS and re-install with offline installer, but still no sound when putting a stone on to the board.
I tested Normal jnlp installation, KGS web site with firefox, and cgoban.jar on my HD, but all same results.
If someone got over this problem, please tell us how!!
Re: stone clicking sound missing - windows 7
Posted: Mon Apr 30, 2012 8:07 am
by Nick23
I've been working on this today and think I may know what the problem is. It would be extremely helpful if the people who have the no stone clicks problem could run the attached test program and post the output here.
Download the attached zip file, open a command prompt, and then run
java -jar testaudio.zip
You should hear a stone click or see an error message. If we get several people to post their outputs we can confirm my guess. Please also post the output of
java -version
/* Copyright disclaimer
*
* This troubleshooting code copies parts of cgoban 3.5.10 at
http://gokgs.com/ * which was reverse engineered to help find the cause of a problem with sounds not playing
*
* IANAL. It is my good faith belief that
* 1. The copied portions are too trivial to be copyrightable under United States law and international IP treaties
* 2. Use of reverse engineering for interoperability is expressly permitted under these laws
*
* Nevertheless, I do not wish to grieve William Shubert, creator of cgoban.
* Therefore, I will take this down upon his request.
*
*/
Re: stone clicking sound missing - windows 7
Posted: Mon Apr 30, 2012 9:16 am
by Slarty
Here's my output. I *think* I've had this problem longer than Java 1.7 has been around.
Re: stone clicking sound missing - windows 7
Posted: Mon Apr 30, 2012 3:47 pm
by hermitek
64bit linux with alsa, no pulseaudio:
Icedtea 6: (stone placing) sound doesn't work
Icedtea 7: sound doesn't work
Oracle Java 1.7: sound doesn't work
Sun Java 1.6: sound works (but java prevents other applications from using the sound card)
Re: stone clicking sound missing - windows 7
Posted: Mon Apr 30, 2012 7:54 pm
by Nick23
Could you download and run it again? I did not realize that compiling with Java 1.7 would mean it does not run in Java 1.6. I have now compiled it with java 1.6.
Re: stone clicking sound missing - windows 7
Posted: Mon Apr 30, 2012 9:55 pm
by witwit
I tried the command as you said. The output indicated it worked but there was no sound produced.
Code: Select all
Played audio file at volume 0.85125035
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
Re: stone clicking sound missing - windows 7
Posted: Tue May 01, 2012 12:49 am
by hermitek
Icedtea 6: Unable to open Java mixer.
Sun Java 1.6: Played audio file at volume 0.85125035
Re: stone clicking sound missing - windows 7
Posted: Tue May 01, 2012 1:51 am
by Nick23
Thanks for posting your outputs everyone. Here is what I think is going on with the missing stone click sounds (sorry about all the technical terms).
1. Most sounds on KGS are played using the Applet.newAudioClip API. How this API works, I don't exactly know, but you do not need to specify a "mixer".
2. AutoMatchStart.wav and Stone.Wav are played using the javax.sound.sampled API. For this API you need a "mixer".
3. Oracle includes a mixer called "Java Sound Audio Engine" that is supposed to be always available.
CGoban's code specifically requests this mixer (probably because it is always available). This mixer no longer exists in Java 1.7. So for all the people with Java 1.7 it fails as soon as it requests that mixer. This mixer also does not exist in Icedtea/OpenJDK.
4. The "Java Sound Audio Engine" in Sun/Oracle 1.6 does exist. However, it apparently tries to lock the sound card for itself in some cases. That means that if you have other applications using sound, stone clicks won't play.
As to how to solve this problem, I can think of three solutions.
A) Request a line directly from AudioSystem, without specifying a mixer. I do not recommend this as on my system sound got really choppy when I tried this.
B) Always request the first mixer (ainfo[0]). From the available mixer lists people have posted so far, the first mixer appears to always be the one you want. One problem is that this mixer may or may not support the MASTER_GAIN control. If it does not, trying to instantiate that throws an exception.
C) Migrate these two sounds to use the same API as the rest of the sounds: Applet.newAudioClip
Hopefully a solution can be implemented in the next version of KGS.
Unfortunately, until then, for us users there is nothing we can do. We cannot make the "Java Audio Sound Engine" mixer magically reappear except by downgrading to a version where it existed.
Re: stone clicking sound missing - windows 7
Posted: Tue May 01, 2012 8:35 am
by SpongeBob
So what's Oracle doing here? Aren't they long enough in the software business to know that language updates should stay compatible?
Re: stone clicking sound missing - windows 7
Posted: Thu May 03, 2012 8:55 am
by Nick23
Well, WMS has replied to my email saying that unfortunately he cannot spend time to fix this in cgoban.
So, I programmed an extension to java itself to make KGS audio work again (it implements the mixer that cgoban is looking for, and just passes everything through to another mixer).
Warning: THIS IS A HUGE UGLY HACK. IF YOU IMPLEMENT THIS WORKAROUND IT COULD MEAN OTHER JAVA APPLICATIONS CANNOT PLAY SOUND OR WORSE COMPLETELY STOP WORKING. IT MAY OPEN YOU TO SECURITY VULNERABILITIES OR OTHERWISE CAUSE YOU HARM. IT IS NOT AT ALL GUARANTEED TO WORK FOR YOU. YOU HAVE BEEN WARNED. USE AT YOUR OWN RISK.
All I can say is that it has solved the problem for me.
How to implement? First, open the zip file and look through the source code for any malware or security vulnerabilties. If you are satisfied, and willing to use this at your own risk, rename the file to .jar and place it under lib/ext in your java home directory. For me this was /usr/lib/jvm/jre/lib/ext. For you it may be C:\Program Files\Oracle\Java1.7.0\lib\ext.
After that, you should be able to hear stone click sounds on KGS. Please let me know if you experience any problems. I expect there will be bugs at first, and I can only fix them if you tell me about them.
Re: stone clicking sound missing - windows 7
Posted: Sat May 05, 2012 8:34 pm
by UnclMartin
Here is a solution that comes to us via email that should work for the Java Web Start client (but not the applet):
Edit the shortcut or command that starts CGoban and add
-J-Dsun.sound.useNewAudioEngine="false"
after javaws.
For example, if your command was javaws cgoban.jnlp change it to javaws -J-Dsun.sound.useNewAudioEngine="false" cgoban.jnlp
Some of you please try this, and post the results here.
For those of you who use the "java" command instead of the "javaws", remove the "-J" For example,
java -Dsun.sound.useNewAudioEngine="false" -jar cgoban.jar
Thank you, person that sent the email.
(I guess he wishes to remain anonymous, since he did not post that here himself.)
Edit 25 October, 2012: The admins have been told that the switch to use the old audio engine is only for Java 1.6.0_30 to 1.6.0_43. It is not available in Java 1.7, and Java older than 1.6.0_30.