Hyper-V: Install MS-DOS 6.22

MS-DOS 6.22 is actually available on MSDN for subscribers.  Well, the upgrade to MS-DOS 6.22 is available.  But there’s a slight trick you can play to allow the upgrade to become the full blown installable version.

Why install MS-DOS?  Frankly, I have this huge collection of DOS games that play no better than through a virtual machine running a version of MS-DOS.  While DOSBOX is a brilliant piece of software, sometimes the real thing is required.  Although Hyper-V doesn’t have a virtual audio card, no sound is better than no game.

The MS-DOS 6.22 Upgrade Package

The upgrade package comes with two directories of applications.  The first is DISKS; this is the directory which holds the actual floppy disk images of the original installation disks.  The second directory is UPGRADE.  This holds extracted applications for the release.

Most of us don’t have floppy disks anymore so we have to work with virtual disks.  Hyper-V requires VFD compatible images.  The images provided in the package are IMG format. The easiest way to perform this conversion is to use WinImage.  Download the package from http://www.winimage.com/download.htm.

WinImage-1

Open WinImage, choose File, then Open, then Browse to the location where you stored the MS-DOS 6.22 IMG files.  Select the 144upg1.img file to open it inside WinImage.

WinImage-2

Once the file has been opened immediately return to File, then Save As.  In the Save as type select Virtual Floppy Image (*.vfd, *.flp).  Name of the file as 144upg1.vfd.  Click Save.

WinImage-3

Repeat this process for the 144upg2.img and 144upg3.img files.

Creating a Virtual Machine for MS-DOS 6.22

Create a new virtual machine for MS-DOS 6.22.

Name:  MS-DOS 6.22
Store the virtual machine in a different location:  Checked
Location:  D:\Hyper-V\

MS-DOS 6.22 01

Generation:  Generation 1.

MS-DOS 6.22 02Startup Memory:  32Mb
Use Dynamic Memory for this virtual machine:  Unchecked

MS-DOS 6.22 03

Don’t connect a network connection to this virtual machine; if we want to install a network card our best chance is going to be the legacy network adapter that can be added post configuration.

Connection:  Not Connected

MS-DOS 6.22 04

For the hard drive configure it to 2GB of less.  Many DOS programs had issues with drives greater than 2GB in size.

Name:  MS-DOS 6-22.vhdx
Location:  D:\Hyper-V\MS-DOS 6.22\Virtual Hard Drisks\
Size:  2GB

MS-DOS 6.22 05

Choose to install an operating system later, then click next to open the summary screen.

MS-DOS 6.22 06

MS-DOS 6.22 07

A Bit Of Housecleaning

We need to make a change to the virtual machine’s boot order before we begin to save ourselves some heartache later.

Right click the newly created virtual machine and choose Settings.  Click the BIOS option on the left hand side of the window.  Then, click the Floppy option on the right hand side of the window and click the Move Up button until the Floppy option is the first option.

Installing MS-DOS 6.22

Connect to the newly created machine, then navigate to Media, Diskette Drive, Insert Disk.  Navigate to the directory where your converted VFD files were stored and select 144upg1.vfd.

Start the system.  On the very first screen, captured below, hit F3 to exit to the command prompt.

MSDOS622 01

Hit F3 again to confirm you want to exit and you’ll be greeted by a DOS prompt.

Before we can install this upgrade edition of MS-DOS onto our virtual machine we need to create a barebones installation of MS-DOS.

First, enter the command fdisk  and hit ENTER.

MSDOS622 02

Click 1 to Create DOS partition or Logical DOS Drive.

MSDOS622 03

Click 1 to Create Primary DOS Partition.

Enter Y to the question “Do you wish to use the maximum available size for a Primary DOS Partition and make the partition active (Y/N)?”

MSDOS622 04

The system will indicate that it requires a restart.

MSDOS622 05

When you get back to the first screen of Microsoft MS-DOS 6.22 Setup again press F3 to exit to the command prompt.

MSDOS622 01

Confirm your exit.  At the command prompt type in FORMAT C: /S .

You’ll receive a warning about losing all data on the drive.  Enter Y .

MSDOS622 06

Formatting of the drive will proceed and you’ll be prompted for a volume label.  Enter anything you’d like here; nothing is a perfectly valid choice.

MSDOS622 07

You want to reset the virtual machine now and return to the MS-DOS 6.22 Setup.

MSDOS622 01

Now you can hit ENTER  to continue the installation.  The next screen’s going to indicate that you already have a version of MS-DOS installed.  Highlight Continue Setup and replace your current version of DOS.  Then hit ENTER  to continue.

The next screen will ask you to confirm your country, date, time, and keyboard layout.  Correct these if necessary, then highlight The settings are correct. and hit ENTER  to continue.

MSDOS622 10

There’s no reason to install into a directory other than DOS unless you have specific plans.  Leave this at the default and hit ENTER  to continue.

Installation will begin and setup will prompt you for disk #2 and disk #3 when ready.  Change them using Media, Diskette Drive, Insert Disk.

MSDOS622 11

After all three disks have been processed you’ll be prompted to remove all floppy disks from the drives (Media, Diskette Drive, Eject).

MSDOS622 12Final step.  Hit ENTER to restart your computer with the new operating system.

MSDOS622 13

For someone like me who grew up in the C= 64/DOS era this is a beautiful sight:

MSDOS622 14

 

Posted in Hyper-V | Leave a comment

Hyper-V: Install Haiku

Haiku is an open source clone of the Be Operating System.  It’s an extremely slender and beautiful operating system which is quite fun to play with.

The latest stable release of Haiku is Alpha4 which is over three years old but it stills installs under Hyper-V fairly easily.  The only complication is the installation of the legacy networking card.

Download Haiku from one of the varied download locations.  Contrary to the instructions on the Haiku page I chose to use an ISO image.  Configure a virtual machine in Hyper-V as you would normally; the minimum recommended virtual hard disk size is 5GB.

Once the machine has been configured, right click it and choose Settings.  The first option on the left menu is Add Hardware; the right side of the window will list the various hardware that can be added to the virtual machine.  Select Legacy Network Adapter and then click the Add button.

Haiku-1

A properties page will appear for the Legacy Network Adapter.  Ensure that the appropriate virtual switch is selected and hit OK.

Haiku-2

Connect to the virtual machine, insert the downloaded ISO into the virtual DVD drive, and start the virtual machine.

From the first screen which appears choose your language, then click Run Installer.

Haiku-3

The next screen is information about the alpha status of Haiku.  Click Continue.

Haiku-4

You’ll arrive at the Installer screen.  Here we need to setup the disk partitions prior to installation.  Click on the Set up partitions… button.

haiku-5

On the DriveSetup screen you want to select the virtual disk you created, then click Disk, Initialize, Intel Partition Map.

haiku-6

A double confirmation box will appear.  Hit Continue to dismiss the first dialog, and Write changes to dismiss the second.  After a moment a dialog confirming the disk initialization will appear.

haiku-7 haiku-8 haiku-9

Expand the virtual disk drive and select the device named ” – ” with an <empty> file system.

haiku-10

Once selected click Partition on the main toolbar and then Create.

haiku-11

A dialog will appear allowing you to size the selected partition.  Leave everything at maximum, ensure the Partition type is Be File System, and ensure Active Partition is checked.  Click Create to create the partition.

haiku-13

A confirmation dialog will appear.  Click Write changes to continue.

haiku-14

Back at the DriveSetup screen.  We’ve successfully created the partition and now we need to format it.  From the Device window select the child of /dev/disk/ata/0/master/raw – it should be labeled /dev/disk/ata/0/master/0.

haiku-15

Once selected, click Partition on the main toolbar, then Format, Be File System.

haiku-16

A dialog box will pop up asking for confirmation of the change.  Choose Continue.

haiku-17

A second dialog box will now appear, prompting for the name (label) of the drive and the blocksize of the drive.  Its recommended to leave the default settings alone and to hit Initialize to start the format.

haiku-18

The prophecied second confirmation dialog box appears after selecting Initialize. Choose Write changes to continue.

haiku-19

After a brief moment a notification will appear that the partition has been successfully formatted.  Click OK to return to the DriveSetup menu.

haiku-20

Click the square in the upper left hand corner of the DriveSetup window to close it and return to the installation menu.

haiku-21

On the Installer screen select the newly formatted partition in the Onto drop down.  Click the Begin button to start the actual installation.

haiku-23

Once installation has finished the Stop button in the lower right corner will change to a Restart button.  Click the Restart button.

Haiku will reboot (quickly!) and come to the desktop screen.  The primary concern is whether or not the network adapter was detected and installed; to that end, once the desktop has finished loading click on the 2nd icon in the upper right hand side of the screen.

A small sub-menu will popup with an option to Open network preferences.  Click that.  A window will appear showing the information about the network adapter.

haiku-26

This indicates your network is working.  You have web access through WebPositive, located in Haiku, apps, WebPositive.  You’ll note right away that the legacy network adapter is much slower than native network access, as was noted in the configuration screen.

Side note:  There’s no virtual audio device within Hyper-V, although there are workarounds involving Remote Desktop Connection and bringing sounds locally.

Have fun exploring Haiku!

Posted in Hyper-V | Leave a comment

Windows 10: Use Hyper-V for Your Virtual Machines

This article does not apply to Windows 10 Home.  Only Professional and Enterprise.

Microsoft’s Hyper-V is the hypervisor which allows hardware virtualization on Windows 8 and Windows 10.  In short, it does the same thing as VirtualBox and VMware:  it allows you to run an additional operating system completely independently of the host (except for the management components of the hypervisor running on the host).

This capability has some requirements.

  • 64 bit operating system
  • Hardware assisted virtualization support (Intel VT-x or AMD-V)
  • An NX bit capable CPU (No-eXecute)
  • Second-level address translation aka nested paging (SLAT)
  • 2 GB of RAM.  More is better.

You may want to check that Hyper-V as bundled with Windows 10 is compatible with the operating system you wish to install.  I wasn’t able to find a page which had been updated with the Windows 10 information, but a Windows 8.1 version of the same can be found on Technet.

Checking Requirements

The required capabilities include a lot of hardware jibber-jabber so here’s how you ensure you’re compatible before attempting to run Hyper-V.

First, download Coreinfo from the Windows Sysinternals page.  Coreinfo is written by Mark Russinovich, a man whose genius I wish I could match.  Coreinfo returns the capabilities of your current processors.

HyperV 001 - Sysinternals Page

Open the downloaded file and extract its contents into a folder of your choice.

HyperV 002 - ExtractOpen a command prompt as an Administrator by searching for CMD, right clicking the Command Prompt option that appears and choosing Run as administrator.

HyperV 003 - Elevated Command PromptSwitch to the directory where you extracted Coreinfo and execute it using Coreinfo -v .  Read, understand, and agree to the Coreinfo License Agreement by hitting the Agree button.  And you’re spammed with a wall of text.

HyperV 004 - Coreinfo ExecutionHere’s how Coreinfo works.  It lists each feature it can detect in the first column, a – or * depending on the feature’s existence in the second column, and a short description of the feature in the third column.  A – indicates that the feature is not present; a * indicates that the feature is present.

Based on the above output, I don’t have an existing hypervisor present.  This is good; running VMware, VirtualBox, and Hyper-V on the same box doesn’t usually work and is a fast road to disaster.  My processor also supports hardware assisted virtualization (VMX) and extended page tables (SLAT).

The last piece to check would be the NX bit.  Most processors support this and have for quite some time so it’s not a huge worry.  To check for sure, execute coreinfo.  (Without the -v.)  You’ll get a ton of output – scroll up the console window and look for the NX feature in the third section of output.

HyperV 005 - Coreinfo Execution 2

Installing Hyper-V

Search for or open the Programs and Features Control Panel applet.

HyperV 006 - Programs and FeaturesIn the left panel of the window that appears, click the Turn Windows features on or off.

HyperV 007 - Windows FeaturesIn the next window, click the checkbox next to Hyper-V and click the OK button.

HyperV 008 - Feature SelectionInstallation will begin.

HyperV 009 - InstallationAnd finish, prompting you to reboot your computer.  This is one of those times when you really do need to reboot.

HyperV 010 - Install Finished

Creating a Virtual Network

Before we create a virtual machine we need to create a virtual network for the virtual machine to reside upon.  (Yes, I need a thesaurus for the word virtual in this article.)  If we don’t create the virtual network ahead of time, we’ll have to reconfigure existing virtual machines with the network.  It’s easier to create the switch ahead of time.

Why have a virtual network?  Isolation.  If you want to work with a situation that’s volatile (for example, with a virus) you want to be able to create a virtual network for your virtual machine to mitigate any possible adverse affects.  Or you may want to cordon off your virtual environments from each other, or only allow your virtual application server to communicate with your virtual SQL server, while configuring your virtual web server to listen on both physical and virtual environments.

Search for and run the Hyper-V Manager from the Start Menu.

Hyper-V Manager Icon

Once started, select your desktop computer from the list of machines on the left hand side.

Hyper-V Manager Screen

Right click your desktop computer’s name and choose Virtual Switch Manager.

Hyper-V Manager New Virtual Switch Step 1

Let’s examine the possibilities of the Virtual Switch Manager.

Hyper-V Manager New Virtual Switch Step 2

External virtual switches are the expected type.  They allow communication on the same physical network as the host PC using bridged networking.

Internal virtual switches allow communication between the PC and every other virtual machine on the internal virtual switch.  They do not allow communication with the physical network.

Private virtual switches allow communication only between the virtual machines on the physical host, but do not allow communications with the host PC itself.

In our case we want an external virtual switch.  You’re free to choose another type of switch if you’d like.

Select External from the list then click the Create Virtual Switch button.

Hyper-V Manager New Virtual Switch Step 3

Enter a name for the connection and choose which connection type to use for the virtual switch.  (This is another opportunity which is identical to the choice on the first screen.)  For the external network selection choose the network card to associate with.  For most PCs there will only be one option here.

Unless you have more than one network card you want to leave the “Allow management operating system to share this network adapter.”  If you were configuring virtual machines on a server with multiple network cards you might want to select a secondary or tertiary network card and then dedicate it to the virtual machine by deselecting this option.

Finally, leave the VLAN ID empty.  VLANs are virtual local area networks, dividing a physical network into… well, virtual networks.  (There’s that overuse of virtual.)  In our case we don’t want to configure or support a VLAN.

Click OK and you’ll be greeting with a warning box.

Hyper-V Manager New Virtual Switch Step 4

If  you have any file copies or other streaming activities occurring over your network you may want to postpone the application of the changes.  Otherwise, click Yes to apply them.

Using Ubuntu Linux as a Virtual Machine

We’re going to install the Ubuntu 15.10 release as a virtual machine.  Download the 64 bit ISO from the Ubuntu downloads page and save it somewhere memorable.

Search for and run the Hyper-V Manager from the Start Menu.  Once started, select your desktop computer from the list of machines on the left hand side.

Right click your desktop computer’s name and choose New, Virtual Machine… from the popup menu.

Hyper-V Manager Screen-Add New Virtual Machine

The New Virtual Machine Wizard screen will appear.  Click Next.

New Virtual Machine Wizard Step 1

Enter a name of your choice into the Name field; I used Ubuntu 15.10.  Accurately describes the virtual machine; I doubt I’ll run two or more Linux virtual machines.

I also chose to store my virtual machine in a location other than the default.  My C: drive is an SSD and I make as much effort as possible to keep data off it other than necessary.  (It’s quite old and only 120Gb in size.)

New Virtual Machine Wizard Step 2

Click Next to continue.

On the next screen you’re asked to choose between Generation 1 and Generation 2 for the virtual machine.  Generation 1 machines support both 32 bit and 64 bit operating systems and maintains hardware compatibility with previous versions of Hyper-V.

Generation 2, on the other hand, provides a UEFI BIOS, requires a 64 bit operating system, and has newer hardware available to it.

For Ubuntu 15.10 I’m going to choose to go with Generation 1.  UEFI isn’t friendly to operating systems such as Linux, and I don’t want to deal with the hassle of making it work.

New Virtual Machine Wizard Step 3

Choose the generation appropriate to your hosted operating system and click next to continue.

The next screen of the wizard is configuring the available RAM for the virtual machine.  The default is set to 1024 (1 GB), but if you can spare the RAM it’s worthwhile to allocate more.  There’s also an option underneath the memory allocation for whether or not to use dynamic memory allocation.

Dynamic memory is a feature that’s useful primary for hosts who are dedicated to running virtual machines.  It allows memory to be shifted to a virtual machine depending upon what the current load is.  You have to define the minimum and maximum amount of RAM available to the machine.  The maximum is the amount you enter into on this screen.

New Virtual Machine Wizard Step 4

Because I have 32GB of RAM on my workstation and because I hate using virtual environments that are underpowered, I entered 4GB here.

Click next to continue to the networking configuration screen.

New Virtual Machine Wizard Step 5

Here we want to select the previously configured network switch and click next to continue to the virtual hard disk configuration screen.

New Virtual Machine Wizard Step 6

The options here should be self explanatory and the defaults sufficient.  If you want to use an existing hard drive, select “use an existing virtual hard disk” and browse to its location.  Otherwise leave it as is and click next to continue.

The next screen is the installation options screen which presents you with the opportunity to install an operating system.  To make things easier, I generally install the operating system as a separate process.  This ensures that the virtual machine is created without issue and available.

New Virtual Machine Wizard Step 7

Click next to move to the final installation screen, the summary.  On the summary screen click finish to finalize the completion of the virtual machine.

New Virtual Machine Wizard Step 8

Back at the Hyper-V Manager screen we should now see the Ubuntu 15.10 virtual machine in the center window with a status of off.

Because we downloaded an ISO we need to add a DVD drive to the virtual machine.  Right click the virtual machine in the center window and choose Settings…  Select the SCSI Controller in the left hand window and you’ll be prompted as to what type of drive you wish to configure.

Virtual Machine Install DVD 1

Select the DVD drive and click the Add button.

Leave the Controller option as SCSI Controller and leave the Location where it’s at; ignore the “in use” notation.  It’s referring to the DVD drive you’re configuring.

I recommend against selecting the ISO file on this screen because it’s a permanent configuration option.  We can select the ISO file during the boot up process.

Virtual Machine Install DVD 3

Click OK.  You’ll be returned to the Hyper-V Manager.  Right click the name of the virtual machine and choose the Connect… option.

Hyper-V Manager Status

The virtual machine doesn’t automatically start when you connect to it.  You can also choose to start the virtual machine without connecting to it, leaving it run in the background.

From the startup screen click Media, DVD Drive, then Insert Disk.

DVD Drive Media Insertion

On the next screen browse to the downloaded location of the ISO file and click OK.  Then click the green start icon in the second menu bar to start the virtual machine.

The Ubuntu install will begin momentarily.  Walk through that normally.  Congratulations, you just installed your first virtual machine!  No VirtualBox or VMware necessary!

Posted in Server Administration, Windows 10 | Leave a comment

Windows 10: Running the Sam and Max Series

Sam and Max is a real pain in the neck to get running under Windows 10.  This post was originally intended for the GOG forums but their policy against links makes it… not so useful.  Instead, I’m posting it here.

OS:  Windows 10 v10.0.10586
Graphics Card:  GeForce GTX 970
Graphics Driver:  361.75

I make no guarantee this will work, nor do I guarantee your computer won’t implode.  I investigated the errors that occurred during game startup and found this resolution.  Based on other posts in this forum and Steam, I am wagering that these solutions will work for a great many of you.

Proceed at your own risk.

Install D3D9 from MicrosoftDo not use the web installer; it will not install if it detects newer (DX11+) files.

As noted below, install the DX8 to DX9 converter into the game directory.  (The file D3D8.DLL and ENBCONVERTOR.INI should end up in the same directory as the executable for the game, i.e. SAMMAX105.EXE.)  While you can install the converter into the SYSTEM32 directory I advise against this in order to minimize any potential issues with other games.

If you’re looking for solutions for the Steam version of the games, this should work as well.

All installations tested with an installer downloaded as of today, 2016/02/05.  All tests were full screen at 1600×1200 (S1) or 1920×1080 resolution (S2 and S3).  Obviously I didn’t complete the full game, but I did complete a couple of puzzles in each.  “Runs as installed” means that the game works after installation of D3D9.

101 – Culture Shock – Runs as installed.
102 – Situation: Comedy – Runs as installed.
103 – The Mole, The Mob, and the Meatball – Runs as installed.
104 – Abe Lincoln Must Die! – Runs as installed.
105 – Reality 2.0 – Install DX8 to DX9 converter; runs afterwards.
106 – Bright Side of the Moon – Runs as installed.

201 – Ice Station Santa – Install DX8 to DX9 converter; runs afterwards.
202 – Moai Better Blues – Install DX8 to DX9 converter; runs afterwards.
203 – Night of the Raving Dead – Install DX8 to DX9 converter; runs afterwards.
204 – Chariots of the Dogs – Install DX8 to DX9 converter; runs afterwards.
205 – What’s New, Beelzebub – Install DX8 to DX9 converter; runs afterwards.

301 – The Penal Zone – Runs as installed.
302 – The Tomb of Sammun-Mak – Runs as installed.
303 – They Stole Max’s Brain – Runs as installed.
304 – Beyond the Alley of the Dolls – Runs as installed.
305 – The City That Dares Not Sleep – Runs as installed.

Further help:  if the game still isn’t running for you find the game executable (SAMMAX###.EXE where ### is the episode number), right click it and choose Properties, then go to the Compatibility tab.  Ensure “Run this program as an administrator” and “Disable display scaling on high DPI settings” is selected and try again.  If that doesn’t work, select Windows Vista SP2 under “Run this program in compatibility mode for…” and try again.  If both of those fail, try running the compatibility troubleshooter – but that usually only results in the settings above.

Finally, the error message “such and such has stopped responding” or the like doesn’t help much but generally more information is logged to the event log.  Search for “Event Viewer”, expand Windows Logs, then select the Application Log.  Look for the most recent error (it will have an exclamation point in a red circle) and see what information is presented there.

Posted in Games | Leave a comment

Dual PC OBS Streaming Setup

My son enjoys streaming to Twitch and we’ve had quite a bit of fun – and struggle – setting up a dual PC setup for streaming.  Twitch has a guide available for setting this up and several other guides are available.  Unfortunately, a guide and the real world are often two different things.

This setup is the one that we found works.  I’m not guaranteeing that it’s the best setup, nor am I advocating it as the only setup.  It’s just an illustrative story for someone else who might be working on the same sort of thing.

First, the Gaming PC needs to be whatever you need it to be.  Our goal is to place 0 load on this PC, allowing it to play any and every game you normally can without concern.  This PC will be referred to as the Gaming PC throughout the rest of this post.  For reference, my son’s Gaming PC is:

Second, the Broadcast PC needs to be at least an i5.  There are options for encoding which can offload the encoding to an nVidia video card (NVENC in OBS) and to an AMD video card (OBS VCE) but the quality of the resulting stream suffers.  Even on a dedicated PC you’re going to want an i5 or i7 (or AMD equivalent, I’m not trying to push Intel chips).

The Broadcast PC is substantially under powered compared to the Gaming PC.

You’ll notice that we’re under powered compared to my recommendation of an i5 or i7.  You’ll suffer a lot less with a quad core CPU than a dual core, trust me.

We’re using the Elgato Game Capture HD60 capture card which is capable of hardware encoding of H264 video, but we’re not going to be able to utilize that particular ability.  This is unfortunate, and ultimately defeated the reason I went with the Elgato.

Video Setup

We need to direct HDMI output from the Gaming PC to the Broadcast PC.  We do this using a standard HDMI cord leading out from the Gaming PC’s GeForce 970 ACX and leading to the Elgato HDMI in.  We then route another standard HDMI cord from the Elgato HDMI out back to the monitor which was originally plugged into the GeForce 970 ACX.

The Elgato is a pass through device and it doesn’t appear to cause any lag on the output.  However, this setup does require that the Broadcast PC be powered on in order for the HDMI signal to be passed.  If the Broadcast PC is turned off the monitor on the Gaming PC will not have any output.

EDID is also passed through.  If the monitor is unavailable (due to cabling issues or power) the Gaming PC will not recognize a second monitor is attached.

Once this is setup you should be able to run your capture card’s software (Elgato’s Game Capture HD) and begin previewing.  The output of the Gaming PC should appear.

Audio Setup

There are multiple ways to successfully setup the audio.  The easiest solution is to activate the HDMI audio output device using the Volume Mixer in Windows.  The audio will then pass through the HDMI cable along with the video and the remote software will pick it up.

The problem with this setup is the microphone output.  You can route the microphone to the sound card using the line in, or you can use software to mix the microphone back into the speaker output, or with some sound cards you can choose to “listen to this device” in the audio driver setup.

Or you can go whole hog and get a hardware audio mixer like the Behringer XENYX502 5-Channel Mixer.  This is the route we took.  You should note that this mixer is for “professional” work meaning that the input and output jacks are 1/4″, not the 3.5mm used by most personal computer audio equipment.  You’ll need two cables that convert the 3.5mm to 1/4″ – these are used to connect the Gaming PCs line out (or speaker out, if you don’t have a line out) to the mixer’s second input, and to connect the mixer’s main out to the Broadcast PC’s line in (or microphone in, if you don’t have a line in).

Using a line in/out is much better for sound quality because these are unamped (thus unmodified) by the source and destination.

The cable pumps the audio output to the Broadcast PC but you probably have external speakers you’d like to hear the sound from.  You could hook the speakers up to the Broadcast PC but your sound would only function so long as something had the input signal activated.  The easiest way to maintain “normal” sound output is to use a 1/4″ to 3.5mm adapter, connect the PC speakers to the adapter, and then use the phones output on the mixer.

It’s at this point you’re likely to encounter ground noise.  Ground noise is “electronic noise on the ground wires or busses of an electronic circuit.”  It comes and goes and has no identifiable source, but definitely qualifies as a pain in the ass if you have no idea what it is.  The resolution to ground noise is a ground loop noise isolator.  Insert this between the 3.5mm jack and the 1.4″ adapter and the ground noise will be eliminated.

At this point we’re left with one piece of equipment to setup.

Microphone Setup

I wish I could say I was satisfied with how we have the microphones setup, but I definitely feel like I’m missing something.  First, you have to (partially) understand how microphones work.

Your standard 3.5mm jack microphone as used on a computer expects a +5V power source.  Channel 1 on the Xenyx 502 has both a 1/4″ input and what’s called an XLR input.  While you might expect to use an adapter like above to convert a 3.5mm to 1/4″ it won’t work because the 1/4″ input has no power to it.  The mixer is meant to be used with powered microphones and speakers.  (The XLR port provides +48V of phantom power for the connected microphone to use.)

So unless you’re mixing your microphone into your audio stream using one of the methods above, you’re most likely going to need a new microphone for this type of setup.

XLR microphones can get expensive quickly, but we managed to find one that was of decent quality for a decent price, the Knox USB/XLR Cardioid Microphone.

Microphone output is now connected to the Broadcast PC and your external speakers, but as we quickly found out the microphone is (of course!) not usable on the Gaming PC for whatever chat applications you’re using.  The XLR microphone is hooked up later in the process.

For now my son is using his headset to communicate with other parties, with the XLR mic doing the mixing of whatever he says into the stream.  The output of those other parties is already mixed into the stream, of course, by the stereo output.

OBS Setup

The Elgato software comes with Game Capture HD.  GCHD is pretty plain, with no bells or whistles to speak of.  If you’re looking at streaming nothing but game output, GCHD will do a damned fine job of it for you.  It is the only streaming software available which takes advantage of the Elgato’s H264 hardware encoding.

If you’re looking to customize your stream – with even so much as a webcam overlay – you’ll need to choose different software.  For our case we went with Open Broadcaster Software.  OBS does offer some hardware encoding – the NVENC option, or the custom build OBS FCE for AMD users.

I’m going to go over the settings screen for OBS and give an a brief explanation as to what each setting means and what it’s recommended setting is.

Install Open Broadcaster Software as you wish.  Open OBS up and then go to Settings -> Settings.

OBS-1

Type in a profile name of your choice, then click Add.  In the screen print below I’ve created the profile Game Capture HD60.

OBS-2

Next hit Encoding.  Let’s go over these options one by one.

OBS Setup – Encoding

OBS-3

Encoder represents how the video is taken and compressed for delivery to the streaming service of your choice.  The available options are x264, an open source encoder for the h264 standard, Quick Sync, and Nvidia NVENC.

x264 is your best choice unless your CPU is under powered as mine is and you want to offload some of the encoding to your GPU.

These options don’t appear to affect Quick Sync or Nvidia NVENC.  The Quick Sync encoding options can be set in the Quick Sync Encoder menu found on the left menu; the options for the x264 video encoder are:

Video Encoding::Use CBR:  Constant bit rate.  This should probably be checked in most circumstances.  It provides a more stable bandwidth usage, but will cause even scenes without motion to consume bandwidth.

Video Encoding::Quality Balance:  This is irrelevant if CBR is enabled.

Video Encoding::Max Bitrate (kb/s):  This is the target bitrate that the encoder will strive for.  It’s not a constant – if the encoder ends up at this setting + 100, it will leave it at that.  The recommended setting is 80% of your upload bandwidth, or 3500, whichever is less.  (Twitch recommends a maximum of 3300.)

The bitrate is the number of bits used to update the stream per second.  Without compression streaming video can become a tremendous strain on any system.  You can compute your natural bitrate using the calculator here.  Compression such as that used by h264 helps to tremendously reduce the size of these updates.  For a basic explanation of how that works with video, see this PDF at vcodex.com.

Your upload speed is your biggest limiter as to what resolution you can stream and what frames per second you can achieve successfully.  The easiest way to determine your upload speed in terms of kbps is to use speedtest.net.  Click on settings at the top of the screen and change the speed measurement unit to kilobits.  Run a speed test; in my case the result was 4,388 kilobit/sec.  80% of this was 3,510.  In the screenshot you’ll see that my bitrate is set to 2,000 – this is a setting often recommended throughout the Internet for 720p encoding.

Video Encoding::Enable CBR padding:  This pads a source to the target CBR when it falls underneath the target.  This option should be enabled.

Video Encoding::Use Custom Buffer Size:  x264 will attempt to a source using this buffer size; in most situations changing this isn’t necessary.  The recommended setting is disabled.  If it is enabled, the value should be equal to your max bitrate.

Audio Encoding::Codec:  AAC provides higher quality at a lower bitrate.  MP3 provides a lower quality with less CPU usage.  AAC is the recommended settings.

Audio Encoding::Bitrate:  This is the same discussion as above for video, but for audio.  Setting this below 96 is not recommended; 128 is the default and recommended setting.

Audio Encoding::Format:  This represents the audio sampling rate for OBS.  Recommended is 48kHz.  Unless you have reason to switch to 44.1kHz, you shouldn’t.  (Changing to 44.1kHz can have a negative impact on viewers of your stream as they’ll have to resample your audio to output it.)

Audio Encoding::Channel:  This controls whether stereo sound is encoded into the stream or mono sound.  There may be a small reduction in bandwidth using mono, but stereo is recommended.

OBS Setup – Broadcast Settings

OBS-4Mode:  Live stream.  The File Output Only option allows you to record to a file, perhaps for when you’re offline or performing a “greatest hits of…” type of broadcast.

Streaming Service:  Twitch.  Upon selection you may get a warning that your settings are not optimized for Twitch, and an instruction to hit the Optimize button to automatically set them.  It is highly recommended to optimize if this occurs.  It will prevent any bad blood from Twitch, at the very least.

FMS URL:  Once Twitch has been selected choose a server as geographically close to you as possible.  Team Liquid has both a bandwidth tester and Twitch ping you can run to see how your performance is against all of the Twitch servers; find the bandwidth tester here and the ping application here.

Play Path/Stream Key:  This is your stream key from Twitch.  To find it, login to Twitch.  Then click on your username in the upper right hand corner and go to Dashboard, then click on the Stream Key option and Show Key.

OBS-5

OBS-6Click on I Agree to the warning dialog that appears, then copy and paste your stream key from the window into OBS.

Auto-Reconnect:  Fairly self explanatory.  Automatically reconnect to your streaming service if something interrupts your connection.  Default and recommendation is to leave it checked.

Auto-Reconnect Timeout:  How long should OBS wait before automatically reconnecting.  The default is 10 seconds; some recommend it 1 second.  I left it at 10 because it usually takes a few seconds for whatever caused the disturbance in my connection to resolve itself.

Delay (seconds):  This is how long your stream should be delayed prior to broadcast.  This is useful when synching audio.  The default is 0 seconds, and should be adjusted on a case by case basis.

Minimize Network Impact:  This reduces how often OBS outputs data to the stream server, usually to mitigate local network impact.  It’s recommended off.

Automatically save stream to file:  Allows you to save your streams to a file as well as broadcast them.  User choice.

Keep recording if live stream stops:  Self explanatory, and user choice.

Replay Buffer length (seconds):  This is useful for saving snippets of the past, limited by the number of seconds you enter here.  This does consume RAM, as indicated by the estimated replay buffer memory usage.

Replay Buffer File Path:  This is the file where the replay buffer will be stored once the save replay buffer hotkey is pressed.

OBS Setup – Video

OBS-7Video Adapter:  You want to choose your primary video adapter, in my case an NVIDIA GeForce GTX 970.

Base Resolution:  Base resolution determines the resolution of your scene.  Your scene includes all of the composite elements of OBS, including the stream.  You’ll want to match the native resolution of your monitor.  This resolution is pre-downscale.  You want to avoid using the Base Resolution to resize your output as that will cause more blurriness.In my case my native resolution is 1080p, or 1920×1080 with an aspect ratio of 16:10.

Rather than statically defining a resolution you may want to use a monitor’s setting to define the resolution.  Select a monitor here if that’s the case.

Resolution Downscale:  You’ll be dying to stream 1080p @ 60 fps but it is highly unlikely that you’re going to be capable of that.  YouTube recommends a bitrate of 12Mbps for 1080p @ 60fps.  Twitch’s maximum non partner bitrate is 3500 and 3500 is not high enough to stream 1080p @ 60 fps.Most of the time you’re going to want to stream at 720p, or 1280×720.  This is a 1.5 downscale of 1920×1080 and is the (imo) best balance between resolution and size.

Filter:  This specifies the filter used when downscaling.  Beyond my ability to explain; more details is higher CPU usage.  I used Lanczos (best detail, 36 samples).

FPS:  The number of frames per second to broadcast.  Increasing this increases your bitrate requirements without a lot of benefit, although there seems to be a desire to broadcast at 60 fps.  I left this at 30.

Bitrate and Resolution In Practice

The best way to come to grips with the impact of bitrate, resolution, and fps is to see the variances in them.  Below I’ve recorded 30 seconds of gameplay in Fallout 4 with FRAPS @ 1080p and 60 fps.  You’ll note I didn’t quite maintain 60 fps during gameplay.

This input file is 1.68 GB in size.  This is directed into OBS using the Video Source plugin.  From there we encode the file as labeled.

1080p @ 30 fps @ 3500 bits/sec (12.6Mb):

1080p @ 30 fps @ 2500 bits/sec (9.14Mb):

1080p @ 30 fps @ 1500 bits/sec (5.65Mb):

720p @ 30 fps @ 3500 bits/sec (12.7Mb) :

720p @ 30 fps @ 2500 bits/sec (9.24Mb):

720p @ 30 fps @ 1500 bits/sec (5.77Mb):

OBS Setup – Audio

OBS-8Desktop Audio Device:  This should be your default audio device.  This is the device whose audio is mixed into the stream.

Microphone/Auxiliary Audio Device:  This should be your microphone, or line in on your sound card.

Force Microphone/Auxiliary to Mono:  Self explanatory; forces the microphone input to be monaural.

Show only connected devices:  If your device isn’t currently active or plugged in you may have to check this box in order for it to be displayed in the drop down boxes.

Push-to-talk Delay (milliseconds):  This is the delay between the key for push-to-talk being pressed and the activation of the microphone input.  Setting this higher can be used to delay input if you often hit your PTT key by accident.

Desktop Boost (multiple):  This represents an increase to your desktop audio.  1 is the default value; the value entered here is the multiplier applied to the desktop audio volume.

Mic/Aux Boost (multiple):  This represents an increase to your microphone audio.  1 is the default value; the value entered here is the multiplier applied to the microphone input.

Mic Sync Offset (milliseconds):  Delay the microphone input by this amount.

Hotkeys

OBS-9

This screen is where you set hotkeys for activating the various modes of OBS.  Since we’re using a two PC setup, and my son didn’t want to be worried about reaching over to another keyboard to activate one mode or another, we didn’t set any of these up.

Advanced

OBS-10General::Use Multithreaded Optimizations:  This will use multiple threads for color space conversion, maximizing benefit from multi-core CPUs. There’s almost no need to ever turn this off.

General::Process Priority Class:  Sets the process priority for OBS in the same manner as you can set a process priority through Task Manager.  As encoding can consume a lot of CPU, setting this to “above normal” can sometimes be useful to ensure capturing and encoding is done in a more timely fashion.

General::Scene Buffering Time (milliseconds):  Sets the amount of milliseconds the scene is buffered before being sent to the encoder. Only change this value if you know what you are doing.

General::Disable encoding while previewing:  This disables the encoder while a preview is active.

Video::NVENC Preset:  This is where you change the settings for the NVENC encoder.  Examples were provided above for the Lossless and Streaming (2pass) presets.  If you require the NVENC encoder I’d play with the various presets to see which gives you the best quality at the best price.

Video::Encoding Profile:  main is the default, and recommended by Twitch to stream.  You’ll note very little difference between main and high.

Video::Keyframe Interval (seconds, 0=auto):  Twitch requires the keyframe interval to be set to 2.

Video::Use CFR:  This is a compatibility option for editing applications by outputting duplicate frames if necessary to maintain a constant frame rate.  Default and recommended is checked.

Video::Custom x264 Encoder Settings:  This option should be left alone unless you’re very familiar with the x264 encoding options.

Video::Encode in Full Range:  Whether to use the (default) partial color range for x264 encoding or to use the full color range available.

Video::Allow 61-120 FPS entry in video settings:  This allows you to specify a frames per second higher than 60 on the Video screen.  Most monitors don’t go higher than 60Hz so a framerate higher than 60 isn’t worthwhile.  The recommendation is to leave this unchecked.

Audio::Force desktop audio to use video timestamps as a base for audio time:  This should be left off as it is meant to fix a legacy issue which should not occur.

Audio::Global Audio Sync Offset (milliseconds):  This is useful for synching your audio with the incoming video.

Audio::Use Mic QPC timestamps: When enabled OBS tries to use the Microphone QPC timestamps to synchronize your audio and video.  This is especially useful in high CPU situations where the input might fall behind.

Network:  All of these settings are useful only if the Minimize to Network Impact is enabled.

  • Automatic low latency mode: This should not be checked.
  • Latency tuning factor: This should not be checked.
  • Bind To Interface:  This allows you to specifically bind to a particular IPv4 or IPv6 address.
  • Disable TCP send window optimization:  This should not be checked.

Quick Sync Encoder

OBS-11

Quick Sync is Intel’s hardware video encoding and decoding technology integrated into some of its CPUs.  It was unavailable for me.

Browser

OBS-12

The Browser plugin allows a web page to be used as a source within OBS.

Microphone Noise Gate

OBS-13

Most of this screen is self explanatory.  A noise gate mutes the microphone input until the noise level breaks the thresholds set on this screen.

Scene Switcher

OBS-14

The Scene Switcher allows you to configure hotkeys which allow for switching between predefined scenes.  For instance during a loading screen you could switch to a web page displaying sponsors.

Use The Source, Luke

Once the initial setup is done we’ll need to configure the Elgato Game Capture HD as a source so that OBS can use it.  Click Global Sources… then click Add on the window which appears and select Add Video Capture Device from the pop up menu.

OBS-15

In the window titled “Please enter a name” enter whatever you’d like to name the Elgato and hit OK.

OBS-16

From the Device dropdown select the Elgato Game Capture device.  The Elgato has both 32 bit and 64 bit drivers available, so it should be available in both versions of OBS.

On that same Device Selection screen, under Video, check Use Buffering (milliseconds) and enter 1.

Back on the main OBS screen create a Scene and name it what you’d like.  Then right click the Sources window and choose Add, Global Source, and then the Elgato Game Capture device.

Once done you can click Preview Stream and your output from the Gaming PC should appear in the main window.

Posted in Games, Personal | Leave a comment

Windows 10 Insider Preview Warning: Don’t Change the Date

This will probably be obvious to many of you, but while testing an application yesterday I needed to change my system date to 2036 in order to test an overflow situation that had been occurring.  The Insider Preview edition of Windows 10 did not like this.

As soon as I changed the date my OS rebooted and came back up with the error message “a component of the operating system has expired” referring to winload.exe.  It gave me two choices.  Reboot into Last Known Good Mode or disable driving signing.  (Status 0xc0000605)

Neither was available to me.  Any attempt to navigate away from the error simply brought me back to the error, even after resetting the date and time in the BIOS.

So I attempted to do a repair install using Windows 10 media I created with their media creation tool.  No go; the repair installation would fail after working away for a few minutes.  In the end I had to do a fresh install on a formatted disk – a side by side installation wasn’t an option.

Thankfully, I had moved all of my profile directories off the main drive so formatting wasn’t actually that big of a deal.  I don’t know if changing the date affects the non Preview version of Windows 10 in the same fashion, and I don’t plan on finding out.

Posted in Windows 10 | Leave a comment

Moving Profile Directories

There are two locations which have historically been problematic from a storage management perspective in Windows; the ProgramData directory and the various directories under the Users’ directory.

The Documents, Downloads, Music, Pictures, and Video directories which are associated with a user account can be moved by the user from the respective item properties, as seen below:

Document Properties

That leaves the user profile information in C:\Users\<username>\AppData.  However, in Windows 10 these can be moved too!

Roaming Properties

The LocalLow and Roaming profiles can all be adjusted in this way.  The Local directory won’t successfully move because files are in use but Roaming is the most used of the directories.  (You can move the Local directory using another Administrator account.)

The ProgramData directory remains a problem to be dealt with, especially the installer cache found within it.

Posted in Windows 10 | Leave a comment

Windows 10 Integrated Application Removal Made Easy

If you’re looking for an easier way to remove the applications Microsoft has bundled with Windows 10, look no further than CCleaner.

CCleaner Uninstall Screen

Under Tools -> Uninstall you can find all of those applications.  Uninstallation is just a click away.  Much easier than my previously posted manual methodWARNING:  At least with v5.13.5460 (64 bit) don’t clean the registry with CCleaner.  If you do you’ll begin receiving errors about the banned app list and Windows Store.  Microsoft’s stance on registry cleaners is pretty much don’t, anyway.

Posted in Windows 10 | Leave a comment

Khan Academy: Algorithms

I’ve been a fan of Khan Academy for a long time now.  If you don’t know it’s a (completely) free web site which has video education on just about every topic under the sun.  For more information check the Wikipedia article on Khan Academy, or its founder Salman Khan.  It’s a really interesting story.

Anyway, I was just made aware that they have a section dedicated to Computer Science. Specifically, algorithms, cryptography, information theory, and how the Internet works.  For a lot of the folks I’ve worked with a proper CompSci background was never part of the picture.

The opportunity to work with an established educational site on these topics in particular should be of interest to anyone who wants to understand what they’re doing.  Cryptography is especially important in today’s day and age, but understanding various algorithms can make or break the performance of even a business application.

Even if you think you’re the master of these topics it might not hurt to get a refresher.  I’ve been trying to achieve 100% in the mathematics section and honestly, it’s been a struggle in a lot of situations.  I never want to discuss a rhombus versus square versus rectangle ever again.  :)

Posted in Online Education | Leave a comment

Regular Expressions Visualizer

Regular expressions are powerful.  Regular expressions are a pain in the neck.  I think anyone who’s worked with regular expressions would agree to both those statements.

I’ve done some recent work with regular expressions and I found a site that visualizes the evaluation of a regular expression, allowing you to view the groupings and qualifiers from beginning to end.

Debuggex.

It doesn’t support .NET syntax but for most of my work Javascript suffices.  (It also supports Python and PCRE.)  You can compare the differences between .NET’s RegEx implementation and another flavor by visiting http://www.regular-expressions.info/refrecurse.html if you’re worried about differences.

There’s a free account on the site and other, premium offers.  Frankly, I’d pay for the use of the visualizer out of my own pocket just to save my sanity the next time I’m working with XML.

Posted in Programming | Leave a comment