Tuesday, 10 July 2012

Project: Headphone & Speaker Selector

Choice. With the way and where my computer is set up at the moment, sometimes I use the speakers built into my monitor to listen to music, sometimes it's more appropriate to use my kick arse Sennheiser headphones instead. Being that my computer is set up in the corner of the lounge room, the headphones allow everyone to have their way. The problem is if I want to use the headphones after I've used the monitor speakers, I have get under the desk and unplug cables. This usually results in me hitting my head on the bottom of my desk, and swearing gratuitously. And it's just a mild inconvenience.

So I had the idea of building a small selector with a rocker switch. Everything would stay plugged in neatly to a small box on my desk, and to switch outputs I simply alternate the rocker switch. Seemed simple enough, so I came up with this.


The original concept circuit diagram...before things went horribly wrong.

This all looked great on the screen, seemed logical in my head. Both outputs would have shared left and right channels, and the earth would be switched by a SPDT rocker switch (http://www.jaycar.com.au/productView.asp?ID=SK0991). The logic was that without an earth the inactive output would be exactly that - inactive. Unfortunately this is not how things work in reality, and it resulted in all sorts of unexplainable observations and continuity readings. Basically the rocker switch did not work as desired, and the left channel on both outputs was intermittent to missing altogether. Back to the drawing board.

Further Google Fu-ing revealed someone else that had had the same need for a device like this, and they'd been kind enough to blog about it and post a circuit diagram. Which I shamefully stole and forgot to get the link for crediting (if it's yours, let me know and I shall credit you). It is the same principal, just the opposite - both outputs share their earth, and it is the left and right channels that are switched by the rocker. This meant I needed a DPDT 6 pin switch, which funnily enough Jaycar didn't stock (in rocker form, anyway). Ebay had my back. Basically the unit as before, just twice as many pins.

The circuit I ended up following. Notice how it is basically the total opposite I what I designed.

After waiting about two weeks for my new switch to show up in the mail, I realised the small plastic project box I had initially built my failed design into wasn't actually big enough to handle the new 6p DPDT switch. So I scrounged around....and found the left over box from out ATV2 unit. It's actually a decent box, as far as being excited about cardboard goes. I cut it down so that I had just a short section of the bottom. As an enclosure for the device, the bottom will remain open just for convenience, but it won't be seen unless it's picked up off the desk.

Testing the assembled circuit BEFORE putting it all into it's enclosure. Foresight! FORESIGHT!

And it worked. As you would expect. Which needless to say I'm pretty fucken happy about. One step closer to total automation/death by physical inactivity.

The bottom of the device, showing all inputs/outputs, and the 6p DPDT switch.

The finished product. Like a boss.

And that's it. It's not overly pretty; I mean I could have gone to Jaycar and bought a suitable enclosure. But that means stuffing around drilling holes (I don't have a drill), making a mess, spending more time on it than I can be bothered. And this way uses stuff I just had lying around. Enjoy.

PS: apologies if the formatting in this post looks SUPER shit. For some reason the blogger text editor is being a pain to do simple things today.

Monday, 2 July 2012

Project: Home Media Solution

Stuck. We had just moved out of a house with a great media set up. It had a purpose-built PC in a slim line case, 2TB HDD, and everything necessary to output 1080p. Each of us had our own computers running wirelessly off an ADSL2+ 20Mbps (max) internet connection, through a beastly a/b/g/n triple antenna router (not sure what specifically). This allowed anyone to download anything they felt like watching, and "push" it to the media PC for watching as they pleased. Although it was usually quicker to copy via a small 500Gb passport drive; we didn't get around to USB 3.0. Anywho, the media PC ran MediaPortal (http://www.team-mediaportal.com/), a very capable free and open source piece of software that beautifully categorizes and displays all of your media content in a highly customisable  interface. It rarely had any issues, downloaded art automatically, and was generally awesome. So that was great until we moved out, and had to find our own solution. I looked into a similar setup, building a purpose-built PC, however it got pretty expensive pretty quickly (~$600). Unfortunately HDDs have been expensive lately due to a factory in China where most components for most HDDs are made flooding, and stock being in a bit of a shortage.

About a year before that, we received an Apple TV 2 as a gift (to compliment a new tv we'd bought). Unfortunately, anyone who has used it will know they're a fucking useless pain in the arse. A lovely to look at menu, but unless you're happy to pay for every single thing you want to watch (and probably have "anonymous" usage statistics recorded and sent periodically), even if you already own it in hard and digital formats - it is literally a paperweight. The way it works is when you sign into it with your Apple account (oh yes), you may then wirelessly (or ethernet LAN) stream media in your iTunes library (oh yes) to it via your home network. I know, you see the obvious problem here - you have to have an internet connection (to verify your Apple account sign in), you have to use iTunes, and it has to be media in your iTunes library (of Apple recognised and signed format). So yeah, great. I spent a few days converting about 300Gb of movies into what I thought was the right format to import in iTunes and stream to the ATV2. The closest we got was a movie playing - without sound. At that point in went back in it's box and was thrown into the back of cupboard likely to never see the light of day again. Until we moved, and it was suggested to see if it could be "modified" to be a lot more user friendly.

Jailbreak. About a month ago I started looking into hacking the ATV2 into running a different operating system. Perfect timing too - a hack and jailbreak kit had just been released allowing the media program XBMC (http://xbmc.org/) to be flashed onto it. XBMC is the XBox Media Centre, which has been ported to many platforms, and is probably the most popular media program around. Probably, I don't know. I went for the most brutal jailbreak option: permanent (untethered). There is a non permanent option (tethered), which resets to non-jailbroken status after a reboot. Which I really can't be fucked with. So, with this software and instructions (http://www.appletvhacks.net/2012/06/06/how-to-jailbreak-apple-tv-2-5-0-2-ios-5-1-1-using-seas0npass-untethered/), I SSH'd into the ATV2 over wifi, and started running Linux commands to install software from the appletvhacks.net repositories. Didn't take overly long.

SSHing into the ATV2 over wifi to force it to be my bitch.

Like with any Apple hardware, it tends to take a while to install/upgrade things. But no biggy. After some setting up (adding SMB servers to XBMC, setting folders permissions in Windows 7 on both PCs, etc), we can now browse and watch/listen our entire video and music collection across two separate PCs. As an added bonus, both of our phones can control playback remotely over wifi as well (iPhone 4 via AirPlay, which allows you to select XBMC or Frontrow [that's the standard Apple TV software, which is still operational outside of XBMC if you choose to use it] as the playback arena; and SGS2, via the XBMC Remote app - https://play.google.com/store/apps/details?id=org.xbmc.android.remote&feature=search_result#?t=W251bGwsMSwxLDEsIm9yZy54Ym1jLmFuZHJvaWQucmVtb3RlIl0.). So boss to be in a totally different part of the house and just quickly flick to a different song on the big stereo.

So this is what the overall layout is like at the moment. The small bit in red is a planned add on - wireless speakers for our courtyard. It'll run by splitting the stereo headphone output off the tv - unless I look into an optical audio to RCA convertor to bypass the tv altogether.

Media setup. Dotted lines are wifi connections. All this relies on a Dlink DIR-632 
dual antenna. Holds up superbly for around $70.

Finished product. Bit of playback going on as the background for the home screen.

Pretty self explanatory, from the name and purpose 
of the app to the awesomeness of my musical taste.

Life is great when shit works.