Life In 19x19
http://www.lifein19x19.com/

stone clicking sound missing - windows 7
http://www.lifein19x19.com/viewtopic.php?f=24&t=4570
Page 2 of 6

Author:  Nick23 [ Mon Apr 30, 2012 8:07 am ]
Post subject:  Re: stone clicking sound missing - windows 7

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.
*
*/

Attachments:
File comment: Test program to detect cause of missing stone click sound.
testaudio.zip [6.75 KiB]
Downloaded 1057 times

Author:  Slarty [ Mon Apr 30, 2012 9:16 am ]
Post subject:  Re: stone clicking sound missing - windows 7

Here's my output. I *think* I've had this problem longer than Java 1.7 has been around.

C:\...>java -jar testaudio.zip
Unable to open Java mixer.
You have the following mixers available:
Primary Sound Driver
Speakers (SigmaTel High Definition Audio CODEC)
Primary Sound Capture Driver
Microphone (Webcam C160)
Microphone (SigmaTel High Defin
Port Speakers (SigmaTel High Definit
Port Microphone (SigmaTel High Defin
Port Microphone (Webcam C160)
Played audio file at volume 0.0

C:\...>java -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode, sharing)

Author:  hermitek [ Mon Apr 30, 2012 3:47 pm ]
Post subject:  Re: stone clicking sound missing - windows 7

64bit linux with alsa, no pulseaudio:

Icedtea 6: (stone placing) sound doesn't work
Code:
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.1) (Gentoo build 1.6.0_24-b24)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

Exception in thread "main" java.lang.UnsupportedClassVersionError: Main : Unsupported major.minor version 51.0
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
   at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: Main. Program will exit.

Icedtea 7: sound doesn't work
Code:
java version "1.7.0_03-icedtea"
OpenJDK Runtime Environment (IcedTea7 2.1) (Gentoo build 1.7.0_03-icedtea-b147)
OpenJDK 64-Bit Server VM (build 22.0-b10, mixed mode)

Unable to open Java mixer.
You have the following mixers available:
  PCH [default]
  PCH [plughw:0,0]
  PCH [plughw:0,1]
  PCH [plughw:0,2]
  Generic [plughw:1,3]
  Port PCH [hw:0]
  Port Generic [hw:1]
Played audio file at volume 0.0


Oracle Java 1.7: sound doesn't work
Code:
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b04)
Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixed mode)

Unable to open Java mixer.
You have the following mixers available:
  PCH [default]
  PCH [plughw:0,0]
  PCH [plughw:0,1]
  PCH [plughw:0,2]
  Generic [plughw:1,3]
  Port PCH [hw:0]
  Port Generic [hw:1]
Played audio file at volume 0.0


Sun Java 1.6: sound works (but java prevents other applications from using the sound card)
Code:
java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01, mixed mode)

Exception in thread "main" java.lang.UnsupportedClassVersionError: Main : Unsupported major.minor version 51.0
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClassCond(Unknown Source)
   at java.lang.ClassLoader.defineClass(Unknown Source)
   at java.security.SecureClassLoader.defineClass(Unknown Source)
   at java.net.URLClassLoader.defineClass(Unknown Source)
   at java.net.URLClassLoader.access$000(Unknown Source)
   at java.net.URLClassLoader$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: Main. Program will exit.


Author:  Nick23 [ Mon Apr 30, 2012 7:54 pm ]
Post subject:  Re: stone clicking sound missing - windows 7

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.

Author:  witwit [ Mon Apr 30, 2012 9:55 pm ]
Post subject:  Re: stone clicking sound missing - windows 7

I tried the command as you said. The output indicated it worked but there was no sound produced.
Code:
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)

Author:  hermitek [ Tue May 01, 2012 12:49 am ]
Post subject:  Re: stone clicking sound missing - windows 7

Icedtea 6: Unable to open Java mixer.
Sun Java 1.6: Played audio file at volume 0.85125035

Author:  Nick23 [ Tue May 01, 2012 1:51 am ]
Post subject:  Re: stone clicking sound missing - windows 7

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.

Author:  SpongeBob [ Tue May 01, 2012 8:35 am ]
Post subject:  Re: stone clicking sound missing - windows 7

So what's Oracle doing here? Aren't they long enough in the software business to know that language updates should stay compatible?

Author:  Nick23 [ Thu May 03, 2012 8:55 am ]
Post subject:  Re: stone clicking sound missing - windows 7

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.

Attachments:
File comment: A big fat ugly hack to enable CGoban to play stone click sounds.
javadummymixer_biguglyhack.zip [12.97 KiB]
Downloaded 4854 times

Author:  UnclMartin [ Sat May 05, 2012 8:34 pm ]
Post subject:  Re: stone clicking sound missing - windows 7

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.

Author:  xed_over [ Sat May 19, 2012 3:54 pm ]
Post subject:  Re: stone clicking sound missing - windows 7

UnclMartin wrote:
Some of you please try this, and post the results here.

This did not work for me on two MacBookPro (both 10.6.8), with latest Java updates.

So far, I only tried the java webstart, and not java directly.

No stone clicks, no pass dings, but I get PM rings and lecture audio.

Author:  xed_over [ Sat May 19, 2012 4:08 pm ]
Post subject:  Re: stone clicking sound missing - windows 7

oops... nevermind : File -> Preferences -> sound for: "All games" <-- must remember to turn this on first

Author:  C. Blue [ Sat May 19, 2012 6:42 pm ]
Post subject:  Re: stone clicking sound missing - windows 7

Nick23 wrote:
Well, WMS has replied to my email saying that unfortunately he cannot spend time to fix this in cgoban.

Yay for having other people who fix your *\o/* for you. Instead of continuously forcing people to reverse engineer it, maybe the cgoban-client source code could just be released officially so the community can do all the work more efficiently, saving some of their members' own time too -> everyone is happy and KGS becomes that more awesome.
(Disclaimer: If I sound a bit annoyed it's simply because I like KGS that much and want its development to take the best possible future course. And I'm extremely tired of a LONG time with the same old sound bugs.)

Also, the biguglyhack actually fixed missing stone-clacking sfx and missing lesson audio stream on Archlinux w/ OpenJDK6 (32b) for me, got full sound now. Yay!
Nice work, Nick23.

Author:  phew [ Tue Jun 12, 2012 5:14 pm ]
Post subject:  Re: stone clicking sound missing - windows 7

Thanks for people in this topic!
Special thanks for Nick23 !!!

I tried both 2 methods above. The results are:

1. biguglyhack.jar
Works.

2. Add "-J-Dsun.sound.useNewAudioEngine="false" into Shortcut
Not works.

Java 1.7.0_05
Windows 7 x86

@Nick23,

If there's something wrong and want to restore Java environment, I guess I just need to remove biguglyhack.jar from lib/ext directory, right?
Correct me if I'm wrong, please!

Author:  patricemny [ Sat Jun 23, 2012 3:24 am ]
Post subject:  Re: stone clicking sound missing - windows 7

Hello world!

I experienced too many missing sounds, and some heavy slowdowns while running games in blitz (few seconds, but very handicaping in such situations).

So, I decided to develop a very small Batch script for Windows XP/Vista/7. Its principle is quite simple: it goes in the regitry to find the exact location of de JRE6, then runs Java WebStart to load cgoban.jnlp, which can be located locally or not ()by default, the script goes to KGS in order to retrieve it.

The download link is here (virus free, I promise :) ) --> https://www.dropbox.com/s/bqztjp5gapw4c1w/CGoban.bat

Patrice

Author:  Sumatakyo [ Sun Jun 24, 2012 4:32 am ]
Post subject:  Re: stone clicking sound missing - windows 7

Nick23 wrote:

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.



No programming knowledge whatsoever, so please excuse the newbie questions, but...

by renaming the file .jar, you mean renaming the folder .jar?
There are many files in the folder... so I'm kinda at a loss :sad:

Author:  blade90 [ Sun Jun 24, 2012 5:37 am ]
Post subject:  Re: stone clicking sound missing - windows 7

Sumatakyo wrote:
Nick23 wrote:

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.



No programming knowledge whatsoever, so please excuse the newbie questions, but...

by renaming the file .jar, you mean renaming the folder .jar?
There are many files in the folder... so I'm kinda at a loss :sad:

He means: rename the zip file to jar (example: test.zip -> test.jar)

I guess you are using windows:
if you see a folder instead of the zip file, then that means windows opens it for you. In that case install winrar and then it will be shown as a file.

Author:  Uberdude [ Sun Jun 24, 2012 6:46 am ]
Post subject:  Re: stone clicking sound missing - windows 7

Install WinRar? That's rather OTT. I suspect Sumatakyo' problem is Windows is hiding the extensions of files. You can show them with a setting, precisely where it is depends on what version of Windows but it's probably something like in Windows explorer go to Tools menu, Folder Options, and in View tab uncheck Hide extensions.

Author:  daal [ Sun Jun 24, 2012 7:06 am ]
Post subject:  Re: stone clicking sound missing - windows 7

I just lost my stone sound when I "upgraded" to java 1.6 build 33. I must say that this sort of thing (software not working properly, having to fiddle with something that you don't know how to do that might break something else) sucks.

That said, would somebody help me try to implement this solution:


UnclMartin wrote:
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


How do I edit the shortcut? When I right click the shortcut and select properties, this is what is in target: C:\WINDOWS\system32\javaws.exe -localfile "C:\Dokumente und Einstellungen\daal\Anwendungsdaten\Sun\Java\Deployment\cache\6.0\54\21086f76-71eccf2c"

Is this where I'm supposed to add something? I tried inserting -J-Dsun.sound.useNewAudioEngine="false" right after javaws.exe, but it didn't work.

What a bother.

Edit: btw, I am using windows xp, and this is making me angrier by the minute.

Author:  teralaser [ Sun Jun 24, 2012 4:45 pm ]
Post subject:  no stone click sound on Windows 7 - java fix

1. First make sure "File extensions" can be seen on your Windows machine. Open "Windows Explorer" (find it in Start or use 'WindowsKey' and 'E').
Press 'Alt' and 'v'. In pull-down menu, choose 'Folder options'. Click the tab 'View'. Uncheck "Hide extensions for known file types".
2. Right-click on your desktop. "New", "text document", name it 'j31cgoban'
3. Paste this line into it:

"C:\Program Files\Java\jdk1.6.0_31\bin\java.exe" -jar "%homedrive%%homepath%\Desktop\cgoban.jar"

4. Now get cgoban.jar from http://files.gokgs.com/javaBin/cgoban.jar ... Choose "Save As" and save on your desktop.
5. Find the cgoban.zip or cgoban.jar file. Rename from cgoban.jar to cgoban.zip . Ignore Unuseable warning
6. Find the j31cgoban.txt file and rename it j31cgoban.bat. Ignore unuseable warning.
7. If you prefer to 'hide known extensions' repeat 1. but check 'Hide extensions' instead of uncheck.
8. You can play on KGS by double-clicking on j31cgoban (or j31cgoban.bat)
- you can check the stone sound by -inside the cgoban program- go to Preferences, set sound to "All games" not just "My games", enter a game, wait for a player to play.

Improvements:
- You can make a shortcut by copying another shortcut (click the shortcut once, Ctrl-C, Ctrl-V, look for "Copy of" on your desktop). Rightclick, 'Properties', and then change 'Target' to
"C:\Program Files\Java\jdk1.6.0_31\bin\javaw.exe" -jar "%homedrive%%homepath%\Desktop\cgoban.jar"
- You can also change the location of the cgoban.jar file to anywhere you like. Just change "%homedrive%%...etc." to "C:\MyCGobanPlace\cgoban.jar"

Problems:
- The java 1.6.0_031 maybe installed at another location , look for it, and change the path
- On a new installation java 1.6.0_031 may not be installed, look for it here http://www.oracle.com/technetwork/java/ ... 31-oth-JPR

Best regards, teralaser

Page 2 of 6 All times are UTC - 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/