Categories
Tech Explorations

Business in the front, party in the back: optimizing desktop setups for multi-PC applications

I recently started a new job as a network engineer and with it I got my first work laptop: a fairly decent Lenovo ThinkPad T14, and while I am a fan of portability and uncluttered workspaces, I much prefer to use external input devices along with a second monitor, especially if it is where I usually work.

Luckily I do have all of these things, a nice keyboard, a big 4K monitor, and a very smooth trackball (come on, you’ve read my articles already, you know I’m a weirdo like that). They are however connected to my personal laptop, and I don’t have a big enough desk (or wallet, for that matter) to duplicate it all. Some sharing is in order.

In my desperation, I reorganized my desk with the help of a few gizmos, which allows me to quickly switch my input devices and monitors between laptops, while maintaining independence between both systems, and in a way that doesn’t turn me absolutely crazy. This is how I did it.

Problems, half measures, and a sore back

My job is essentially entirely remote: I’m basically half front-end developer, half tech support; I answer emails, read and compose docs, stare at code, and participate in meetings. Since I didn’t have much experience in having two computers, I just plopped it next to my big rig and just went to work for a couple of days. Immediately, many problems appeared:

  • My back was sore: Laptops on desks usually have you facing downwards at the screen, and since it’s a small screen and a big desk, my back was certainly feeling it.
  • Laptop keyboards and trackpads are a pain in the long run: they are small, key travel is tiny, and they usually don’t have a numpad. The T14 certainly has one of the better keyboards in the market right now, but an actual key switch would be much better. The trackpad is certainly good (especially with its hardware buttons on top), but it’s fairly small and cramped (and don’t even get me started on the ThinkPad Nippleā„¢). Also, raising your computer up to eye level makes them even harder to use.
  • Limited screen real-estate: the screen is a 1920×1080 IPS 14-inch display, which is great, but it’s small: the scaling has to be big in order for text to be legible and being accustomed to dual-monitor setup just made it a pain overall.

Because all of my current setup works with a single USB-C port (more on that later) I just put my work laptop on my stand and used it like that for a while, but that quickly made evident that switching devices all day was going to be a messy and non productive solution. What are my choices here?

Well, I could just use my personal laptop for work, but that is a recipe for disaster: mixing business and pleasure in general is a bad idea for privacy and security reasons, but there’s also other security measures in my work device that would make it difficult, if not impossible, to get everything running as it should.

I then turned to the idea of using the laptop as a pivot computer: it just sits in a corner chugging away and I just have to open a Remote Desktop Connection to it: RDP has a sophisticated feature set including device and clipboard sharing, bidirectional audio for calls, the works. This seemed like a great idea, I could share all of my devices on my personal computer to my work computer and everything would be sorted, right?

Not so fast. My work device runs Windows and you can go to Settings and enable RDP, but the real problem was Active Directory: all of my login data is on a company server to which I have no access to, and the Remote Desktop Server on my just refused to play ball with it: I got certificate issues, authentication issues, connection issues, and I just couldn’t get it to work. If this was Windows Server, I could probably massage the service enough to make it work, but it isn’t, and it’s probably for the better: if a remote desktop is compromised, you can cause catastrophic damage on everything you have access to, as the device doesn’t really distinguish between a remote session and a local one, so back to the drawing board it was.

I tried other solutions, but they all failed in one way or another: switching inputs on my monitor? Doesn’t solve the device problem. Other remote desktop protocols like VNC or AnyDesk? either they didn’t have device support or I had to pay subscriptions, along with having to install unauthorized software on my laptop, a big no-no.

My only recourse was hardware: a dedicated device handles sharing and switching devices between computers, while the target computers are none the wiser. But how was I to implement this and have it play ball with my current setup?

My previous setup

My personal laptop is an HP Victus 16, sporting quite a few peripherals:

  • Logi G513 Carbon with MX Brown switches and custom keycaps. (over USB)
  • Kensington Trackball Expert wireless pointer device. (over USB)
  • Dell S2721QS 4K 21-inch monitor running at 1440p for better performance.
  • Behringer XENYX 302USB audio interface (over USB)
  • Gigabit Ethernet over USB from my dock.

This setup has my laptop screen as the main display, with the monitor over to the side, with all devices connected via a USB-C dock. This allows me to have everything connected with just two cables (the other one being a power supply, being a “gamer” model with high power consumption). I really like docks for their flexibility, and with USB-C native video transport and the high speed USB 3 data link, I can switch from on-the-go to static and vice versa in mere seconds, all while having hidden cables and reduced clutter.

This is very much a tangent, but I’ve always found docks the coolest thing ever. Ever since I saw an OG IBM ThinkPad in my dad’s office desktop rocking Windows XP and a massive dock back in like 2006 I’ve appreciated the massive advantages in commodity and portability. My first laptop had a massive dock connector on the side, and USB-C has finally given me the possibility of running power, video, and data over a single cable. If you have a laptop sitting semi-permanently in your desk, I highly recommend you get one. Sure, laptops are loud and underpowered compared to equivalent desktop PCs, but if you need portability, it doesn’t really get much better than this.

I’ve been using a Baseus Metal Gleam 6-in-1 USB-C dock: they have 3 USB 3.0 ports, USB-PD passthrough, an HDMI output, and a Gigabit Ethernet port. It’s enough for my needs and are also small, which meant I could mount it directly to the stand the laptop sits on top of.

Now I had to decide on a new layout: how exactly was I going to place two laptops and a monitor in my desk without losing all my space?

Introducing the KVM

Having all of these in mind, these were my objectives:

  • The monitor will now become the primary screen, switching between devices as needad.
  • The keyboard and mouse must switch between laptops in sync with the screen.
  • I need to hear the audio of both computers simultaneously, although the main one would be the personal one.
  • Whatever device does the switching must have some sort of remote, in order to hide it under the desk for better cable management.

For my work computer, I just duplicated my setup for my personal computer: a laptop stand and another of those USB-C dock things. The audio situation was also simple, as the Behringer audio interface I’m using has a secondary stereo output called 2-TRACK. using a simple USB sound card, a ground loop isolator (for preventing buzzing sounds) and some random 3.5mm to RCA audio cable I had both devices in my headphones without issue.

For the screen and the USB devices, I needed a KVM switch: a clunky acronym standing for Keyboard-Video-Mouse, it’s exactly what it sounds like: you press a button, and your keyboard, mouse, and monitor are now connected to another machine. These are fairly niche devices mostly relegated to server racks and other specialized applications, but they can still be found for cheap in the power user electronics market.

I got a UGREEN CM664 HDMI-USB KVM switch from AliExpress for cheap, and despite it’s low price it has everything I need: HDMI video switching, USB 3.0 switching, and a cute little wired remote perfect for adding to my keyboard. It’s also fairly small, only big enough to fit all the large connectors, and requires no software, it’s just an HDMI pass-through and a USB hub that can switch devices.

Not to get too deep into the weeds in here, but this device physically disconnects all the interfaces during switching. This means devices have to be recognized and initialized, and a second screen must be instantiated and all windows reordered, something that takes a couple of seconds in total. This is not a problem for me, but there are some KVM switches that emulate the presence of a device while another computer is active in order to make the transition almost seamless, but that seemed a bit excessive for this application, especially for the considerable price hike.

Now it’s just a matter of hooking up everything together and we’re done, right?

A cable management nightmare

Well, not so fast. You may have noticed there’s a lot of cables in the mix: tons of USB cables, network cables, audio cables, power bricks, the whole shebang. If not kept in check, this could quickly become a giant octopus of messy cables that can quickly eat up desk space and just flat out look ugly.

My desk also has some storage underneath that must be able to be slid out, so it’s flat out not an option to have cables dangling behind it. To solve this I just used zip ties and a clever twist on the usual mounting clips: I really wish those plastic mounts with adhesive backing worked: I really like them, but having cables pulling permanently on a piece of double sided tape just guarantees they’ll pop off at some point.

A better solution for me was a box of short washer-head screws: the wider head makes it easy to grab a zip tie under it, while being discreet enough to grab a bunch of cables without pulling out. Granted, you’re putting holes in your furniture, but I have found time and again that it is a worthwhile sacrifice in order for the cables to stay put for long periods of time. The screws are also reusable: just back them out a turn or two and the zip tie will come right out.

Once I got my enormous bundle of cables under control, it was time to test it out.

Performance and quirks

Overall, the whole thing works great: I can quickly switch between both laptops, sharing devices without an issue. I attached the remote to a corner of my laptop, which gives me a clean look and easy access to it. The switching is fairly quickly and all apps quickly rearrange when the second display is detected, which is very useful when returning to a computer after a switch. Also, having the laptop screen still showing is great for situational awareness when you’re working with both laptops at the same time. The entire setup uses slightly more space than it used to, but it’s a marginal difference in comparison to all of the advantages it has brought.

I thought having shared audio for both devices would be a bit of a mess, but surprisingly no: hearing notifications from the other computer while playing music or keeping a call going while switching computers is extremely useful, and the expected overlap of sounds have turned out to not really be a problem.

The KVM switching process, with it’s rediscovery and rearrangement of devices and applications, takes a couple of seconds, but it isn’t really a problem, at least for my sensibilities. I do wish the KVM had some sort of optimization for preventing the lag in USB devices, which I feel is slightly too much.

There is also the problem of sleep: you have to tweak your settings to prevent the computers from going to sleep while you’re looking at them: since it’s very much possible that I’m not interacting with the device for a while, it’s not an unreasonable assumption that the device is ready to sleep, even if it isn’t.

Closing thoughts

Overall, this KVM solution has pretty much solved all my problems of parallel laptops: the devices are shared without a problem, and my desk has not been entirely consumed in the process. There are some quirks, but overall the device does exactly what it should.

I do feel however that it’s very involved process: as work-from-home gets turned into an ubiquitous form of labor, I fell that a hardware solution that just does this for you, with some degree of ability for customization, could be a real game changer for all of us in this situation. This is a thing that should be so much easier, but it just isn’t, and there aren’t many approaches in the market that don’t require this kind of tinkering, but if you are so inclined, you can make it work.

I just hope I never see the day when a third computer has to be integrated.

Categories
Tech Explorations

Dirt-Cheap Livestreaming: How to do professional quality streaming on a budget

A couple of years ago I wrote an article on how I cobbled together livestreaming hardware at the very beginning of the pandemic. Finding AV equipment was very difficult, so I did what I could with what I had. Almost three years have passed since then, and in the meantime I built a multi-camera, simulcasting capable, live event oriented livestreaming solution on a shoestring budget. Many compromises were made, many frustrations were had, but it worked.

This is how I built it and made it work.

Why bother changing it?

After my initial stint doing a couple of livestreams for small events, the requirements kept popping up, for simple one camera setups my equipment would do, but it quickly started falling short; and as venues slowly started filling back up with people, I just couldn’t rely on building the event around the camera. I had to find a way to do this without being intrusive, and to be able to fulfill my clients’ needs.

Lessons from the previous setup

The setup I described in the previous writeup was not free of complications. On the video side, I was limited by a single HDMI input, and any switching solutions I had were too rough for my geriatric capture card; it would take way too long to reacquire a picture. On the audio side, my trusty USB interface was good, but way too finicky and unreliable (the drivers were crap, the knobs were crap, and while I got it for free it just wasn’t worth the hassle) for me to be comfortable using it for actual work. I also had a single camera, very short cable runs, no support for mobile cameras, and an overall jankiness that just would not cut it for bigger events.

A new centerpiece: ATEM Mini

My first gripe was my capture card. I was using an Elgato GameCapture HD, a capture device I bought back in 2014 which could barely do 1080p30. I still like it for its non-HD inputs (which I have extensively modified and a story for another time), but the single HDMI input, the long acquisition times, and the near three second delay in the video stream made it super janky to use in practice.

After a month and a half on a waiting list, I managed to get my hands on a Blackmagic ATEM Mini, the basic model, and it changed everything: it has four HDMI inputs, an HDMI mix output, USB-C interface, and two stereo audio interfaces, along with fully fledged live video and audio processing: transitions between sources, automatic audio switching, picture-in-picture, chroma and luma keying, still image display, audio dynamics and EQ control and so much more. Its rugged buttons and companion app make operating the ATEM Mini an absolute breeze, and its extensive functionality and integration makes it the closest thing to an all-in-one solution. Many things that I did using lots of devices and maximum jankiness were consolidated in this one device. Anyone who is getting into livestreaming should get one of these.

Dejankifying my audio

Having good audio is almost more important than having good video; a stream with mediocre video but good audio is serviceable, one with good video and bad audio is almost unbearable. Because most events I work on have live audiences on-site, there is no need for me to handle microphones or other audio equipment directly: most mixers have a secondary output I can tap into and get a stereo mix that I can pipe into the ATEM Mini. For line-level unbalanced inputs I can connect them straight into the ATEM, and if I needed something more involved like multiple audio sources, preamplification, or any sort of basic analog processing I keep a small Phonic AM440D mixer in my equipment case, which gives me endless flexibility for audio inputs.

One of the advantages of using common hardware for audio and video is that both streams are synchronized by default, which removes the need for delaying the audio stream entirely, which once again reduces the complexity of setting up livestreams in the field.

New cameras and solving the HDMI distance limitation

For a while, a single Panasonic HDC-TM700 was my only video source, with an additional Sony camera on loan for some events. This was one of my biggest limitations, which I set out to fix.

Most semi-pro/pro cameras are way too expensive for my needs: even standard consumer cameras are way out of my budget, a single camera like the one I already have would need a couple of months worth of revenue, which given that I’m still at university I couldn’t ramp up. There are ways out though.

For one, I thought about USB webcams. There are some good ones on the market right now that are more than enough for livestreaming, but they are very much on the expensive side and I have never liked them for something like this: poor performance at low light, small, low quality lenses and fixed apertures, and low bitrates are just a few of my gripes. Also, I had a better capture card that could take advantage of HDMI cameras. So I looked around AliExpress, and found exactly what I was looking for: Process Cameras.

A process camera is essentially a security camera with an HDMI output. They have no screen, fixed (although decent quality and reasonably large) lenses, and a perfectly usable dynamic range. Since the do not have a screen or autofocus capabilities they are best used for fixed shots, but most of my streams rarely require movement (for which I have the other camera). Best of all: they were very cheap, at around $100 a piece if you included a tripod.

Now, we need to talk about HDMI: It’s a perfectly good standard for home use, but it has some problems in this use case (which we can forgive, this is very much an edge case), the biggest one being max distance. HDMI rarely works above 10m, and even 5m is challenging without active cables and devices that can actually drive cables that long. There are optical cables which can take them over the 10m mark, but these are expensive, bulky, and stiff, which complicates using them in events where they could end up in the way. The solution is somewhat counter-intuitive: just don’t use HDMI cables. But isn’t it the best way to do it in this case? Yes!

See, just because we’re using HDMI signals doesn’t mean we need to adhere strictly to the electrical specification as long as we can get the message across while converting it to a physical medium better suited for long distances. There are many ways of doing this, some use coaxial cables and HD-SDI, others use simple fiber optic patch cables, but I went for old twisted-pair Cat5e: It’s cheap, it’s available, and there are ready-made converters with an HDMI connector on one side and a 8P8C plug on the other. Add a 3D-printed bracket for mounting it on the side of the camera and some small HDMI patch cables and we’re off. With these converters I can get 25m runs no problem, and even 75m in extreme cases, which is enough for most venues.

This was not the only use for a 3D printer: I made custom power bars which hang from a tripod’s center hook, for powering cameras and converters.

Better networking and server equipment

In my previous article I used a Raspberry Pi 3B+ to run an NGINX server with the appropiate RTMP module and some extra software to make a simulcasting server, where a single stream can feed multiple endpoints. This worked great, but Raspberry Pis are a bit anemic and I wanted something with a bit more oomph in case I wanted to do more with it. The idea of a portable server is useful for me not only for streaming, so I grabbed a 2011 Mac Mini on Facebook Marketplace, swapped the hard drive with an SSD and off I went. The additional RAM (4GB instead of just 1GB) allows me to have more services set up without worrying about resources and the beefier Intel Processor allows me more freedom to run concurrent tasks. There is even some QSV work I could do to use hardware encoding and decoding, but that’s a story for another time.

I also ditched my 16-port rackmount switch in exchange for a cheap Netgear WNDR3400v2 wireless router, which gives me a nice hotspot for connecting my phone or in case someone else needs it; the new router is much lighter too.

A portable camera jank-o-rama

For a couple of scenarios, I really needed a portable camera that was fully untethered; maybe for showcasing something, or to keep an eye on the action while on the move. There are some wireless HDMI solutions but it always felt like loosing a good camera for an entire shoot (I usually run a one-man operation, so it was pretty much always a short run for the portable camera), and the cost argument kept popping up.

The way I solved it is to me as janky as it is genius: just use your phone. Most modern phones have excellent cameras, decent audio, and even optical stabilization. I used Larix, a streaming app to create a streaming server that I broadcast over WiFi (see why I needed a wireless router?) to be picked up by OBS. Unreliable? a little bit. Has it ever mattered? Not really, this capability is more of a novelty and a fun thing to add to my repertoire, but not meant as a centerpiece. I have even toyed with a GoPro Hero 7 Black streaming to my RTMP server and picking it up from there, which works, albeit with lots of lag. It’s a bit of a pain to not have it in my ATEM switchboard and having to switch it over OBS, but, you know, it’ll do.

Miscellaneous

Until now I carried everyting on a duffel bag, which just wasn’t going to work anymore: the weight killed my back anytime I went near the thing and there just wasn’t enough space: so I needed something like the big wooden cases that the pro audio industry uses, without breaking the bank. I just took an old hard-side suitcase and crammed everything in it. It’s big enough for me to house most of my stuff but not too big as to be bulky, and allowed me to keep everything tidy but without wasting space.

Because my new cameras don’t have a screen, setting up the shot and focusing can be a challenge. I usually resorted to using my second monitor to do so, but it was always janky and time consuming. To solve this, I bought a CCTV camera tester with an HDMI input. This is essentialy a monitor with a battery, for way less than a professional one.

I needed lots of cables, some of them really long. I ended up buying rolls of power and Cat5E cable and made them myself. My standard kit includes four 25m Cat5E rolls and a 75m one in case the network jack is far away, plus three 20m extension cords so I can place the cameras wherever I want. This is not including the three power bars for the cameras and a fourth one for my computer.

So what comes next?

To be absolutely honest, I think this is as far as this setup goes. Livestreaming jobs have dried up now that the pandemic has quietened down, and pursuing more stable ventures would require lots of investment, which I’m not really in a position to make. I found a niche during the pandemic, and I milked it as much as I could, I’ve paid for the equipment two or three times already, so I’m not complaining, but until I find the time to do that YouTube channel I’ve always wanted to do, I don’t think it’s going to see the light of day for a while.

Closing thoughts

I’ve had some tremendous fun building up this setup, and for my uses, it has proven itself time and again as a dependable if basic setup. Maybe you can get your own ideas to get creative; many of the lessons learned here are very much applicable to other streaming opportunities and who knows, maybe you’ll get some ideas to get creative with this media.