It is currently Mon Sep 01, 2025 12:01 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
Offline
 Post subject: Missing Stone sound resolved (and sound mixing on Linux)
Post #1 Posted: Sun Dec 16, 2012 11:26 am 
Dies in gote

Posts: 69
Liked others: 29
Was liked: 29
Rank: EGF 1d
KGS: CBlue
I had a look at CGoban and hacked it a bit to make the stone sound use the same sound system as the perfectly working pass sound.
Fortunately that wasn't hard, because it is basically just copy/paste (take pass sound code, insert at stone sound code, replacing it), takes maybe 10 minutes.

As a nice side effect, the sound now works on Linux systems without any wrappers (aoss/padsp) even with soundcards that don't have hardware mixing (provided you use OpenJDK 7 which supports softwaremixing via ALSA, dunno about Oracle Java).

While on it, I also added a volume slider for the stone/pass sound effects, since it was pretty loud in certain teaching games compared to the teacher's voice ;).
Unfortunately, WMS has expressed in the past that he does not want any "custom-modified" clients to be released publicly, or he might ban people, so I cannot offer it for download.

If you want to modify your own client though, assuming you have decompiled source code, just search for the "pass.au" sound, copy/paste the line that loads it to do the same with the "stone.au" sound, and check the next 'if' command below that. It's the one that decides whether to play a pass or a stone sound. The 'else' bracket is the stone sound, there you can replace the a.b(0).c() method which calls the sound the old way by code you can easily derive from how "pass.au" is loaded: You'll end up with a simple line "yourstonesound.play();", exactly as with the pass sound.
Don't forget to declare a "private static AudioClip yourstonesound = null;" in the beginning, same as is done for the pass sound. It's really all just copy/pasting. ^^
(The "import java.applet.AudioClip;" is already there since it's used for the pass sound, so you don't need to add anything else. Yay!)


This post by C. Blue was liked by 7 people: betterlife, blade90, Bonobo, Charlie, duckweed, quantumf, v00d00
Top
 Profile  
 
Offline
 Post subject: Re: Missing Stone sound resolved (and sound mixing on Linux)
Post #2 Posted: Fri Dec 21, 2012 6:50 am 
Dies in gote

Posts: 45
Liked others: 3
Was liked: 18
Rank: Kgs 5 Kyu
Wow! You fixed the unfixable sound bug.

I hope wms can implement your fix soon ...

Top
 Profile  
 
Offline
 Post subject: Re: Missing Stone sound resolved (and sound mixing on Linux)
Post #3 Posted: Tue Feb 05, 2013 10:43 am 
Beginner

Posts: 17
Liked others: 10
Was liked: 4
Rank: KGS
KGS: kaseki
Not being able to keep of with everything everywhere, this was a surprise when I changed from Ubuntu 10.04.1 to Linux Mint 14 yesterday, found I heard the pass squawk but not the stone click.

Installing various versions of Java, known relentless security hazards that they are, is not an acceptable option. The latest IcedTea OpenJDK works fine otherwise as far as I can tell.

Disassembling the Cgoban3 source code would be a pain for me, and probably violates some TOS that I might have agreed to as some point.

I'll have to attempt the aoss trick when I next get time.

Fortunately for KGS, I had already paid for KGS+ to support them before I discovered that this problem is a long festering sore that has, as seen above, a straightforward patch that will be hard to describe as an unaffordable software repair operation, as the patched version could be supplied for Linux only and regression testing on Windows could be avoided.

Otherwise, I will note that both the jar and jnlp approaches to running Cgoban3 work fine from the menu, once one finds the paths and shrinks the icon to a 48 x 48 pixel size in png format. The java web start option, however, does spawn a new cache folder hierarchy each time it is run.

kas

Top
 Profile  
 
Offline
 Post subject: Re: Missing Stone sound resolved (and sound mixing on Linux)
Post #4 Posted: Tue Feb 05, 2013 11:20 pm 
Beginner

Posts: 17
Liked others: 10
Was liked: 4
Rank: KGS
KGS: kaseki
Alternative resolution.

Rather than hacking the source code, I used the "big ugly hack" that Nick23 documented in post 29 in the thread: stone clicking sound missing - windows 7.

The only difference is that for Linux Mint 14 Cinnamon, there are four folders after /jvm, each with a /jre. I chose the folder /java-1.7.0-openjdk-i386 to put the package into. Both stone click and pass squawk are generated for the Cgoban3 jar file. However, starting the jnlp with java web start led to no stone sound. Perhaps one of the other three folders under /jvm is being used by jws. The web start mode is less critical for me, so I'll look into it further when I have time.

kas

Top
 Profile  
 
Offline
 Post subject: Re: Missing Stone sound resolved (and sound mixing on Linux)
Post #5 Posted: Sat Feb 09, 2013 7:52 am 
Beginner

Posts: 17
Liked others: 10
Was liked: 4
Rank: KGS
KGS: kaseki
Java web start downloads new instances of Cgoban into new folder hierarchies, so each new instance wouldn't have a way to be exposed to the Big Ugly Hack package. However, that is not all bad; I have found that I need to use this mode to hear the sensei on recorded lectures.

kas

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

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