Tuesday, 3 February 2015

Streaming gameplay with two sound cards

Another post on this. I'm not convinced my previous suggestions work very well and I've found a better way to do this by making use of a few pieces of free software.

So; round two.

The setup

I've been through this in detail on a previous post, so this is just the highlights.
  • game audio through primary soundcard (the default Windows device)
  • Skype audio through secondary soundcard
  • input from a microphone

The problem

All the streaming software I've seen mixes microphone input into the Windows default sound. I need to also mix the output of another sound card to capture game audio along with both sides of a Skype call during multiplayer gaming.

The solution

The outline is:
  • create a virtual input sound device
  • mix microphone and Skype output into that device
  • set the virtual input sound device as the "microphone input" in the streaming software (in my case, XSplit Gamecaster but this should work with any similar software)

But... how?

To create the virtual audio device we need some extra software. I used VB-Audio Virtual Cable (a donationware alternative to theVAC which costs $25 upwards). Find the downloader (there is a download link under the "VB-Audio Virtual Cable" heading) and install it and magically you'll have some new audio devices appearing in your Windows Sound dialogue.

Next you want AmaMix. The download contains a load of visual stuff, but you only need to worry about AmaMix which lets you route audio to different devices. Make sure you run it as Admin or it will just crash with no indication as to why.

AmaMix is pretty easy to set up. Hit Config and it will give you a dialogue which lets you choose both the secondary sound card output and the microphone output as sources and the new VB-Audio device as your target. There are also options for boosting the inputs and generally fiddling with them until the levels are as you want them.

If you can't find the output of your sound card go to the Sound dialogue and select the Recording tab. Right click and enable disconnected and disabled devices and it should appear.

Finally, in your game streaming software select the VB-Audio device as your microphone input. Now, when you want to stream (or record) you just need to remember to fire up AmaMix along with your streaming software and everything should be ready to go.

I hope this helps someone!

Wednesday, 21 January 2015

Streaming your game with multiplayer audio using XSplit and two sound cards

Catchy title, no?

When streaming a game, XSplit Gamecaster allows me to take the sounds from that game and mix in a single vocal input, however I have two sound cards to allow me to use a mixing desk to manipulate the levels of a Skype call against the game sounds (I posted before about the details of my audio setup on my gaming machine). The XSplit options work for me when streaming or recording single player footage with commentary, however there are problems when it comes to capturing multiplayer gaming along with the group conversations as essentially there are two vocal sources (my voice and everyone else's voice). This leaves me having to choose two of the three audio sources and ending up with either the game sounds plus friends talking to a silent me or the game sounds plus me apparently chatting to nobody.

Why XSplit and Skype?

I am sure there are better capture programs than XSplit Gamecaster (the more-featured Broadcaster, for example) but they require more work to set up and at a quick glance do not offer the required additional options to solve this particular problem. Whatever its shortcomings, Gamecaster does a fantastic job of getting streaming and recording set up with minimum fuss.

The choice of Skype for communication is because that's how my regular group communicates. Again, there are probably better options but this works for us at the moment. For this problem, it shouldn't actually matter as it is basically conversation out of a secondary sound card, which can be done with any chat program.

Also it is worth noting that this is all done on Windows 7.

My requirements

I game a lot but at the moment I record rarely, so any solution needs to both be easy to fire up (to encourage me to do it) and non-intrusive (so my normal gaming doesn't get any worse).

So:
  • low impact on my normal gaming once set up
  • easy to turn on when desired
  • records game sounds and both parts of the Skype call
  • I don't have my own voice echoed back to me through my headphones
  • allow me to keep my current hardware configuration

How to do it

First, we need to get at the output of the second sound card. For Creative Cards, this will be a device called "What You Hear". The RealTek equivalent is "Stereo Mix". Hit the start button and look for "Sound". On the dialogue that appears, select the "Recording" tab. If the device isn't there, right click and enable disconnected and disabled devices. It should appear. In XSplit, select this device as Microphone Input.

At this point, if you are playing a multiplayer game with a Skype call you'll record game sounds and your friends' voices but your own voice will be missing.

Next, go back to the Recording tab on the Sound dialogue. Find your microphone, right click, properties and select the "advanced" tab. Disable exclusive mode (both boxes). Finally, go to the "listen" tab. When you install XSplit it creates a device called XSplit Stream Audio Renderer. Select it from the drop-down and check "listen to this device".

Done! Now, when you record again you'll find your voice is included in the mix.

If you look at the audio options in your system tray you'll see that you can set the levels on the XSplit Stream Audio Renderer which will let you balance your recording.

What is going on?

XSplit seems to create a software audio device (i.e. it doesn't physically exist) and record the output of that. Behind the scenes it mixes the Default Audio output and whatever is specified as the mic input into this device. All we have done here is add an additional audio stream to that device using native Windows options. I added the microphone to the XSplit device by hand and let XSplit handle adding the rest of the Skype call, but I assume it would work just as well the other way around.

Alternately

If you aren't using XSplit or you don't want to mess with one of its components you may want an alternative.

I am trying to mix three audio channels (game, mic and other vocals) when XSplit only allows me to specify two sources (default sound and mic input). In practice, XSplit lets me select any Windows audio input device as the "microphone input" and this gives me the option of creating a new (software) sound source and pre-mixing the microphone input and other vocal output. This requires additional software (such as AmaMix (free) or VAC) which is why I went with the above solution which only uses standard features of Windows.

Friday, 9 January 2015

Controlling your gaming audio through a hardware mixer

I play a lot of multiplayer games and getting the balance between communication and game sounds so both can be heard is very important. Alt-tabbing out of a game to fiddle with the Windows mixer is a pain and is potentially a one-way trip so I've been looking for a better solution.

My requirements

I have three different audio sources on my computer which need balancing:
  • game sounds
  • communication (my group uses Skype, I don't see why this won't work for TeamSpeak)
  • music (from time to time)
And I want to be able to change the levels without leaving my game.

The problems

There are two problems - both with fairly simple solutions: how to separate the audio streams, and how to re-combine them after the levels have been set.

Separation

First, I separated communication. A second sound card solved this problem - Skype can be configured to use any audio output device. Like most gamers, I have a PCIe sound card (Sound Blaster X-Fi for me) which means I have an unused sound card integrated into my motherboard. Re-enable that in the BIOS, point Skype at it and we're away.

For music, I cheated. A while ago I switched the music systems in my house to Sonos - I've written about moving music to a NAS and getting it tagged properly in the past - and this means that it is already a separate stream. The problem with the Sonos output was actually mixing back it into the others so I could listen to music while gaming with headphones.

This leaves my game sounds coming out of the primary sound card in my computer. Three separate audio streams - done.

Re-combining

To re-combine the audio, and also allow me to fiddle with the levels while in-game, I went for a mixing desk. I chose a Yamaha MG124C which is a bit over the top but I really wanted faders (the sliders) for volume control, not just pots (the twiddly knobs) and this was one of the smallest desks available with that feature. I've also used this desk in a radio station in the past so I know it makes a decent sound, is well made and isn't covered in useless features which are likely to break.

Setting up the desk was straightforward - the stereo output from the main sound card and Sonos go into the main stereo channels and the Skype soundcard goes into one of the secondary stereo channels. Some decent cables are also required; I'm using a variety of Adam Hall cables like this. The different channels are routed through the group fader so I can switch between output to the amp and output to the headphones with ease.

Done

And that's it. Now when I'm gaming if I can't hear my team-mates I can simply reach over to the desk and turn up the Skype channel, or turn down the game channel. I can add in music as I choose, or mute it at the touch of a button if things are getting hectic. I can easily make ongoing adjustments to these settings without ever leaving the game.

Hopefully someone will find this useful. The biggest problem I've encountered so far with this setup is how to record game play along with the communication channel. I will cover the solution for that in the next post.

Saturday, 27 December 2014

The year that was

I often kick myself for not indulging my creative side enough, so in the interests of being positive once in a while and reminding myself that I do write more than I think I'm compiling a (likely incomplete) list of creative "things" done this year.


2015 is on the horizon. More next year.

Ubuntu 14.10, finally

I seem to have gotten into the habit of writing a post each time I do an upgrade, so here is the one for Ubuntu 14.10. It's really easy - by far the simplest upgrade I can remember. This, I'm sure, is partly because the changes behind the scenes this time are more about stability than new features but it's a welcome change. Nothing, and I mean nothing has broken for me either on my desktop install or this laptop.

I can't say I'm immediately noticing many improvements either, other than the latest packages. Not that I'm complaining - mostly, an obvious improvement means a change and frankly I like Ubuntu 14.04 enough as it was that it didn't need another overhaul to make me happy. Some minor bugs have been ironed out - the big one is that it no longer randomly forgets my keyboard language preferences.

So, don't fear this one. For me, this is the perfect upgrade - nothing broken and no major changes to learn.

Wednesday, 23 July 2014

Ubuntu 14.04 - here we go

Quick post about the upgrade from Ubuntu 13.10 to 14.04. It went ahead without any real problems. For the first time my decision to disable the utterly horrible "shopping" lens in Unity was honoured over an upgrade (well done - finally).

Bad things: the window close buttons have wandered over to the left AGAIN. This time apparently Canonical have removed the all of the options to move them back (well, someone is recommending recompiling the window manager but there is no way I'm doing that). Thanks guys, that's really helpful.

Further bad things: synaptiks is currently missing from the Ubuntu repositories so if you want a middle mouse click on your touchpad you're out of luck. Fortunately there is a way around that - you can install it from the debian repository:

sudo apt-get update
sudo apt-get install wget gdebi
wget http://http.us.debian.org/debian/pool/main/s/synaptiks/kde-config-touchpad_0.8.1-2_all.deb
sudo gdebi kde-config-touchpad_0.8.1-2_all.deb

That solution pulled from here.

Now to man up and do this on my work machine...

Friday, 25 April 2014

Tagging a music library for use with a Sonos system

I migrated my iTunes music library to a NAS built with a Raspberry Pi so it could be shared with my Sonos system. Before this the only thing reading any metadata on the files was iTunes which can sometimes do weird things. Coupled with that, I've previously used TuneUp to fix broken metadata within iTunes. It works very well in that context but it seems that the metadata it writes is non-standard in some way and other programs will not read it. All this manifests in some of my music only appearing in the track listing part of the Sonos interface, being listed by filename rather than track name and not being listed by album or artist at all.

What do I need?

Sonos reads standard id3 tags - apparently v1 or any of the v2 options. The files need to be tagged in one of these formats.

Fixing things up

My files are kept in a consistent directory structure looking like this:

blah/Music/Gun/Swagger/01 Stand in line.mp3

My first plan was to use a Linux command line utility for reading and writing id3 tags and pull the required information from the directory path using some clever scripting. I've been away from work for over a week so my brain isn't really up to the required "clever" scripting at the moment. Fortunately, when building the NAS as per my last post I made all my music available over a samba share so it was easy to mount that on my desktop machine and get access to the files that way.

There are dozens of GUI id3 editors. I chose to use mp3tag (my desktop is a Windows machine) and hoped I could somehow convert the tags produced by TuneUp and used in iTunes to something more standard. Unfortunely mp3tag lists the TuneUp tags as "Bad Tags". Drat. Well, at least that explains the problem.

So, armed with my new clicky it's back to plan 1. Having found the files which needed attention I used the "filename-tag" converter with this pattern:

%artist%\%album%\%track% %title%

Slashes reversed because we're in a Windows environment now.

This solved the vast majority of the problems. There were still a few albums tagged in a bizarre way - with no track numbers and a title of something like "01 Intro". I didn't want to completely nuke the existing tags for these as they included Album Art so it was time to break out the "tag-tag" converter which lets you use existing information in the tag to populate other fields.

We need two different filters here, applied in this order because the second removes information needed for the first.

Field: TRACK
Pattern: $left(%TITLE%,2)

then

Field: TITLE
Pattern: $cutLeft(%TITLE%,3)

These methods came from the scripting section of the mp3tag documentation. It turns out it's quite powerful, even if the methods don't always do exactly what the docs suggest they will do.

Job done.

Next steps

My album art is all extremely patchy. Sonos is now my primary playout system at home and it takes an age to load album art so I'm not too bothered about fixing it, however if I change my mind there are a couple of options. Firstly, mp3tag lets you paste album art into the box rather than having to use a presaved photo. I can look up album art in iTunes and copy from there for the occasional simple fix.

If I want to do a proper, automatic job I'll probably take a look at Album Art Downloader which is apparently very good and can be run as a tool within mp3tag. That's fun for another day though.