Reducing Latency in Rocksmith (PC)

April 14, 2013

Recently I have been posting about the Real Tone cable for use as a guitar audio interface for amp modelling and other Digital Audio Workstation duties.  I’ve also been comparing its performance with a proper audio interface.  One of the areas that I noted a large difference was that of latency – the gap in time between plucking a string and having the computer emit the sound as a note through the speakers.  Lower latency of course is always desirable, but a little latency can be lived with without ruining the experience.  However, once it climbs too high it becomes unplayable.

What I haven’t discussed much is using the cable for what it was originally designed for: playing Rocksmith!  Plenty of criticism comes from the latency present in-game – and I agree, it can be distracting.  Ideally I would like to be able to use my new TASCAM audio interface as my guitar input, but Ubisoft also use the Real Tone cable as their form of copy protection.  You must own the cable to play the game.  There are No-Cable hacks which allow you to play the game using your on-board soundcard (which presumably would suffer from high noise issues without the proper pre-amps of an instrument specific interface), and this hack should allow me to use my hardware instead of the Real Tone (one should imagine).  But I’m loathed to hack about my game in a way that could make it look like I’m pirating something on Steam that I totally legitimately own, just so that I can use some hardware that never would have been considered when they designed this game for console (grrr, console-ports).

Thankfully however, there are some configuration settings that can be tweaked to improve the performance of the Real Tone cable.  The file that you’re looking for is rocksmith.ini located in your Steam/steamapps/common/Rocksmith directory.   And it would seem that these are set by default very conservatively (resulting in high latency).

rocksmith_ini

The two key variables here are LatencyBuffer and MaxOutputBufferSize.  In effect, the resulting latency of the system is proportional to LatencyBuffer x MaxOutputBufferSize.  By default LatencyBuffer is set to 4 and MaxOutputBufferSize is set to 0 which means automatic, although in practice this almost always ends up being 1024 for pretty much all standard motherboard soundcards.

The purpose of the buffer is to provide uninterrupted sound when the processors cannot keep up and it does this by introducing a lag (hence, buffer) allowing time gap in which everything can catch up before you hear an interruption.    So the first thing to do is to set both variables to their default states of 4 and 1024, respectively, and then work them down until clicks and other artefacts start appearing.  Then just back them up a little.

Looking at the maths of it all, simply changing the value for LatencyBuffer is going to make a big difference so I started by moving it down from 4 to 2.  In one step this reduces latency by a full 50% and I found it to be the difference between a noticeably laggy, somewhat annoying in-game experience and a very playable, acceptable one!  And to put this in perspective I don’t have an epic gaming rig, yet making this change improved gameplay without degrading the sound at all.  Clearly those default settings are very conservative indeed.

I encourage all owners of Rocksmith to give this a go.  It’s not complicated or time consuming, and if it doesn’t work out then just bump the numbers back again.  But I’m confident that you’ll be pleasantly surprised at what a difference it makes.  Why this isn’t a prominent option available through the in-game menus boggles me – but then anyone who’s played the PC version probably knows it’s best not to get started on that infuriating menu system…!


TASCAM US-200 Audio Interface

April 3, 2013

Earlier I posted a guide to using a Real Tone cable (which comes with the game Rocksmith) to connect to Guitar Rig 5.  With the success of that experiment I went ahead and bought a proper audio interface.  In this post I will give a rundown of the rationale behind my decisions and highlight the differences between the two approaches.

tascam-us200

The unit that I chose was the TASCAM US-200.  This USB audio interface has 2 microphone-in (one of which can be instrument); gain knobs for each mic input; selectable 48V phantom power for professional microphones; 4 line-out channels (channel assignment software configurable); 1 independent headphone-out (with dedicated volume control); MIDI in and MIDI out.  This cost about $100.

The benefits of running this unit over the Real Tone are:

  • the Real Tone cable is only an audio input device so you need to use ASIO4ALL to bridge the sound output to your motherboard’s sound chip which can be annoying to configure (your settings don’t always ‘stick’)
  • the software bridging performed by ASIO4ALL, combined with the fact that the Real Tone is a budget item, means that latency is high (eminently playable, but clearly noticeable)
  • the TASCAM takes care of both audio input and output so configuration is super easy and reliable
  • the TASCAM has knobs for input gains and output volume so adjustments don’t require driving a mouse around the screen (which gets old pretty quick while you’re trying to play an instrument)

So what have I thought of it so far? Well latency is significantly lower!  I also found the Real Tone cable prone to noise – both clicks from artefacts and analog cable noise.  There are no artefacts with the TASCAM and any cable noise is virtually eliminated (probably in part due to the fact that I can use my better quality instrument cables than what the Real Tone is made from).  Any residual noise, where it may exist, is ruthlessly gobbled up by noise gate settings in GR5.

I also am a huge fan of the ability to set my external speakers and amplifier to a direct line-out and be able to adjust my headphones with the volume control (ie independent of the speakers).  This is a far better outcome than trying to get the single motherboard output to do everything.

The MIDI interface is also a nice bonus.  Although I don’t actually own any MIDI devices I can see the appeal of, say, a simple MIDI foot switch array to mimic the functionality of a traditional pedal board (and to do tap-tempos, etc).  Indeed that might be an excellent project for a future post!

In conclusion, do I consider this money well spent?  Resoundingly yes.  I had some trepidation over this purchase because I did plenty of reading about all of the products on offer.  Much like digital photography forums, it would seem that musicians are never happy with any product and there is never a consensus on anything.  But for me this unit seems to do perfectly acceptably what I’m looking from it.  And to put it in perspective, this comes in at the price of a tuner pedal!


Easy Way To Roll Out Pie Pastry

April 2, 2013

This is one of those posts that runs the risk of pointing out the obvious, but then it wasn’t as obvious to me as perhaps it should have been…

I like to bake an apple and pear pie with very short pastry.  I like it to be like a shortbread biscuit (only not quite as sweet).  This means that the pastry is hard to roll out without it splitting and crumbling.  And certainly getting it into the tin can be a challenge without breaking it.  Usually I would flour the work top and roll it out to size.  Once it’s thin and circular I’d roll it onto the rolling pin to bring it over to the tin, then roll it off the pin onto the tin.  Inevitably I’d then have to go around fixing the splits.

The new technique is to use greaseproof baking paper the same way that adhesive stickers are lined with a non-stick backing.

First place down a square of baking paper.  The place the chilled sphere of pastry on top (cold pastry is way easier to work with than unchilled).  Place a second piece of baking paper over this.  Roll out the pastry between the paper.

pastry1

Of course you can check the size by placing the tin over what you’ve done.  I found the rolling pin good for most of the rough work, then the whole thing can be smoothed with a gentle rubbing of the hands.

Peel the top layer of paper off, keeping it for the lid.  Place the pastry in the pie tin with the remaining paper uppermost.  This is easy to do because the pastry sticks to the paper while you carry it over.

pastry2

Tease the paper away from the edges first then remove it from the centre.  Then the pastry can be worked into all the nooks and crannies of the pie tin.  Notice no splits at all!

pastry3

After putting in the filling the same process is used for the lid.  Roll the edges together to seal and add vent holes.

pastry4

Couldn’t be easier.

Finally here’s the recipe for my pastry for those following along at home:

  • 1.75 cups plain flour
  • 0.5 cup self raising flour
  • 185g butter
  • 75g raw sugar
  • 2 eggs
  • 1tbsp milk

Sieve the plain and self raising flour together, add the raw sugar.  Chop the butter into small cubes and work the mix through your fingers until you have the consistency of breadcrumbs.  Whisk the eggs and milk together.  Add to the mix and combine with the hands until it has all come together as a smooth ball.  Divide into 60/40 spheres (for base and lid, respectively), wrap in plastic kitchen wrap and chill in the bottom of the fridge for 20min.

For the pie I use 2 green apples and 2 pears, some brown sugar, cinnamon and nutmeg.  Bake for 50-60min 180C.  Can also be partially baked for 40min the day before and then freshened up for 20min in the oven on the day.


Using Rocksmith Real Tone cable with Guitar Rig 5

March 21, 2013

This christmas I picked up a copy of the game Rocksmith.  This half-game/half-tutor allows you to connect a real guitar to a console or PC and is basically Guitar Hero with a proper instrument.  Unlike Hero all the time you invest in getting better at the game actually builds real musical skills, rather than just coming away from it a highly talented coloured button masher.

real tone cable

You supply your own guitar and the connection is made by the Real Tone cable which is supplied with the game.  Inside it is a Hercules board which converts the analog signal from the guitar into a USB digital stream.

But not only can this game provide a leg-up getting the motivation to learn, but the Real Tone cable also allows amp modelling sims to be used outside of the game.  This is not something that is advertised by the game manufacturers but with a free driver, a little fiddling and a copy of Guitar Rig or Amplitube this is pretty easy to do.  And a standard interface for connecting guitar to PC will cost around $100, so Rocksmith really is giving you some excellent value beyond what is already a great game.

The driver that is needed is called ASIO4ALL.  This is because a standard audio interface has both input and output, but the Real Tone cable is input only.  In order to keep latencies low amp modelling software take exclusive control of the audio interface and they expect to only have to use one for both the incoming and outgoing sounds.  ASIO4ALL is needed to work as a ‘bridge’ so that the Real Tone can be selected as the input but a different device selected as the output (for example your motherboard sound chip).  I didn’t find ASIO4ALL super intuitive to use, so I will devote the rest of this post to explaining how mine is configured to get the sound working properly in Guitar Rig 5.

Once ASIO4ALL is installed fire up the amp modelling suite and select ASIO4ALL as the audio device.

realtone_asio1

Whenever a program starts using ASIO4ALL a little green triangle symbol appears in your system tray.  Clicking this brings up the ASIO4ALL configuration menu.  Here you should see your standard PC sound card (probably with a highlighted green symbol next to it indicating that it is the active selection) and your Rocksmith USB Guitar Adapter (which will probably not be selected).  Expand your PC sound card entry by hitting the + and exposing the inputs and outputs.  What you want to do is arrange it so that it looks like mine below, with your PC sound card output selected, your PC sound card input deselected and the Rocksmith USB guitar selected.

realtone_asio3_asiosettings

This might take a little bit of fiddling to select them in the right order – ASIO4ALL has a habit of going all-or-nothing, but trust me it is possible to do it if you find the correct order of operations.

Once this is achieved go back into Guitar Rig and make your input and output selections.  These can be found under the Routing tab.  You want USB Guitar Adapter as input and your PC soundcard as output.

realtone_asio2_routing_in

realtone_asio2_routing_out

While all this is going on I like to have the metronome going, because that way it’s really easy to tell when the output is correctly configured.  If you can hear the metronome and when you strum your guitar you get sound then all is good!

If you strum your guitar and you see the input VU meter move then you know that output is a problem.  If you can hear the metronome but when you strum the input VU does not move then you know that input is a problem.

Lastly, sometimes I have experienced some clicking and clipping using the Real Tone cable in this way.  Often just opening up the ASIO4ALL config menu makes this go away.  Certainly I don’t experience this problem all the time.

This is a different issue to simply interference on the analog side of the cable – which this set up can suffer from (like any guitar setup).  Running the cable too close to your PC, power cables and other electrical devices can impart a hum.  Either have a go at moving the cables around, or do as I do and simply slap a virtual Noise Reduction pedal into your onscreen setup!

Happy shredding…

(UPDATE: here’s a look at a proper dedicated audio interface)


LowBrau – Screen Protector

March 8, 2013

I am trying to keep the controller box as water-tight as possible.  Although I don’t expect it to be hosed down, I can see that with an inherently liquid-based enterprise it is entirely foreseeable that it’s likely to get the odd splash.  At the moment the LCD module simply pokes through a hole in the box, so it needs some sort of cover to seal it all up (as well as provide some knock protection).

All I really want is a rectangle of thin clear plastic.  So I went looking for some trash that could be repurposed.  My first attempt was using an old CD cover.  This proved too flimsy – once the edges were removed it was quite floppy.  In the end I used the plastic from a box of ex-Christmas Ferrero Roche.  I’m sure that an old iPod/iPhone box would work even better (not that I have many of them lying around).

The best way to work the material is to rough cut the sides off to leave a single flat sheet of plastic.  A hacksaw or Dremel cutting wheel works well for this.  To actually cut the final edges of the rectangle (ie the fine work) the best approach is one similar to glass cutting.  Score your line a few times with a craft knife and straight-edge.  The bend to snap along the score line with some flat-nosed pliers.

lowbrau - screen protector cutting

This way the rough stock can be made properly square (as in, given proper 90 degree corners) and the results are quite accurate, straight sides.  Any jagged edges can be knocked back to smooth with a light sanding.

Then all is needed are a few holes for mounting screws and (later) a little silicone sealant.

lowbrau - screen protector installed

As you can see in the photo above, my box has a little dot imperfection where the injection molding has taken place.  I may end up sourcing a better piece of stock and remake using this one as a template.  If that were to happen this would actually be a very quick operation to duplicate the two (this one took about 5 minutes to make).  Or I may just live with what I have…


LowBrau – Low Voltage Wiring

March 6, 2013

Now that the major components have been fitted to the front and back halves of the controller box it’s time to start wiring up the low voltage components.

lowbrau - low voltage wiring front

I started by installing an earth wire (green) to the LED bezels – as any conductive surfaces on the exterior of the box should be properly earthed.  Next the cathodes of the LEDs were bent together and soldered in place with a ground wire (black).  Each anode then got its own signal wire (orange).

Next the navigation buttons received their common ground (black) and individual signal wires (white/grey).  Each signal wire not only connects to an input pin on the arduino, but also connects to the 5V rail via a 10k pull-up resistor.  This circuitry, however, I will deal with soldered directly on the proto-board.

After this my LCD needed its leads, so I soldered together the connections in the pin header sockets using red for 5V, black for ground and yellow for data lines.

lowbrau - low voltage wiring back

On the back panel the SSRs need their signals and common ground.  As the signal that triggers the SSR is physically the same pin that lights the respective LED I chose to use orange for these lines too.

All these various lines then connect each component to the arduino via a shield made from prototyping board.  I took strips of pin header and pushed the pins all the way through their black plastic strip so that I could keep the solder side towards the arduino.  Unfortunately the second bank of digital connections (data lines 8 to 13) are not aligned with the grid of the proto-board, so they need to sit on their own little board.  This is a slightly annoying feature of the way that the arduino has been designed – and the cynic in me wonders if it’s to create a market for people buying prototyping shields!

lowbrau - pcb

The main items that live on the circuit board are 5V, 12v and ground buses; the button pull-up resistors; the LCD contrast trim-pot and the buzzer transistor.  As a result, none of the circuitry is mind-boggling complex and a custom printed PCB is an unnecessary expense (although it would make for a far quicker job).

Once all this wiring had been completed it was time to flash the arduino and see if it all works.  And success!

lowbrau - lcd first run

Currently the LCD, navigation buttons, and LEDs are fully functional.  There are header pins for the SSR signal wires to plug into (allowing both halves of the box to split apart) and the transistor for the buzzer needs to go in.  My temperature probe has not arrived yet, so that only has some loose wires (purple) awaiting it.


LowBrau – Front Panel Hardware

March 5, 2013

After mounting the SSRs and heatsink to the rear half of the waterproof control box, I figured I’d plough on and fit all the front panel hardware.  As such this post doesn’t really have a lot of earth-shattering content, but I will run down a few of the items that make up this part of the build.

lowbrau - front panel inside

The green circuit board in the centre is the liquid crystal display which will provide the main interface for the user.  This module is a common HD47780 ($2.40) which is easy to interface with digital circuits – indeed arduino has a library specifically written to do just that, you simply need to specify which pins you have connected each of the LCD terminals to and away it goes.  I soldered some header pins on so that I can easily disconnect it from the rest of the controller wiring, should I need to.  I will need to work out how to protect the screen from knocks and liquid splashes, but that’s a challenge for another day.

Beneath the LCD sit four control buttons.  These provide the navigation inputs to allow the user to control the LCD.  I chose waterproof buttons, which don’t seem to be widely available cheaply so these ended up being close to $5 each!  Feels a little unreasonable but cannot be helped.

To the immediate right of the LCD are two LED indicators.  These will serve to provide a visual indication of the state of each output relay (ie whether or not the pump or heating element is switched on).  This might prove important in avoiding accidentally leaving the heating element on while the brew vessel is empty.

On the left side of the box is a power transformer to provide a 12V DC source for the arduino and buzzer to run off.  Again, this common 1A supply was quite cheap at only $7.50 delivered.

On the right side of the box is an IEC power socket to provide mains power to both the transformer and the heating and pump SSRs.  This socket was free because I simply unscrewed it from an old PC power supply – I can’t imagine why anyone would ever buy these new!

Finally, here’s a look at the front panel…

lowbrau - front panel hardware

I think the layout is looking fairly clean and functional.  It has to be said that there’s isn’t much room for variation because the inside of the control box, once all the components are in, is going to be very tight for space.  The navigation buttons might look a little cramped but they’re entirely usable, line up nicely with the LCD and free up plenty of space on either side for more components inside the box (for example the transformer sits under the blank space to the right of the LCD and buttons in this photo).

I certainly find cutting the holes a bit of a chore.  All the circular components are a dream, but the square holes of the LCD, SSRs and IEC connector all involve a disgraceful amount of filing to get them right.  I’m sure there must be a more efficient way, but I have yet to discover it!


Follow

Get every new post delivered to your Inbox.