[ggo-discussion] Re: possible bug on first time installation

  • From: Peter Strempel <zotan@xxxxxx>
  • To: ggo-discussion@xxxxxxxxxxxxx
  • Date: Mon, 13 Jan 2003 15:01:12 +0100

On Mon, Jan 13, 2003 at 05:39:24PM +0900, Taegil Noh wrote:

> It (probably) was the sound. When .ggorc rc files 'simpleSound' is true, 
> gGo hangs. Maybe my java environment have some problem with initing sound.
> 
> When .ggorc is Not there, I think the default value of 'simpleSound' is 
> true. So it caused the problem too. I guess some sort of 'initing sound' 
> code starts pretty early in the starting of gGo. ( before processing 
> -help option...)

Oho! Thanks a lot for this insight.
I did not think about the sound thing. Right, sound gets initialized pretty
early in the code, within a static constructor to preload the files.
I have not thought about sound.

I am using two ways for playing the sound:
* The standard Java sound code as defined in the Applet class. This is
basically pretty failsafe and this is the first time I hear it fails.
Although appearing relatively stable (well, obviously not, see your case),
it has some problems on Linux as it locks /dev/dsp. However, as long as no
esd/artsd/xmms or whatever is already running, that should not cause a
problem.
This is the "Simple sound system", and the default.

* The "Non simple sound system" uses some more complex code to play the
sound, something William Shubert, the author of CGoban2, wrote. This works
much better on Linux, but does not work at all on Windows. So this is not
the default. However, although it does not fail when /dev/dsp is locked, it
occasionally crashes Java on Linux, so this is something I simply cannot use
as default system.

The whole Java sound stuff on Linux is quite a mess. I am not sure if it is
only my computer and sound configuration, or a general mess.

Very bad seems to be if you run Gnome or KDE with their esd or artsd
daemons.


> maybe , '-nosound' option would be useful? ...  I don't know about java. 
> What caused my java enviroment hangs on Sound init, I can barely know. 
> Maybe java-esd deamon problem? yet strange, it should fail, not hanging.

You write about "java-esd". I have not heard about this before. What is
this? - Yes, I will ask Google right after writing this email. :)

-nosound option is a good idea. I will do something like that. Additionally
I should try to catch the error during runtime, so I can either
automatically disable sound, or give the user a proper hint what to do.

Currently there are three independant sound switches in gGo:
* Play sound in the board preferences. This are the clicks and pings for
stones and passes.
* The clock warning tic-tac sound in the IGS preferences.
* The sound for incoming chats and matches.

All three are independant, so if you want to turn off sound completely, you
would need to turn off all of those three settings, which are to make things
even worse in different places in the GUI. This is not really optimal and I
will need to think about a better solution.
Maybe a global checkbox "Sound on/off" which will overwrite the above
settings somewhere in the GUI, plus a "-nosound" commandline option which
would just do the same.
If someone then starts with -nosound and later turns on sound in the GUI,
that would not be a problem as I can load the sounds anytime. Currently I
just preload them as they cause quite some delay when used the first time
without preload.


A big thanks for your report. Although this seems not to be a common
problem, I should do something about it. Fortunately it mainly seems to be
on Linux. I hate to say it, but Java on Windows works partly much better.
But the Linux users fortunately dont give up instantly if some problem
occurs. :)


 Peter

Other related posts: