It is currently Thu Mar 28, 2024 4:51 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 116 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
Offline
 Post subject: Re: stone clicking sound missing - windows 7
Post #21 Posted: Mon Apr 30, 2012 8:07 am 
Beginner

Posts: 4
Liked others: 4
Was liked: 11
Rank: KGS 1d
KGS: 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.
*
*/


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


Last edited by Nick23 on Mon Apr 30, 2012 7:52 pm, edited 1 time in total.

This post by Nick23 was liked by: kaseki
Top
 Profile  
 
Offline
 Post subject: Re: stone clicking sound missing - windows 7
Post #22 Posted: Mon Apr 30, 2012 9:16 am 
Beginner

Posts: 1
Liked others: 0
Was liked: 1
Rank: 2d
GD Posts: 2
KGS: Slarty
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)


This post by Slarty was liked by: Nick23
Top
 Profile  
 
Offline
 Post subject: Re: stone clicking sound missing - windows 7
Post #23 Posted: Mon Apr 30, 2012 3:47 pm 
Dies in gote

Posts: 27
Liked others: 14
Was liked: 3
Rank: KGS 5k
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.



This post by hermitek was liked by: Nick23
Top
 Profile  
 
Offline
 Post subject: Re: stone clicking sound missing - windows 7
Post #24 Posted: Mon Apr 30, 2012 7:54 pm 
Beginner

Posts: 4
Liked others: 4
Was liked: 11
Rank: KGS 1d
KGS: 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.

Top
 Profile  
 
Offline
 Post subject: Re: stone clicking sound missing - windows 7
Post #25 Posted: Mon Apr 30, 2012 9:55 pm 
Beginner

Posts: 8
Liked others: 1
Was liked: 2
Rank: KGS 7K
GD Posts: 12
KGS: witwit
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)

_________________
Games * Rank Graph
7k


This post by witwit was liked by: Nick23
Top
 Profile  
 
Offline
 Post subject: Re: stone clicking sound missing - windows 7
Post #26 Posted: Tue May 01, 2012 12:49 am 
Dies in gote

Posts: 27
Liked others: 14
Was liked: 3
Rank: KGS 5k
Icedtea 6: Unable to open Java mixer.
Sun Java 1.6: Played audio file at volume 0.85125035


This post by hermitek was liked by: Nick23
Top
 Profile  
 
Offline
 Post subject: Re: stone clicking sound missing - windows 7
Post #27 Posted: Tue May 01, 2012 1:51 am 
Beginner

Posts: 4
Liked others: 4
Was liked: 11
Rank: KGS 1d
KGS: 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.


This post by Nick23 was liked by 2 people: C. Blue, kaseki
Top
 Profile  
 
Offline
 Post subject: Re: stone clicking sound missing - windows 7
Post #28 Posted: Tue May 01, 2012 8:35 am 
Lives in gote
User avatar

Posts: 499
Location: Germany
Liked others: 213
Was liked: 96
Rank: Fox 3D
GD Posts: 325
So what's Oracle doing here? Aren't they long enough in the software business to know that language updates should stay compatible?

_________________
Stay out of my territory! (W. White, aka Heisenberg)

Top
 Profile  
 
Offline
 Post subject: Re: stone clicking sound missing - windows 7
Post #29 Posted: Thu May 03, 2012 8:55 am 
Beginner

Posts: 4
Liked others: 4
Was liked: 11
Rank: KGS 1d
KGS: 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.


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

This post by Nick23 was liked by 8 people: C. Blue, ChradH, daal, dejvo, Isttengen, kaseki, kimchiman, maproom
Top
 Profile  
 
Offline
 Post subject: Re: stone clicking sound missing - windows 7
Post #30 Posted: Sat May 05, 2012 8:34 pm 
Dies in gote
User avatar

Posts: 55
Liked others: 6
Was liked: 12
KGS: 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.


Last edited by UnclMartin on Wed Nov 27, 2013 12:34 am, edited 2 times in total.
Top
 Profile  
 
Offline
 Post subject: Re: stone clicking sound missing - windows 7
Post #31 Posted: Sat May 19, 2012 3:54 pm 
Oza

Posts: 2264
Liked others: 1180
Was liked: 552
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.

Top
 Profile  
 
Offline
 Post subject: Re: stone clicking sound missing - windows 7
Post #32 Posted: Sat May 19, 2012 4:08 pm 
Oza

Posts: 2264
Liked others: 1180
Was liked: 552
oops... nevermind : File -> Preferences -> sound for: "All games" <-- must remember to turn this on first

Top
 Profile  
 
Offline
 Post subject: Re: stone clicking sound missing - windows 7
Post #33 Posted: Sat May 19, 2012 6:42 pm 
Dies in gote

Posts: 69
Liked others: 29
Was liked: 29
Rank: EGF 1d
KGS: CBlue
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.

Top
 Profile  
 
Offline
 Post subject: Re: stone clicking sound missing - windows 7
Post #34 Posted: Tue Jun 12, 2012 5:14 pm 
Beginner

Posts: 2
Liked others: 0
Was liked: 0
KGS: phong
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!

Top
 Profile  
 
Offline
 Post subject: Re: stone clicking sound missing - windows 7
Post #35 Posted: Sat Jun 23, 2012 3:24 am 
Beginner

Posts: 1
Liked others: 0
Was liked: 0
Rank: 4 kyu
KGS: kayok
DGS: patoche
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

Top
 Profile  
 
Offline
 Post subject: Re: stone clicking sound missing - windows 7
Post #36 Posted: Sun Jun 24, 2012 4:32 am 
Dies in gote

Posts: 48
Location: Montreal, Canada
Liked others: 0
Was liked: 9
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:

Top
 Profile  
 
Offline
 Post subject: Re: stone clicking sound missing - windows 7
Post #37 Posted: Sun Jun 24, 2012 5:37 am 
Lives with ko

Posts: 160
Liked others: 15
Was liked: 11
Rank: KGS 2k
KGS: blade90
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.


This post by blade90 was liked by: teralaser
Top
 Profile  
 
Offline
 Post subject: Re: stone clicking sound missing - windows 7
Post #38 Posted: Sun Jun 24, 2012 6:46 am 
Judan

Posts: 6725
Location: Cambridge, UK
Liked others: 436
Was liked: 3719
Rank: UK 4 dan
KGS: Uberdude 4d
OGS: Uberdude 7d
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.

Top
 Profile  
 
Offline
 Post subject: Re: stone clicking sound missing - windows 7
Post #39 Posted: Sun Jun 24, 2012 7:06 am 
Oza
User avatar

Posts: 2508
Liked others: 1304
Was liked: 1128
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.

_________________
Patience, grasshopper.

Top
 Profile  
 
Offline
 Post subject: no stone click sound on Windows 7 - java fix
Post #40 Posted: Sun Jun 24, 2012 4:45 pm 
Beginner

Posts: 2
Liked others: 1
Was liked: 0
Rank: KGS 5 kyu
Universal go server handle: teralaser
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

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 116 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group