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

CGoban and Stone Sound
http://www.lifein19x19.com/viewtopic.php?f=18&t=1143
Page 1 of 1

Author:  judicata [ Mon Jul 19, 2010 7:19 pm ]
Post subject:  CGoban and Stone Sound

Hey guys, I've upgraded to the latest version Ubuntu (from several versions - I think Intrepid to Lucid), and now I cannot hear the stones clicking on KGS (CGoban). On the positive side, I can still hear them when I run it in XP through virtualbox, but I'd much rather run it natively.

I can still hear the alarms and the voice audio (i.e. in lectures), just not the sound clicking. Installing oss and running it in aoss mode doesn't help.

Ideas?

Author:  fwiffo [ Mon Jul 19, 2010 7:25 pm ]
Post subject:  Re: CGoban and Stone Sound

What flavor of java are you running? I recently discovered that upgrading ubuntu can result in your sun java getting replaced with some not-really-functional alternative.

Author:  Bantari [ Mon Jul 19, 2010 7:33 pm ]
Post subject:  Re: CGoban and Stone Sound

fwiffo wrote:
What flavor of java are you running? I recently discovered that upgrading ubuntu can result in your sun java getting replaced with some not-really-functional alternative.


Yeah, that's what I have discovered too.
If I understand this correctly, though, the Java should still be the same, but the browser plugin is different.

Author:  fwiffo [ Mon Jul 19, 2010 7:53 pm ]
Post subject:  Re: CGoban and Stone Sound

In my case it screwed up both, which kept it from working with the "-open" switch, so I couldn't open SGF files easily. And the fonts were wrong. And the sound didn't work. And everything looked funny.

Author:  judicata [ Mon Jul 19, 2010 8:20 pm ]
Post subject:  Re: CGoban and Stone Sound

I'll double-check, but I think I've replaced it with sun-java and nothing happened really. The fonts DO look different than in Windows though, so maybe you're on to something.

Author:  judicata [ Mon Jul 19, 2010 8:39 pm ]
Post subject:  Re: CGoban and Stone Sound

Yippee! Thanks Fwiffo! I had installed sun-java, but had NOT removed open-jdk. Once I did that, I got my stone clicks back. Although the font still looks different, I actually like it a little better; and it loads much faster.

This makes me happier than it probably should, but that's okay.

For posterity: go to synaptic and install the sun-java6-jre package and remove openjdk-6-jdk, and openjdk-6-jre and similar packages.

Author:  cdybeijing [ Mon Jul 19, 2010 11:57 pm ]
Post subject:  Re: CGoban and Stone Sound

judicata wrote:
Yippee! Thanks Fwiffo! I had installed sun-java, but had NOT removed open-jdk. Once I did that, I got my stone clicks back. Although the font still looks different, I actually like it a little better; and it loads much faster.

This makes me happier than it probably should, but that's okay.

For posterity: go to synaptic and install the sun-java6-jre package and remove openjdk-6-jdk, and openjdk-6-jre and similar packages.


I wondered for a long time why I was having the exact same problem. This is great, thanks.

Author:  wms [ Tue Jul 20, 2010 12:03 am ]
Post subject:  Re: CGoban and Stone Sound

It's so frustrating that Ubuntu uses the "-open" version by default. Sun java sucks bad enough, but the "-open" version is even worse. So many little bugs that it has in *addition* to all the irritations of Sun's version. :(

Well, glad you got it straightened out in the end!

Author:  fwiffo [ Tue Jul 20, 2010 7:34 am ]
Post subject:  Re: CGoban and Stone Sound

I actually don't think you have to remove the openjdk version, you just have to use update-alternatives to set sun java as the default.

Author:  daniel_the_smith [ Tue Jul 20, 2010 8:15 am ]
Post subject:  Re: CGoban and Stone Sound

Oh, I have this problem too, I'll have to see if that fixes it...

Author:  judicata [ Tue Jul 20, 2010 12:56 pm ]
Post subject:  Re: CGoban and Stone Sound

fwiffo wrote:
I actually don't think you have to remove the openjdk version, you just have to use update-alternatives to set sun java as the default.


I tried that first and got an error. I may have just typed the command wrong, though; I'm not at home so I can't double check.

A primary reason I use Ubuntu is that I strongly prefer open software, so I hate it when things don't work right.

On an unlreted note, I also hate it when some design team makes almost arbitrary decisions that completely depart from established practice, with little or no benefit to usability. Case in point: moving all of the window controls (minimize, maximize, close) from the upper-right side of a window to the upper-left. Even better, there wasn't an obvious way to change it back (although it is pretty easy to do--just not obvious).

Author:  cdybeijing [ Fri Jul 23, 2010 1:18 am ]
Post subject:  Re: CGoban and Stone Sound

judicata wrote:
fwiffo wrote:
I actually don't think you have to remove the openjdk version, you just have to use update-alternatives to set sun java as the default.


I tried that first and got an error. I may have just typed the command wrong, though; I'm not at home so I can't double check.

A primary reason I use Ubuntu is that I strongly prefer open software, so I hate it when things don't work right.

On an unlreted note, I also hate it when some design team makes almost arbitrary decisions that completely depart from established practice, with little or no benefit to usability. Case in point: moving all of the window controls (minimize, maximize, close) from the upper-right side of a window to the upper-left. Even better, there wasn't an obvious way to change it back (although it is pretty easy to do--just not obvious).


After getting used to Lucid since its initial release, I now wish there was an easy way for me to change the window controls on my Windows work pc from the right side to the left...

Author:  judicata [ Mon Oct 04, 2010 9:01 pm ]
Post subject:  Re: CGoban and Stone Sound

Even after the action described above, I could only hear cgoban and nothing else.

Then, I found this thread, which gets java to use aoss without having to launch through a terminal each time.

First, make sure you have aoss installed, then:

Code:
cd /usr/lib/jvm/java-6-sun/jre/bin
sudo mv java java.bin
sudo touch java
sudo chmod +x java
sudo gedit java

Then, insert the following code into the java file
Code:
#!/bin/bash
aoss /usr/lib/jvm/java-6-sun/jre/bin/java.bin "$@"


Should be good to go.

Author:  C. Blue [ Tue Oct 19, 2010 5:07 pm ]
Post subject:  Re: CGoban and Stone Sound

The command to "activate" one of several installed Java flavours is

sudo update-alternatives --config java

Note that basic OpenJDK-Java in Ubuntu, as WMS hinted, will be usually glitchy enough to not produce any stone sound at all, as was said above, while SunJava (now acquired by Oracle) will produce sound fine, but on 99% of modern sound hardware (ie ones lacking multi-channel hardware-mixing) will hog the sound device and therefore prevent other apps from playing sound while cgoban is running. Or the other way round, if another app is already playing music, Java (and Cgoban) will not produce sound.

To fix this by wrapping the Java sound output into a mixable stream, with Ubuntu for a while now shipping with Pulseaudio as default sound server, you might want to try padsp instead of aoss. You might have to install Pulseaudio utilities to get it, I'm not entirely sure and too lazy to check right now :-p. But you might want pavucontrol and padevchooser anyway, so just install all pulseaudio tools you can find. Similar to aoss, the command then will be

padsp javaws cgoban.jnlp

or for stand-alone aka offline version of CGoban, if you downloaded one

padsp java -jar cgobanwhatever.jar

Apart from latest Ubuntu going for Pulseaudio instead of just ALSA, personally I found padsp working more reliably than aoss, although it can still cease working after a while depending on various factors (if some preloading goes bad). If that happens, it might be required to terminate all apps that currently utilize Pulseaudio, then restart them and cgoban. (Basically same annoying procedure that would also happen to aoss).

The technically most low-level and therefore supposedly most reliable approach would be ossproxy, which however is still sort of beta or even alpha.. for many people it seems to work, but sometimes it just doesn't work at all, and also it requires certain kernel configs and possibly compiling stuff (possibly including kernel) yourself. OSSproxy creates fake sound devices, and sort of forwards all input to the pulseaudio server (or ALSA, if desired on different distros than Ubuntu). For this, a kernel is required that doesn't preclaim OSS device paths, and also a CUSE-supporting FUSE library will be neccesary, so things get a bit technical. Basically, search for OSSproxy on Sourceforge, to get the latest code.

As a side note, you might wonder about claims how Java supports ALSA - this doesn't mean it won't hog the oss sound device (aka /dev/dsp) unfortunately. Although it utilizes ALSA, it'll still try to reserve it exclusively..so yeah, padsp all the way (or aoss on older/other Linux distributions).

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