Friday, May 5, 2017

Hubs 'N DACs

Having a lot of fun lately with some extra Raspberry Pi Zeros, some Zero hubs, and several DACs to build LAN-connected Internet radio and .mp3 players. I like the Zero footprint, and as you all know, the Raspberry Pi Zero and Zero W are great little computers that don't ding your wallet - by themselves.

But with no audio out and limited USB, you'll need to add a few items to your project if you want some tunage and connectivity. The Raspberry Pi Zero W handily provides wifi - a real bargain $10 computer that I predict will introduce many new products and a new standard in SBCs, but again, you'll need to add audio for any sound-related project. And if you want to host additional devices, such as thumb drives, mouse, or keyboard, you'll need some additional USB ports.

Audio Solutions

I suppose the cheapest way to get audio on the Zero is through a USB audio dongle. You can find these devices - which provide audio in and audio out connectors - everywhere for about a Lincoln (US$5). They work well with GNU/Linux, and most are C-Media devices easily recognized and configured for use by the kernel (gone are those terrible days of having to rebuild the kernel every time install a new sound card!)
The problem is that you will most likely still need the sound amplified in order to play music on your speakers. Some dongles offer mute buttons, and some speakers are USB powered, but then only offer physical controls for volume, bass, etc.

Getting your hands on an amplifier for a stereo speaker project is kinda easy. I have scavenged a number of small amplifier boards from 3V battery powered speakers found in thrift stores and at flea markets. You can also buy one of the boards Adafruit sells to interface with your Zero's audio output.

Digital-to-Analog-Converters, or DACs, come in several form factors and flavors for the Raspberry Pi family. I have several: Pimoroni's PHAT DAC, a PiZeroAudio DAC, and Adafruit's Speakerbonnet.

Zero Hubs

Getting additional USB ports onto your Zero can be accomplished by using a hub. Like cheap audio amps, I have also scavenged old 4-port dongle hubs for Zero projects, such as this FrankenZero, a complete Desktop computer with wifi, sound, and a VGA port:

Hardware developers have come up with some nice Zero-footprint hubs at a reasonable cost. Putting together some of the required bits for an audio project that will work well with speakers can be interesting! Here is a MakerSpot hub (highly recommended), with a Pimoroni PHAT DAC, and an Adafruit 7W audio amplifier - great sound out of this one:

Amplified sound is provided by the screw jacks on the side of the amp board, with power (5V) supplied by the Zero's GPIO bus. The DAC's output is drawn from its RCA connectors:

I've incorporated another hub, the new Hubpixed, which works with the rpi0 1.3 and W, and have an inexpensive DAC attached - note there is no amplifier! :
But my favorite solution is the Adafruit Stereo Speaker Bonnet, which has the DAC and amp on a single board, and also provides your RPi's i2c and power GPIO pins in a separate area on the board - brilliant! i have this board installed in a Western Digital PiDrive enclosure on an RPi3 - great sound out of this one!

Here are some tips and tricks with the speaker bonnet:

1. i have found that cutting a 4-pin Grove connector works great as a JST-4 plug - this makes hooking up stereo wires a lot easier or to route the stereo lines out to my RPi's enclosure

2. after a bit of research and command-line foo, i found the proper incantation to play video during Raspbian Pixel desktop sessions on an RPi3 and have the audio routed through the speaker bonnet (great sound!)

hint: vlc, as currently distributed, won't work! you must use omxplayer and you must specify the Alsa card number of the bonnet... for example:

omxplayer -b -o alsa:hw:0,0 ManBearPig.avi

(the -b option creates a black background in case your video is smaller than your desktop)

at some time i'm going to try to recompile vlc for hardware acceleration... i understand that v2.2.4 will build properly at this point in time...

3. typing the omxplayer command line works, but is a pain in the ass if you're kicking back on the couch and using a Logitech remote keyboard and mouse; in this case, you'll want to create an association using a right-click on a movie file in the pcmanfm (file manager) window:
you'll want to make sure that omxplayer is launched in a terminal, or you'll lose control of the program once the video starts playing (i.e., no volume control, pausing, or quitting); after you click 'OK' you will see the 'doit' option when you right-click your movie file - this is the easiest way for me to launch omxplayer without typing a command line.

tip: you'll need to create this custom launch option separately for .avi or .mp4 files - to save a hassle and time, rename your .mkv files to end in .avi (they're the same file internally - at least this has been my experience).

Wednesday, May 3, 2017

WD PiDrive Node Zero wireless Zero Upgrade!

Just snagged a WD PiDrive Node Zero from WD today! I had also ordered the enclosure.


 This nice little compact board comes with a 300GB WD USB drive *and* an RPi Zero!
 In just a couple minutes I extracted the RPi0 out of the node and installed a new RPi0W; extraction was a careful affair, but easily accomplished - the Zero is attached by its two micro-usb ports, but i had to first use an H1.3 security bit to remove the four screws holding the Zero in the add-on USB board (don't know why WD didn't use small Phillips heads)


i had previously configured a recent Raspbian Pixel distro on the RPi0W's sdhc, so i just kept it in and powered up the Node Zero.
My new little computer runs great! i use a 2.4A USB power supply... as a bonus:
- the WD Node Zero came with a micro->HDMI stubby cable (not needed, but nice to have)
- the WD Node Zero offers two USB ports (handy, but not necessary thanks to the new wifi capabilities
- the enclosure came with a small torx screwdriver!
- *and* i now have a spare Zero to play with!


Sunday, January 1, 2017

Shaving

This page will document some of my shaving accessories. I did have a bit of a collection of straight razors at one time, but downsized about four years ago and sold most of them off. Nowadays I use vintage Gillette double-edged adjustable safety razors - much safer!

Here's a treasure given to me by my father-in-law: His 1960 gold-plated Gillette Toggle!
More razors will be added as I take pictures.

Tuesday, December 27, 2016

Swim Watches

Being an avid early-morning swimmer, I'm always on the lookout for a nice water-resistant watch with a readable face. I started out using a cheap Casio MRW200H-1EV (they come in many color combos, but my favorite was the black dial with yellow numerals). Battery life on this watch was not so good as i found i had to replace the battery at least once a year (something i can do myself).

My next step up was to another Casio, the classic, and i think, bargain 200m dive watch, the MDV106-1A - beefy, with twice the battery life, screwback, good readability. I used one for at least a year. Alas, i was disappointed in the lume.

I also like the Seiko SKX007:


And then i discovered the Seiko Monsters. Big, beefy automatics with hand-winding and hacking (ability to set the watch to the second) in the 2nd generation, which uses a 4R36 movement. Great watch, outstanding lume.

I snagged a used one for about a Franklin. It's my go-to swim watch for the early morning:
More recently, i discovered that there is a real bargain automatic dive watch with hand-wind capability and fabulous accuracy out of the box: the Vostok Amphibia, made in the Russian Federation, and based on a late 60s design:

Like the cheap Casios, these watches come in a variety of configurations, dials, bezels, etc. Many parts are interchangeable, and best of all, the watches are less than US$80 shipped, with hand-wind only for US$30 less!

I really didn't believe the touted accuracy, so I slapped one of mine onto a C270 webcam's mic and ran the Tg timegrapher client under CrossOver on my MacAir running OS X:
Nice! Note that unlike the Seiko, which has a 53-degree lift angle and 21,600 beats per hour, the Amphibia has a 42-degree lift angle and 19,800 beats per hour. Even so, the accuracy of +/-5 seconds per day (more or less according to wear, temperature, etc.) is astounding!
And the newest addition to the clan - an orange scuba dude with a modded bezel and nato strap:

And here's a new Amphibia modded with a new bezel that i'm going to call my 'Diet Pepsi' (after a Seiko SKX009):


and a latest acquisition: i think this is one of the most attractive and readable of the Vostok Amphibian dials; i slapped on a dragontail Pepsi bezel and a blue 22 G10 (nato) strap:



So now I'm very happy! Anyone want a couple cheap quartz swim watches? I'm done changing batteries. Even though the Amphibia only has a 31-hour reserve and the Seiko Monsters sport a 40-hour reserve, hand-winding keeps these babies running in tip-top shape and on time!

and my very latest - the wonderfully rare SKX011J1!

Saturday, December 24, 2016

Merry Christmas

Merry Christmas from the Gulf of Mexico!






To all GNU/Linux users - have a great time with family and friends and fabulous 2017!

Wednesday, December 7, 2016

Tg Timegrapher on the Raspberry Pi

Marcello Mamino's Tg timegrapher is a fabulous piece of software you can use to maintain your automatic watch's accuracy or to diagnose and determine if service is needed. This program uses sound analysis and 'listens' to your watch, then reports information about how it is running. Again, many folks will simply use Tg in order to get their watch to the greatest degree of accuracy (shortest loss/gain of seconds per day). This short post will show you my simple setup on how I use Tg with a Raspberry Pi 3.

NOTE: For a detailed explanation of many of Tg's features, to learn how to interpret the graphical and digital output, and for training on how to use a timegrapher, get this *very* helpful document:

Witschi Training Course

To install tg, the first step is to download and build the software (I don't think Tg is in Debian mainstream - yet!). You'll need a few extra software packages and libraries, along with, of course, the normal development tools. Simply follow the instructions on Tg's page or Marcello's github page and you'll see that Tg builds and installs under Raspbian quite easily.

You'll also need an inexpensive quartz watch, and input microphone - i use a Logitech C270 webcam for a mic - and of course, your automatic watch. Please note that I am an amateur watch person, so my horological knowledge is quite in the n00b status.

One additional piece of software I found handy was Pulseaudio's pavucontrol, a gui client interface to sound devices on my Raspbian system. After installation, I checked the mic and its input level:
Calibrate

The first step is to calibrate Tg to your sound card. More details about this process may be found in this msg. Simply clamp your quartz watch with its back to the mic input. Run Tg using the tg-timer command, then click the Calibrate button. Then sit back, watch the dialog, wait until the calibration finishes, and you'll see Tg automatically enter the offset value. In my case, the C270 mic need a +2 offset. A CMedia USB sound dongle required a +3.6. Your mic may be different!

Enter Settings

Next, you'll need the 'lift angle' and beats per hour for your watch. Now understand that I'm a watch n00b, but as I have read, the lift angle is "the time the balance is in contact with the pallet fork." Most watches use 52, but my Seiko in this example uses 53, and the bph setting is 21,600. After clamping the watch onto your mic, let Tg run!

Simple Use of Tg

It's best to let the program run for a minute or so in each of six different watch positions: dial up/down, crown up/down/left/right. Keep a notepad handy and note any different readings in the s/d or seconds per day. You can use these values and orientation to 'fine-tune' your watch's accuracy once you get it running the way you like.

Here is the program running on one of my RPi3's with a 3.5" TFT. My Seiko SKX007 is clamped to the C270 and the session is displayed on a Screen Sharing VNC session on my Macbook Air in the background (Tg's dialog is too big for 320x240 resolution on the TFT):
Using this program, I've been able to achieve a decent level accuracy for my watch (temperature, position, etc. will all have an effect):

Tg offers a bit more info than i've described here. I'm not knowledgeable enough about horology to expound on its uses, so suffice to say that i simply enjoy using the program. It's a simple way for me to enjoy my inexpensive Seiko automatics.

Saturday, December 3, 2016

Tg: Open-Source Timegrapher

I love open-source software. Thanks to Marcello Mamino's Tg timegrapher, you can enjoy using your favorite computer and soundcard to help maintain your automatic watch's accuracy or to diagnose and determine if service is needed.

I'm an amateur, but I like professional tools, and this software, which runs on everything from a small Raspberry Pi to machine powered by the Beast of Redmond, presents an inside view of your watch's movement - it's  not an x-ray, but a sophisticated sound analysis!

Here we see a Seiko SRP615, which uses a 4R36 movement:

The dialog shows a beat rate (+/- seconds per day),  amplitude (orientation), beat error (lineup of tic/toc) and beat number (here, 21,600 beats per hour). Excellent accuracy is assumed on first glance, but you have to run the program with the watch in different positions for a better idea!

You can download and build the client from source, install binaries, or as I did, install non-native binaries and run the client in emulation under CrossOver for the Mac.

The first task is to 'calibrate' the software to your soundcard. Clamp a quartz watch onto your input mic (I used a Logitech webcam), then click the Calibrate button. Let Tg collect data and it will eventually display an offset value to use when running an analysis of your automatic watch. You'll want to make sure that the input sound is 'clean' (represented on the bottom line of the picture) so you'll get best results, but Tg is pretty robust - it will work!

You can use the 's/d' values to determine if your watch is running too slow or too fast. You'll want to see the differences between these values with the watch in different positions (dial up/down, crown up/down, etc.) Then crack your caseback, adjust, and check again. This can save a lot of time instead of doing the adjustment, then letting the watch run for two days or so.

Have fun, and thanks, Marcello!

btw, it also appears that my manual regulation efforts, conducted before trying this software, were pretty successful with my skx007: