Happy Valentineās Day from @SnoopysBF #happyvalentine #dogsofinstagram #pawsitivelypooched #yyc
Month: February 2015
Raspberry Pi Whole Home Audio: Playing Music
Itās very rare that I tweet teasers to my blog post, but
last weekend I was so excited to be making progress on my Raspberry Pi Whole
Home Audio project that I told the world Iād be publishing this one on
Thursday.
DIY #RaspberryPi Whole Home Audio system is progressing! Latest blog post coming Thursday… http://t.co/0FaPcSeDEc pic.twitter.com/syEMoG24Gm
ā Jason Williams (@JayWll) February 9, 2015
Here we are on Friday morning. Thereās doubtless a lesson in
here for me about making promises I canāt keep, but Iām hoping youāll forgive
me when you read about what Iāve done.
If youāve been following my #RPiWHA Project
hashtag on this blog then youāll know that when we left off last time I had
three Raspberry Pis networked together with synchronized clocks, and one of
them had access to the internet and the music library I keep on my home server.
Thatās important, but not especially exciting. Today weāre going to move in a
more exciting direction, though.
Today weāre going to put Pis #2 and #3 aside, but weāre
going to get Pi #1 playing music!
Specifying and Testing the Piās Audio Output
The Raspberry Pi has two options for audio output. It has a
3.5mm analog output, and digital output through its HDMI port. It decides which
output to use automatically ā if you have a HDMI monitor plugged in then the Pi
will detect this and assume you want to use HDMI for audio too.
Thatās not the situation for me (my Pi is āheadlessā and
doesnāt have a display connected at all), and audio comes out of the 3.5mm
output automatically ā which is what I want. If you need to specify, you can
run:
sudo amixer cset numid=3 1
The digit 1 at the
end means the Pi should use the analog audio output. Putting 0 there instead would mean auto-detect
(the default) and putting 2 would
mean digital output over HDMI.
Plug in some headphones or speakers and run:
aplay /usr/share/sounds/alsa/Front_Center.wav
You should hear a voice saying āfront centre.ā
Install Mopidy
Weāre going to install music playing software called mopidy.
It provides a web-based interface so you can control your music, or there are
controller apps available in your app-marketplace of choice. Mopidyās website
takes you through the
install process in detail, but Iām going to summarize the commands here:
wget -q -O - https://apt.mopidy.com/mopidy.gpg | sudo apt-key add - sudo wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/mopidy.list sudo apt-get update sudo apt-get install mopidy python-setuptools
Done! We now have a basic install of mopidy, and the especially
astute amongst you will have noticed that weāve also installed a package called
python-setuptools. Mopidy is written
in the python programming language, and the latter package is going to help us
with installing and setting up some mopidy extensions in an automated way. The
first thing weāre going to do is install something called pip, which is a tool for installing python packages:
sudo easy_install pip
Now that we have that, weāre going to in turn use pip to
install some mopidy extensions:
sudo pip install Mopidy-MusicBox-Webclient sudo pip install Mopidy-WebSettings
With those commands weāve added a web-based interface to our
player so we can control it from a browser on another computer or mobile
device.
Setting Up Mopidy
Weāre almost ready to start mopidy and try things out, but
there is a little bit of initial setup to be done first. Edit the file ~/.config/mopidy/mopidy.conf. In the http section, change the following line
so that the web interface becomes accessible to any device on your network:
hostname = ::
In the local
section, tell mopidy where it should find your music library. In my case:
media_dir = /mnt/music
Save the file and exit. The next step is to tell mopidy to
scan your music folder:
mopidy local scan
If, like me, you have a large music collection stored on a
network share, be prepared for this to take a very long time. I started it
running before I went to bed, and it eventually completed the process about 45
minutes after I got up the following morning.
When itās done though, weāre ready! Run mopidy:
mopidy
Itāll take a little while to fully start up, but when you
see the line
INFO HTTP server running at [::]:6680
that means weāre good to go. Open the browser on your
computer or mobile device and point it to
http://192.168.1.71:6680/musicbox_webclient (replace 192.168.1.71 with the IP
address of your Pi as appropriate). Go to Browse, Local Media, and select a
song!
If all is well the music will be playing through the
headphones or speakers attached to the Pi, and weāre all done until the next
installment ā rerouting the audio from Pi #1 and streaming it, synchronized, to
Pis #2 and #3 instead.
Enjoy!
Permission to Lead
At the office I so rarely visit I have a quote that Iāve
printed and pinned to the wall. It comes from Rear Admiral Grace Hopper, who was a
U.S. Naval officer and an early computer programmer (she developed the first
compiler for turning source code into object code).
In a couple of my recent
posts
Iāve made mention of a cultural evolution thatās underway in my workplace. Itās
not a revolution ā itās us collectively choosing to be much more deliberate
about using the values we already hold to better deliver benefit to our
customers. As a part of that weāve defined ten core values, or mantras, or
whatever you want to call them. I donāt know whether or not my employer would
want me to reveal them in a public forum like this. Probably not yet, at least,
given that the evolution is in its infancy: weāre still in the process of socialising
them internally and defining what they mean to each of us individually, to our
workgroups and teams, and so on. In lieu of the ones from my organization, hereās
an example of a similar-in-spirit core value from
another company (Zappos.com):
- Do more with less
Today one of my colleagues and I were talking about our ten
and poking some gentle fun at them. We were coming up with a handful of jokey
possible additions:
- Try turning it off and back on
- āThatās what she saidā
Anyway, I said that āitās easier to ask forgiveness than it
is to get permissionā should be added to our list. I was joking. But should I
have been?
I like Grace Hopperās quote so much because, on the face of
it, itās about rebelliousness and lack of respect for authority. Thatās
typically someoneās immediate takeaway when they first read it, and those are
qualities I like to pretend I have. Except I donāt, really ā I pretty much do
what Iām told.
Itās been a good while since I printed that and first pinned
it to the wall of my cube, though. Iāve gained some seniority in that time, and
as I was thinking about this today it occurred to me that nobody really tells
me what to do anymore. My leaders set direction, provide clarity around whatās
important (and why) where necessary, provide guidance where I need it, and then
they trust me to do whatever it is that I do.
Dig just very slightly beyond the surface of Graceās quote,
and this is, Iām sure, exactly what she was talking about. Grace was, after
all, a senior military officer: I highly doubt she was advocating for a lack of
respect for authority. What sheās talking about is ownership, and
accountability. Sheās saying that if you donāt have the necessary autonomy to
demonstrate those qualities then thatās a problem so serious that you should be
taking immediate action. If thereās red tape or dumb business rules that are a
barrier to doing what you know to be the right thing then you absolutely need
to be finding a way through it, and sooner rather than later. I think thatās
something worthy of inclusion in any organizationās core values.
Thinking about all this also got me thinking back to how the
quote became words that I choose to live by in the first place. A couple of years
ago I worked at my companyās call centre, on a team responsible for operations
and process improvement initiatives. I used to provide coaching to a handful of
junior teammates. From time to time we would identify an opportunity for
improvement in one of the ancillary, supporting business processes, but being a
process on the edge of the core business weād sometimes struggle to find
someone from the key leadership to identify as owning the process and provide
sponsorship for improvement. Iād always provide the same wisdom: āIf thereās
one thing Iāve noticed about where we work,ā Iād say, āitās that if you act
like youāre in charge of something then youāll very quickly find that you are.ā
I think at the time I thought I was joking about that too,
and that little running joke is what led me to first put Graceās quote up on
the wall. Even if I did think it was a bit of a joke though I did endeavour to embody
those words, and with the benefit of reflection it now seems as though Iāve advanced
my career since then in part off the back of simply acting like Iām in charge
of stuff. Interesting.
Really though, this shouldnāt be surprising. My vocabulary
has become more sophisticated in that time too: I now see more clearly that āacting
like Iām in charge of stuffā is just a slightly tongue-in-cheek synonym for our
theme of ownership and accountability.
Once upon a time I used to wonder to myself why merely
acting like I was in charge of stuff so often proved to be such a powerful tool
in my toolbox. When you frame it in those more sophisticated terms the answer
is clear. The reason it worked so well at my workplace is because we have a
culture that recognizes, values and rewards leadership attributes like these no matter the level of the employee they come from.
The question I should have been asking is why wasnāt it like that at previous
companies Iāve worked for?
Thankfully, the answer to that one doesnāt matter to me
anymore.
Late Night Links – Sunday February 8th, 2015
It’s late night links time again, folks!
- Windows 10 is Coming to the Raspberry Pi 2 for Free
Of course there’d be a Raspberry Pi 2 a few weeks after I bought three of the previous model… - Calgary’s Mayor Naheed Nenshi Awarded World Mayor Prize
- After Harper Lee Announced the Sequel of “To Kill a Mockingbird,” People Lined up to Rename the Book
Love it. My favourite? “To Kill a Mockingbird 2: Mock This” - Police Looking for Suspect Behind DVD Caper
They wouldn’t have gotten away with this at Blockbuster. - Louisiana Governor Bobby Jindal’s Official Portrait Looks Nothing Like Him
- Unfortunate Names in Sports
Who names their kid Craphonso? - London’s Derelict Tube Tunnels Reimagined as a Pedestrian and Cycle Network
- Like Brain Teasers? This DIY Puzzle “Nails” It
I’ve seen this before and I like it. Maybe I’ll make one? - Five Real Trials with Mind-F#@%s Too Shocking for Fiction
- Where Did All the Rubber Bands Go, Paul?
- What are Mattel and Google Doing with View-Master?
Interesting… - A Rare Look Inside a Massive Bitcoin Mine
This is kind of fascinating. - Cyanide & Happiness #3830: Cold Cakes
- Five Best File Encryption Tools
I haven’t really encrypted stuff since the demise of TrueCrypt, but I’m thinking I should do this for some of my stuff, especially given that I back-up to cloud storage.
And that’s it! We’re all done for another week. See you next time, folks.
Social Networking at the Office
In mid-January Facebook hit the headlines with (and receivedĀ decidedly mixed reviews on) the announcement of their āFacebook at Workā offering,
which is essentially a walled-garden version of Facebook with access restricted
to those in your company. Aside from that important distinction the list of
features seems pretty much on a par with the larger Facebook we all know.
With this product offering Facebook joins an enterprise
social network marketplace that already contains some big names: Microsoft,
IBM, Cisco and SAP amongst them.
I can see the benefits of these platforms in terms of
collaboration, messaging, and the like ā but Iām certainly glad that my
responsibilities donāt include the realization of those benefits for my
company. The scope of the behaviour change required to make the most of those
tools falls into the category of āculture shiftā in my mind, and that stuff is simply
not where my expertise lies ā itās a task that goes way beyond technology and
business process folks like I.
Where I work, weāre now on our second enterprise social
network. Weirdly, the first one hasnāt actually gone away ā everyone has simply
stopped talking about it (and we all stopped using it long ago). The
implementation of the first one ā I feel ā was probably driven by technology
folks. I say that because from a technical perspective it works great, but
nobody ever told me what it was for. Apparently Iām not alone in my confusion,
because it never really saw any significant usage.
Things are looking a little better for the new one. For one,
itās integrated into our enterprise learning environment. At first that seemed
weird to me, but now that I think about it that makes perfect sense: learning
and development in the modern enterprise is increasingly something you do at
your own pace (to a certain extent), in your own office with the door closed
and headphones on. Itās crying out for something to bring back some of the
social aspects that are lost now that technology has begun to make
classroom-based training sessions a thing of the past, and I hope our training
teams pick up this ball and run with it. Additionally, thereās a movement
underway to build on our corporate culture and do a better job of leveraging it
for the benefit of our customers. Open, social communication that transcends
our geography is an important part of that cultural evolution too. The time is
right, then, for a platform to make this happen.
Nevertheless, people were burned by the failure of our
previous platform to gain traction, and thereās a healthy amount of skepticism
out there. Again, nobody has really told me what the new platform is for or
given me examples of how I could use it to my benefit.
A quick conversation with my boss about this last week
brought me to an important realization. Why am I waiting around for someone to
tell me what this platform is for? Iāll decide what itās for! Iām even starting
to think the lack of guidance and instruction might be a deliberate choice made
in the interests of organic growth and buy-in fuelled by self-realization
(although, frankly, I still think itās the wrong choice if thatās the case).
I plan to encourage my team to shift some of our non-time
sensitive group communication out of Outlook and into the social space, and I
sincerely hope it catches on. I think that would be a good starting point for
us, and as I said at the top, I really do see the benefits of a platform like
this. Iām putting my own skepticism firmly aside in the interests of trying to
steer my group toward the realization of those benefits that this platform
could represent. Weāll see how it goes!
Hopefully I wonāt be around to see the
introduction of a third enterprise social network. I wonāt be so generous if I
am.
Browse Anonymously with a DIY Raspberry Pi VPN/TOR Router
So, after last week’s post about preparing my Raspberry Pis for my whole home audio project, I had three Pis that should have been set up properly, but weren’t working very well – and the culprit was the USB WiFi dongles I was using.
Happily a stumbled upon the article linked above, and it solved the issues I was having!
Surf the Internet securely with your very own portable WiFi VPN/TOR router. You can configure a Raspberry Pi with Linux and some extra software to connect to a VPN server of your choice.
I didn’t follow all the steps because they’re doing something different to me, but there is some commonality and, crucially, the article folks are using WiFi adapters with the same chipset that mine have. Step four shows you how to download and compile a version of hostapd that’s built especially for them and works well. I’ve updated my previous post with these steps.
Now that I have networking all set up I’ve taken a couple of extra steps:
- I set up passwordless ssh between the three Pis. This isn’t required for my solution per se, it just makes things easier.
- I used sshfs on pi #1 to connect it to my existing home server, and mount the folder that holds all my music.
I’m excited to move on to next steps! The prep work was necessary, but it didn’t make for an especially interesting blog post because it’s all a bit dry.
Keep following my #RPiWHA Hashtag! The next installment will be more interesting, I promise. We’re going to get some actual music playing!
Late Night Links – Sunday February 1st, 2015
Look at that, we’re already into February. Where does the time go, etc, etc? It’s business as usual here at late night links, of course, so let’s get on with it.
- Facebook Releases Facebook Lite, Drastically Reduces App Overhead
I know it’s meant for developing nations and stuff, but I’d swap the bloatware Facebook app for this. - Russian Hockey Player Scores Insane Goal at All-Star Shootout
- Design vs. User Experience
- “Tron”-Like Glow Headphones Pulse to the Music and Your Heart
I’m listening… - Check Out the Insane Pre-Game Video Projection from a Toronto Maple Leafs Game
- Hands on With Windows 10
- Only the Best Bike Thieves Leave Reviews
- So This Happened…
This is awesome. - CRTC Bans Substitution of Canadian Ads Over American Ones During Super Bowl
- British Thieves Stole DVDs From a Supermarket by Mailing Them Home
Genius. - Hockey and Big Data
- No More Distractions
I usually just go work from somewhere else, but this would work too, I guess.
And we’re done for another week! Until next Sunday, then.