Monday, December 30, 2013

Fixing my analog audio problem

As I mentioned in a previous post, I was having problems with Source games when using analog audio.  Half-Life 2 would begin to slow down and get worse until crashing.  Team Fortess 2 would do the same.  Portal seemed to crash at specific times.

I think that I have found a solution.

I had been trying to remember this fix for some time, since I had used it to correct issues with pulseaudio when using multiple outputs at the same time.

Pulseaudio uses timer-based scheduling by default.  This is supposed to reduce CPU and power usage, and result in glitch-free operation.

Some ALSA drivers have issues that are exposed by using timer-based scheduling.  The ALSA HDA driver seems to be one of these drivers, at least by my experience.  The suggested workaround is to switch to the traditional interrupt-based scheduling.

This switch is easy.  On the Steam Machine (with beta repositories enabled and the OS fully updated), it was simply a matter of adding "tsched=0" to the line "load-module module-udev-detect" in /etc/pulse/system.pa .  After a reboot, Source games played using analog audio are issue-free (at least, they have remained so for a few hours apiece while I've been testing).

On a related note, finding portions of a game that reliably crash is easy... just play the game until something goes wrong, and then play that section again to see if it fails again.  However, testing fixes is as tedious as it gets.  Tweak something, play the same section again.  Remove the tweak, test the same section again.  Repeat.

I've played the "Route Kanal" section of Half-Life 2 over and over, for more hours than I think I ever put into the entire game, simply because it would reliably crash when using analog audio.

At least I'm getting really good with the Steam Controller in FPSes.

Friday, December 27, 2013

Starting from scratch for testing purposes - Steam Machine

Yesterday I brought the Steam Machine over to a friend's house to let him try it out.  What I got instead was a whole new type of audio issue.  This time, the audio would start cutting out, seemingly at random.

This new problem, coupled with the old issues I've been having, convinced me that it would be worthwhile to reimage the Steam Machine with the original configuration and see if it was better vanilla.

The process was easy, save for the fact that I had to remove my second drive (because the imaging software is relatively simple, and doesn't give you the ability to select which drive you want to image).

After reentering my login and network information and waiting for some games to download, it was time to play more Half-Life 2 (since HL2 is the game I've been able to break most often).

It worked like a charm on HDMI audio.  Smooth, beautiful looking, and no glitches.

I am waiting for TF2 to finish downloading to see if it displays any problems.

Unfortunately, I can't run analog audio without updating to the beta repositories, so I'll still have to go non-vanilla to get a conclusive result.  I'm not installing any extra packages, or doing any customization outside of adding the beta repo.

In the meantime, I can keep myself entertained by watching the "You're a bad person for installing Windows" argument that's taking place on the bug reporting site right now.  There are Linux zealots, argumentative sysadmins, and a few other zany characters.  It's quite a show.  It has, for the most part, remained a classy discussion, with no overt insults or any of that nonsense... But the undertones and subtle jabs are really quite good.

Thursday, December 26, 2013

Some trouble with Valve games on the Steam Machine

I've had some performance issues while trying to play through Valve games on the Steam Machine.  However, I can only recreate these issues under certain conditions.

The first pattern I've noticed is that Source games seem to get glitchy/stuttery/slow during and after drive reads, sometimes to the point of total crash.

The second is that these performance problems seem to occur ONLY when I'm using analog audio.  I haven't been able to reproduce them while playing using the HDMI out.

I also haven't been able to get any confirmation from other testers, so it may just be something odd about my system.

Does anyone know how analog audio and hard drive access (save, load, load level) might team up to create issues?  Or am I missing the forest for the trees?

Monday, December 23, 2013

Adding a drive to the Steam Machine

I wasn't going to mess with the hardware on the Steam Machine at all... I really wasn't.

However, my curiosity got the best of me.  So I decided to open it up and take a look inside.

With the beta hardware, it's incredibly easy to open things up.  I had to remove a single screw, then slide the outside of the case forwards and lift it off.  Super easy.

The inside is beautifully organized.  The graphics card takes up the entire left side, with a plastic cover that helps keep it in place and (more importantly) helps direct airflow for the card's cooling fan.  The hard drive is in a simple metal bracket.  There is room for a second 2.5" drive, and they've left a power and SATA connector there to tempt me.

Oh, all right.  So I put in a spare SSD and am typing this from an (unfinished) install of Windows 8.

The process was ridiculously easy.  Two screws to lift the drive cage, place the new drive on top of the old one, put the drive cage back down, and put the two screws back.

Here's a look at the inside, with my drive already installed:

And another look (you can see the ducts on the graphics card cover - front and back):

Windows 8 installed without any major trouble from a USB drive.
The only trick was making sure the Steam Box booted to Grub instead of straight to Windows.
This was done using these instructions from Arstechnica (the last bit is the important bit).

The network card isn't recognized, so it was useful to download the drivers in advance onto a flash drive.

I won't be using Windows 8 much (I still prefer 7, but 8 made UEFI boot very easy).  It's mostly here for comparison, and perhaps playing a few of the Windows-only games on this hardware.

As a last comment, I find the SteamOS interface to be more usable than Windows 8, barring the remaining bugs.


Sunday, December 22, 2013

Trouble with Logitech Unifying Receiver

One of the small but annoying little bugs I've encountered has to do with my Logitech k750 keyboard.

When the unifying receiver is connected to one of the USB ports on the Steam Machine, the receiver is detected (it shows up in dmesg and lsusb), but I cannot get input from the keyboard to register.  I've been using an old PS/2 keyboard to get started and troubleshoot the issue with the Logitech.

Going on a piece of information from a related bug report, I tried connecting the receiver via a USB hub, instead of directly to the box.

Oddly enough, this worked.

Looking at several bug reports for other Linux distributions has led me to the conclusion that this is an issue with the 3.10 kernel (which SteamOS currently uses).  There was a patch for the problem in 3.9, but it was removed for a real solution in 3.10... which turned out not to work.  It is also fixed again (for real this time) in the 3.11 kernel.

In the meantime, there are various utilities for configuring Logitech unifying receivers and their connected devices.  After installing one of these and manually disassociating and then reassociating the keyboard, I was able to get input while the receiver was directly connected (not on a hub).  I used the solaar package's command line tool.

So everything should be great, right?  Well... no.

For some reason, having solaar installed prevented the Steam Machine from getting through its next boot.  Uninstalling solaar immediately allowed the machine to boot again.

Weird, right?

The SteamOS developers mentioned in a comment that they are moving to the Long Term Support Industry (LTSI) tree, and that any fix to this issue will be held off until after this switch to see if the problem is fixed in the LTSI tree.

In the meantime, a USB hub keeps my keyboard working just fine.

Saturday, December 21, 2013

Audio Troubles Fixed in Beta Updates

As mentioned in my first post, I am using an HD monitor as my display, rather than a television.

This is important, because, out of the box, the Steam Machine was configured to use the HDMI audio output only.  SteamOS doesn't yet have a full-featured audio settings menu, and the analog output didn't even show up in desktop mode.

Some changes to PulseAudio's configuration files initially gave me analog audio in Steam, but not in desktop mode.  However, something about the nature of my changes caused audio in Metro: Last Night to cause stuttering and complete freezes.

For reference, after trying various lines, the only change I made was to add "ignore_dB=1" to the end of "load-module module-udev-detect" in /etc/pulse/default.pa.

Luckily for me, the developers put out a release in the beta repositories that changed the way the pulseaudio server worked (from per-user to system-wide) as well as some other tweaks.  Not only did their changes enable analog audio output in Steam, but it also enabled audio in desktop mode.

Enabling the beta repositories in SteamOS is relatively easy:
First, open a terminal and cd to /etc/apt
Edit the sources.list file.  Anywhere you see "alchemist," replace it with "alchemist_beta."
Save your changes.
cd to sources.list.d
Edit the steamos-secure-repo.list file, making the same substitution as before.
Save your changes.
Update your system using apt-get update and apt-get dist-upgrade.
Reboot.

Now you are running the newest (possibly not fully tested) updates.


The Controller

The Steam controller is a pretty neat piece of hardware.

The final version will have two circular trackpads with haptic feedback, left and right triggers, left and right shoulder buttons, left and right paddles, various standard buttons, and a configurable touchscreen in the center.

The beta controller is missing the touchscreen, which has been replaced with four configurable buttons.





In my testing, I've had a number of various problems arise with the controller.  Usually the problem is related to the trackpads acting strangely, which is usually fixed by simply disconnecting and reconnecting the controller.

The real problem with the controller is that you have to relearn mappings for each game, since there's no easy indication of which button does what.  This makes for a frustrating first hour or so for each game while you're still memorizing bindings.

However, once this is done, the controller is really very nice.  Currently, the beta is configured to send mouse and keyboard events, so games need to be set to use mouse and keyboard, not gamepad settings.  I am unsure of whether or not analog stick emulation is in the works (although that would be awesome for games like Strike Suit Zero).

Outside of games, the controller's right pad is used as a normal trackpad.  This works well, and I have no problem navigating through desktop mode using the controller instead of wiring up a mouse.

I've had no trouble playing Strike Suit Zero, Portal, and Metro: Last Night using the Steam controller (after getting used to the various key bindings).

Initial Impressions

Hello internet,
Being one of the 300 lucky hardware beta testers, I thought it seemed appropriate to share my experiences with the Steam Machine.

I've had about four days to do some testing and formulate an initial opinion, as well stumbling upon my share of bugs.

First of all, my specs:
  CPU: Intel Core-i5 4570 - 3.2GHz
  GPU: Geforce GTX 780 - 3GB
  RAM: 16GB
  Drive: 1TB Hybrid hard drive (8GB SSD for frequently used files)

As you probably have seen in other blogs and videos about the Steam Machine, the hardware was shipped in a heavy-duty wooden box.  Inside was the Steam Machine itself, the controller, various cables, a wifi antenna, and a recovery USB drive.

I will be testing the device on an HD monitor, which has no HDMI audio support.  As I'll explain in later posts, this distinction is important.

As I've been testing for several days, I have a few backlogged posts to get up, including ones about the first bootup, initial controller impressions, etc.

More to come very soon (pictures too).