Tuesday, September 10, 2013

Logans Lessions #4: Setting up a mumble server

Logans Lessions #4: Setting up a mumble server


So, one of my previous posts is about setting up a Ventrillo server. Ventrillo is a easy to set up, free to use (for up to 8 people) voice chat server to use however you see fit. I used Ventrillo for a while, and was pretty happy with it. I'll say that I was happy with it the way that people were happy with life before they invented Air Conditioning (for me, having lived 7 years in Arizona, AC is a BIG part of life).

So this brings me to the point of this post. What changed my feelings for ventrillo? Its simple, another product that does basically the same thing, but in my opinion, better. What was that quote about building a better mousetrap?

Reasons I switched from Ventrillo to Mumble.

  1. Lower latency. In "normal speak" this means that the delay between when you speak, and your friend hears you is lower. Meaning, its more like "normal" conversation, as your friend hears your joke almost as you say it instead of 1.4 seconds later (akward delayed reaction laughing == the worst).
  2. Supports more chatters. Now, most people will never need more than 8 for free. But mumble lets you do as many as you please, its limited only by your bandwidth.
  3. Automatic volume leveling of the chatters. So, no matter who is on the chat, they all sound the same volume to you. Great for if you have someone in your family/team/secret guild that talks loudly, because they won't overpower everyone else (PS, this sadly does not work at family gatherings... )
  4. Additional features that sound cool, but I might not use. Mostly correct positioning of audio while in specific games. So while I game, I don't know if I game enough to appreciate this feature. Although the ability to hear if your friend is on the left or right... is actually quite awesome (technically speaking, that's quite impressive).

Bottom line

The main benefit for me was the reduced latency. For those that don't know, I do some amateur StarCraft 2 commentating (wow, that sounds really, really nerdy). I commentate games for a small league, and occasionally I have a co-commentator that I use these programs to talk with. When commentating with someone that you can't physically see, latency is a huge part of making the performance feel natural.

With Ventrillo, my co-commentator and I were able to work with the roughly 1 - 1.5 second latency. At times though, we would talk over each other (remember we had 1 second to start talking before the other heard). This lead to more stops and starts of conversation as we would both start talking, then hear the fact a second or so later, then start talking again as the silence in-between was also delayed. So we worked within this limitation, but it was a noticeable hindrance.

With Mumble, I've noticed a large decrease in the number of times my co-commentator and I talk over each other. So for that reason alone, its worth the switch. While I haven't actually measured the latency with mumble, I would put it at around half a second with my very unscientific normal usage of the software. While there is obviously room for improvement, that is two to three times faster than ventrillo in my testing, and makes for much more natural conversation.

So, I'll walk you through the setup of mumble, (and its server that you run called "murmer"). Luckily, the setup is almost exactly the same as the setup for Ventrillo, just with different ports being used. Also, mumbles documentation is pretty good as well, so this is meant more just for demonstration purposes of an actual running instance, rather than re-creating the documentation that is already in effect.

Installing and configuring the server


Download the mumble install file from HERE. In this file, you will have the option to install either client only, or client and server. So if you're the one hosting it for your friends on your machine, then of course you do client and server. If you're connecting to a friend, just do client only.

Install the things. I'm not going to sit here and do screenshots of where you should click "next". Its pretty straight forward though.

After things install, you need to configure an ini file for what you want your server to do (aka, server password, number of supported users, etc). It is located in the folder C:\Program Files (x86)\Mumble, and the file is called murmur.ini.

Unlike Ventrillos ini file, this one is a bit more... involved. Its very well laid out at least, but if you're not used to reading ini files, it might take you a few minutes to find what needs to be adjusted.

Protip: Most INI files have lots of settings in them that you might not need. When getting things set up, ignore most things that are currently commented out. In this case, that means the ones with the "#" in front of the line. I am using an editor called Notepad++ to make it easier to read by color coding what is commented out (ignored code), and what is "real".



Once you do that, you need to (as the server) set up your network to allow traffic to the box you're using as the server (I recommend setting a static IP for whatever machine you choose, as this will save you pain in the future if your DHCP addresses change [which they will]).

What I mean by this is that you need to set up port forwarding on your edge device (usually your wireless router/firewall). This is usually a pretty simple process, although because of the wide number of devices on the market that all have slightly different interfaces, I wont even try to do a step by step walk through for this part.

Just know that you need to set up port forwarding to allow the TCP and UDP ports (64738) to the same port on your server.

Here is what mine looks like though.


Setting up the client

Go ahead and start up murmur (double click, select and press enter, whatever).

Once you get that set up, go to canyouseeme and then check that it can see your server on the correct port. Now go to whatsmyip and learn what your public IP is.

Once that works, simply fire up mumble, add the new server. The name you put in is just your label for the server and not its official name. Add the correct IP address (and if you're doing it inside your network, use the internal IP), and then connect. If you put a password on the server, it should now ask you for the username and password that you would like to connect with. Once you do that, you're in!

It should look something like this.



The Wrapup

I've been using mumble now for a few months, and I've been quite happy with it. I've had as many as 4 chatters on simultaneously without any problems. I've appreciated the ability to change the amount of bandwidth being used by each person (in each direction none the less), its ease of use. It is currently my favorite voice chat client and server combo.

Just know that as long as your server is running (or the murmer/ventrillo service is running), that the chat server is live, even if you're not connected to it. I usually leave it turned off when I'm not using it, but you can use it however you'd like.

So there you have it. You now have two very reliable voice chat server options that are completely free at your disposal. You can use them however you'd like. From virtual meetings, to gaming, and to commentating, it should have you covered.

Cheers!

Logans Lessons #3: Setting up Ventrillo server

Setting up Ventrillo server

The Scenario

You get an awesome new multiplayer game to play with your friends who live somewhere that is not in your house/apt/abode. You discover that you love the game, and that while playing, its useful to be talking together, either for the purpose of the game, or just for fun. Luckily the game of course has chat support built in (text chat). Of course, text chat is awesome, but it takes quite a bit of time away from the game, which slows things down, and with enough people, it gets confusing. So, what do you do?

You could call on a cell phone... but that's lame and is way too old fashioned to be useful while playing a game, especially if its with more than one other person. Next up comes the idea to Skype. Now, skype works, but its a bit resource heavy, and has limitations on the number of people that you call at the same time. You could use a google hangout, but that would require everyone to be on google plus... Which not everyone is on, and not everyone wants to be (yours truly included). So what are you to do?

After looking around a bit, and googling all sorts of irrelevant things in your search for what you were actually MEANING to search for, you learn that there is a free program called Ventrillo. It allows you to host your own server (more of a service actually), that supports up to 8 people with simultaneous voice chat. It is completely free, and has been around for a while. However, for some people, it can be a bit intimidating to setup.

This is where I come in. Since I'm a self admitted nerd, I usually just jump right in. This time, I decided to document the process, and help anyone out there out with getting a server of their own setup. I know there are lots of tutorials on this, but for some reason most of the ones I found on this were videos. And while videos are good, sometimes I don't feel like watching one just to figure out one little thing, when I could have just as easily skimmed a document to the part where I was confused. So here is my primarily text based one tutorial.

Installing and configuring the server

So, first steps first. Download ventrillo server. You can find it HERE. Install it, and then edit the config file. The config file is located in the program folder, which should be under c:\Program Files (X86)\VentSrv. The file is called ventrilo_srv.ini. The main thing that you want to do here, is to change the password. Here is what mine looks like, and you can see how simple this file is. I like that.



After you get it installed, and the ini file changed, then you can start the service. To do that, you literally just run (double click, etc) ventrillo_srv.exe. It fires right up, and should be listening for people trying to talk to you.

Installing/configuring the client

After you start the service, you need to install the client (assuming of course you want to be able to talk and hear people, if not... then I guess you're mostly done?). Here, if you are setting it up on your own network, you can use the internal network IP of the machine hosting the service. If the machine that is running it is the same machine that you're going to be playing on, then you can just type in "localhost", or 127.0.0.1, or the internal IP address (all will work).

Here is a screenshot of what mine looks like.


If you have it running on a machine inside your network, but not the machine that you're using, then use the internal IP address (if you don't know that, open the command line, and type "ipconfig", and it will tell you what the IP address is for that machine). For your friends outside your network, go to whatsmyip to figure out what you're external IP address is, and then tell them to use that IP in their clients.

Configuring YOUR network

The last remaining thing to do, is to set up your router/firewall to allow the ventrillo service to communicate with the outside world. To do this, you need to set up something called port forwarding on your router. This is likely the part that confuses people the most, because it sounds really scary and technical. However, without this step, no one will be able to talk to you, and you'll be sad.

In reality, it is pretty simple to do once you know what needs to happen. You simply find out where to adjust port forwarding in your router (usually somewhere under advanced). You can see what mine looks like here, and what the "rule" looks like when in place. Just remember that setting up your own, may be different, but that unless you have the worlds lamest router, you should have the setting in there somewhere.

The menu option for"Port Forwarding/Port Triggering as the last menu option visible in the screenshot on the left. You may have to lookup what your router calls it.

(and here is a shoutout to anyone out there that noticed from that screenshot that I'm running a class B network here at casa de logan :).

Once you find it, you put in the internal IP address of the machine running the ventrillo service, and then the port that will be forwarded to it (3784 is the default, but feel free to change it. Just know that if you change it, you'll have to tell your friends what the new port is). You may also have to specify that the ports are for TCP and UDP. Once your router accepts that, then you're good to go, and everyone should be able to connect.

The wrapup

So far my usage experience of ventrillo has been very good. The only problem that I've had so far is that one of my friends couldn't speak for a while. It turns out, the problem was that when we disabled ppt (push to talk. When you disable it, it turns into basically a phone call where it continuously transmits ), his microphone was so quiet that ventrillo wasn't registering that he was speaking. Once we lowered the sensitivity requirement for ventrillo, it worked just fine. Other settings that I've tweaked on mine. I removed the voice things toast notifications (the beep before and after you talk setting... no idea why you would want those).

In an upcoming post, I'll go through the installation and configuration of one of the main competitors to Ventrillo. The one that I actually switched to FROM Ventrillo...

Logans Lessions #2: Scripting Handbrake in Windows.

Logans Lessions #2: Scripting Handbrake in Windows

The Scenario

You want to rip some of your movies to your computer. You want to do this to either 1) watch the
movies on something that doesn't have an optical drive, or 2) you want to make your entire DVD/BR
archive available without needing to dig out the physical DVD's each time you play them.

With this in mind, how exactly do you go from ripping a DVD onto the computer, to viewing it on any of these devices? Its not very hard actually, although there is no really streamlined way of doing it as of yet (its not built into any OS that I'm aware of).

First you need to rip the DVD to your hard drive. I would suggest an ISO format (the literal image
file of the DVD, exactly the same space on disk, for exactly the same quality and features). There
are programs out there that can actually play these iso files, and if you have no storage limitations, then this is the easiest way to store your DVD's. If this is what you want, you simply stop here.

For the rest of us that have to worry about storage space, or want a more portable and
generally more useful file you might want something else. An ISO of a typical DVD is close to 8GB.
Depending on the size of your movie collection that could be a huge issue. And no portable device I
know plays ISO.

So, if you want to keep the original source file quality, but want the resulting file to be smaller
and more widely playable what do you do? You encode that file into something else. The tool that
many people use to do this encoding/compression is called "handbrake". Handbrake is a free program, and it allows you to take an ISO file or a folder full of VOB files (the other way to get everything off of a DVD), and compress it into much smaller space.

Using Handbrake is pretty simple, with the hardest part being understanding all of the options that
are available to you. Compressing movies is also a pretty time consuming task. A typical movie can
take anywhere from 20 minutes to 2 hrs depending on the options that you select, and the processing
power of your computer.

However, if you have a large Movie library ready, it can be really tedious to compress each movie
one at a time. Luckly, the people at handbrake have already thought about that, and have created a
command line version of the tool that can be scripted. For those that don't know, scripting is a
generic term for taking something that we do on the computer, and then automating it in an attempt
to reduce the amount of human interaction that is required. In this case, we'll be automating the
process of compressing movies in one folder, and then outputing them to an output folder.

Handbrake scripting on a windows machine

Since I'm a bit of a windows guy (as are most of the people out there... by numbers at least), and
when I searched about on the internet for examples of a someone scripting handbrake on windows, the results were remarkably thin, I thought I would do the internet a favor and share with everyone the little script I made to make my life easier.

Powershell is my language of choice, and if you're not already familiar with the old school windows
command prompt (and even if you are), I'd suggest learning powershell as it is rapidly gaining traction as the way to do things in a windows world. I'm about even in my knowledge of cmd and powershell, but I prefer to work with powershell if given the choice.

I'll provide the template script, and explain some of it as I go. Please keep in mind that I am not
a one of microsofts "scripting guys", nor do I proclaim myself as any sort of expert at scripting.
Instead, I'm just sharing something I made in my spare time, and hope that it may be of use to
someone.

Also, as you look at the script in detail, you'll see that I'm creating .mkv files. I prefer using them, as I have found better results with them on my surround sound setup than with MP4. However, MP4 is much more widely accepted and played (almost everything will play MP4 files), so if you want MP4, then all you have to do is change the file ending here in my script.


#Script created by ocnlogan, as part of Logans Learnings #1: Scripting handbrake in windows.

#Creating a variable to store the path to all of the source files that will be encoded. 
#Change the text below (inside the quotes) to reflect where your files are located
$inputpath = "e:\isos" 

#getting the output path for the movies. Change this to what you would like it to say.
$outputpath = "e:\output"

#grabbing the filenames of all of the movies in the folder you just provided.
$movies = ls $inputpath

#The actual logic of the script.
#starting to loop through each movie in your list of movies
foreach($movie in $movies){
 
 #getting the name of the movie, without the file type added to the end.
 $name = $movie.basename
 
 #checking to see if the current movie has already been converted, and is sitting in the output folder.
 #this allows you to run the script repeatedly, without it wasting time converting something that is already done.
 if(!(test-path -path "$outputpath\$name.mkv")){
 
  #the actual command used to start handbrake, and encode/compress a movie.
  #Adjust these settings as necessary. 
                 #These are what I use when encoding, but YMMV for your application
  C:\"Program Files (x86)"\handbrake\HandBrakeCLI.exe -i "$inputpath\$movie" -o "$outputpath\$name.mkv" -e x264 -q 20.0 -a 1,1 -E copy:ac3,copy:dts,copy:dtshd -D 0.0,0.0 -f mkv --detelecine --decomb --loose-anamorphic -m -x b-adapt=2:rc-lookahead=50

 }

}

So all you need to do is to copy and paste that script into a blank notepad file (press and hold the
windows key and then press "R", then in the prompt that comes up type "notepad" and press enter).
Change whatever settings you want (file paths, handbrake settings, etc) and then name it whatever
you would like, as long as you remember to save it as a ".ps1" (powershell) file.

After that, you'll likely only run into one other small "problem" running the script. Powershell by
default is not very trusting (read, more secure), so when you first try to run this script, you'll
likely get a message saying that it cannot be run because the execution policy of the machine does not allow it. Luckily, this is an easy fix. Just type this into an elevated (meaning, run-as administrator) prompt.

Set-executionpolicy -executionpolicy remotesigned

Then after that, try to run your script again, and everything should be peachy.

The wrapup

And there you have it. Now you can start off handbrake to run while you sleep, and you'll have all
those movies converted and compressed in no time :). If you want to get really fancy, you could even
adapt the script to run as a scheduled task, so that anytime you upload files to a folder, it could
convert them, move the outputs to the correct location, and then delete the input file. However, the
core functionality is here in my template.

Feel free to post up and changes or adaptations here, I'd love to see what others come up with :).

Tada!