Thursday, August 06, 2009

Voice chat in OpenSim

Good news--it works. Bad news--it's hard to do.
(UPDATE 10/16: Not hard any more. The binary install of OpenSim is easy with the Diva Distribution. The FreeSWITCH part is kind of hard, still.)
This post explains my specific environment (standalone on a LAN).
This is my setup: XPSP2, compiled version 0.6.5 of OpenSim, Freeswitch, and SL Viewer version 1.23. Here are the steps to making it happen:
  1. First install MySQL like in this tutorial.
  2. The binary version of OpenSim doesn't include the Freeswitch voice module, so you'll have to compile an experimental version from source. (update: well, now I've upgraded to the 0.6.6 binary on a separate installation and it does include the FreeSwitch module, but I can't get it to run with MySQL storage, only SQLite. Something to work on...)
  3. A couple weeks ago I used an SVN client, or subversion client, called TortoiseSVN to download the subversion 0.6.5 from http://dist.opensimulator.org/. They've since moved to a system called 'Git' for downloading subversions and the versions are no longer there. I haven't tried Git but the directions for installing it are here and downloading the right version here (scroll down). Just try to get 0.6.5 as I found when upgrading to 0.6.6 it wouldn't run with MySQL. Some configurations were changed I couldn't figure out. Download it to C:\Program Files\OpenSim (you have to create this first).
  4. Once you have the files and folders, you have to compile the program. Go here and scroll down to the green Visual C# 2008 compiler and download and install it. It will also contain the .NET 2.0 framework, which is required for OpenSim to run.
  5. Now it's time to compile. Navigate to your OpenSim directory and run "runprebuild.bat" by double clicking on it.
  6. Open Visual C# through the start menu. Click File > Open Project. Browse to your OpenSim directory and choose a file called "OpenSim.sln". On the right side in a moment you should see a file tree under Solution Explorer. At the top menu, click Build > Build Solution. At the bottom of the Visual C# window you'll see the status change as it builds each project. It will tell you when it's done.
  7. Before you configure OpenSim, you need to download and configure Freeswitch. You can download a precompiled binary here, and, yes, you have to install the Microsoft Visual C++ 2008 Redistributable Package like it says before you run the Freeswitch program.
  8. To configure Freeswitch to work with OpenSim, you have to change some config settings in a few xml files, explained here. This video also demos the steps, though the end, configuring the region, has conflicting info. He's using SLViewer v1.22 but it shouldn't work until 1.23.
  9. Now you're ready to configure settings for OpenSim in the OpenSim.ini file. Follow these instructions from numbers 5-11 to set OpenSim to store data in your MySQL database and other stuff. This version will have the Freeswitch module section that was absent in the binary version. Configure those settings as shown at the bottom of the Freeswitch config instructions.
  10. Now you can start up Freeswitch. Double click freeswitch.exe. Ignore the red error messages (really!). Start up OpenSim exe. Now go to exactly 3:00 here where they are starting OpenSim.exe and follow their steps, which continue on in part 2, EXCEPT where you put in the region IP (at 5:00) you'll want to put in the computer's fixed IP (Your sysadmin will have to assign the computer a fixed IP if you can't). You can stop when they get to downloading Hippo Viewer.
  11. Now you need the SLViewer version 1.23. This is key, because earlier versions don't work with Freeswitch. Install it and configure it as in step 14 here.
  12. Once you're logged in to your sim, you have to enable voice chat for the estate. Click Edit > Preferences and under Voice Chat make sure it's enabled. Then click World > Region/Estate, click the estate tab and make sure "Allow Voice Chat" is checked. The above video I mentioned is confusing because he is using SLViewer v1.22, which allows him to make the final config adjustment of right clicking on the terrain, clicking About Land, clicking the media tab, and choosing either "use the estate spatial channel" or "private channel". This option isn't available in v1.23, but I couldn't get voice to work in 1.22. Even now I'm wondering if I was able to get it to work in 1.23 because I had first selected the "use estate spatial channel" in a 1.22 viewer, then switched to 1.23. I don't know...It's also possible I didn't know to click the lock on the talk button and that's why it didn't work in 1.22, though I could swear the talk button was greyed out, unclickable.
  13. Anyway, once these things are set, you need someone else to log on or you could talk to yourself over two computers. If you are using headsets, make sure they are plugged in before starting the viewer. To talk, look for the talk button on the lower right. Click the lock next to it to toggle talking on or just click and hold the talk button while you're talking.

10 comments :

Anurag said...

Hi,

I've been trying to do the same, but without any success. I tried ver(0.6.5 and 0.6.6) of opensim. I am setting up OpenSim and FreeSwitch Server on a Linux machine and running SL 1.22/1.23 client from windows.

The talk button in greyed out, and the backgroung color of talk initially is yellow and then turns red. I've followed every step and configurations (on Linux).

What color do you see on talk button when voice chat is enabled?

Anurag said...

Error on FreeSwitch console says..

$ [INFO] switch_core_state_machine.c:137 No Route, Aborting

Can you post logs at freeswitch console when voice chat connections are being made. Or share the logfile.

Thanks

Erik N. said...

I have no experience with Linux, so the problem could be rooted in compiling Freeswitch for Linux. I omitted from my post that I'm running all this on XP so I was able to install the precompiled binary (the post is a continuation of the previous, which explains my environment in more detail). In any event, the local chat field is green and never red, though occasionally switches to yellow and back to green. I'll try to get a Freeswitch log later today.

Erik N. said...

Logfile contents are here. I hope that includes all of the relevant lines.

Anurag said...

Thanks a lot..
Log files helped me to debug.
I am now able to run.

Is voice clear in opensim?? I experience inferior quality voice and not spatial in nature.

Erik N. said...

The quality is inferior. The reason is explained in this comment to this blog post on using FreeSWITCH. He also writes about other ways to get better quality voice in OpenSim--his own hacks--so far nothing I could figure out.

sesli chat said...

I am still trying to figure out to get this codes work. I'd let you know the results in a day or two. Thanks for sharing this with us! More power to you!

sesli said...

This has help a lot of people to have a better interaction and communication with their friends and family away from home.

Sesli sohbet said...

thanks for share nice site

İşverenden.com İş ilanları sitesi said...

istanbul iş ilanları sitesi olarak Tebrik eder başarılarınızın devamını dileriz. Kaliteli bir yazı olmuş elinize sağlıK