HiFiBerry DAC for the Raspberry Pi

I mentioned at the end of my previous blog article on the Raspberry Pi that I had a DAC board in transit. Well it has arrived, I’ve fitted it and after a few trials and tribulations, it is set up and working well.The attraction of having an onboard DAC in the Pi is really one of neatness. It also frees up one of the USB ports that I would otherwise use to feed a USB DAC (for example I can boot the Pi into Squeezeplug, and use the Pi as a Logitech Media Server with Squeezelite as a player). The case that I’m using for the Pi doesn’t really offer a lot of room for manoeuvre when installing additional boards, but in the end I bodged together a neat enough solution.The HiFiBerryThe HiFiBerry DAC is a small printed circuit board about half the area of the main Raspberry Pi board. It attaches to a set of 8 connecting pins - the onboard sound connector P5 - you have to solder an 8-pin header to the Raspberry Pi main board first.I’d ordered the board with two RCA connectors, but no headphone style jack plug. The RCA connectors were three pin sockets, obviously intended to be soldered to the board. It was immediately clear that this would mean the Pi would no longer fit in the case, so I decided to connect the RCAs via wires to the board, and mount the RCAs in the lid of the case. The board came with the GPIO and P5 sockets already soldered.AssemblyStep 1 - I soldered the P5 header to the Raspberry Pi board. This proved pretty easy. The P5 sits right next to the GPIO connectors.Step 2 - I soldered four wires to the output terminals intended to output to a 3.5mm jack. Two from GND to the GND tag of the RCA sockets, and one from the L and R channels to the appropriate tag of the RCA sockets.Step 3 - I drilled two holes in the case lid. I also needed to remove some bits of plastic from what appear to be strengthening ribs in the case lid to allow it to fit over the HiFiBerry board. I fixed the RCA sockets into the holes, which needed a spot of araldite to hold them firm.Step 4 - I mounted the HiFiBerry board on the P5 connector - it also slots onto the GPIO header for added support. The card came with a polythene pillar and screws to further support it in place, so I fitted those.Step 5 - I assembled the case back together, inserted the SD card and booted the Pi.[caption id="attachment_2499" align="aligncenter" width="300"] Upper side of HiFiBerry board[/caption]You can see the wiring I added to connect the RCA sockets to the board. Obviously, the sockets supplied are intended to be soldered to the board in the positions labelled 'Left' and 'Right'.[caption id="attachment_2501" align="aligncenter" width="300"] The underside of the HiFiBerry board[/caption]There's not much to see on this view of the HiFiBerry - other than my soldering, and the two connectors that attach the board to the Raspberry Pi - the board came with these already fitted.Using the piCorePlayer web interface, I selected the option for the HiFBerry DAC, determined the ALSA settings for the HiFiBerry and entered them, and saved the whole setting to the SD card. Then I excitedly hooked up the phono cable to my amplifier, booted the Pi and sat back to listen to the music.Well, I could listen to the right hand channel, but the left channel was sadly absent!A problem!Clearly I’d done something wrong! I referred to the forums on the HiFiBerry site. Most people having this sort of trouble had evidently made minor cockups with soldering, though there were hints that some cards may have been defective. A quick email elicited a rapid response suggesting I check the connectors for evidence of shorting out. I did this, finding no problems. As an aside, I found Daniel at CrazyAudio very responsive and polite in the face of a neophyte solderer asking questions.A little while later, it occurred to me that the two non-ground pins of the RCA connector might not be equivalent - in particular, it wasn't easy to see how they connected within the socket. I plugged in an RCA plug into the L channel socket and used my multimeter to determine if the signal wire from the plug actually made electrical contact with the tag to which I’d soldered the wire from the board. It didn’t, so after a bit more investigation I detached the wire and soldered it to the third tag of the connector. At this point the Pi was properly outputting audio from both channels!Triumph!So, how does the Pi perform as a media player with the onboard DAC? First impressions are that it compares well with the two external DACs I have available, though both are budget items (a Cambridge Audio DACmagic 100 and DACmagic XS). More on this later, though I'm not really a serious audiophile and I've no way of doing a proper blind test.

Tags:
  376 Hits

piCorePlayer - Squeezebox on a Pi

Adventures in Raspberry Pi LandWhen the Raspberry Pi was announced a few years ago, I was rather attracted by this low power but very flexible educational computer but never bought one until recently, when I fancied having a bit of a play with setting up a Raspberry Pi as a Squeezebox player.After a bit of a sidestep in the ordering, I ended up with the following:

  • One Raspberry Pi Model B, with SD card containing NOOB
  • One USB WiFi USB stick (not the Edimax stick I originally planned - more on this later)
  • One clear plastic case
  • One power supply
piCorePlayer installationThe SD card that came with the Raspberry Pi had the NOOB collection of operating systems. However, I began by overwriting the SD card with the piCorePlayer 1.12a image. I connected the Raspberry Pi to my router with an ethernet cable, and booted it up. Booting piCorePlayer takes only a few seconds. Connecting vis SSH was trivial with Terminal on the MacBook. Recent piCorePlayer releases include a rather nifty web page based configuration system, so it really didn't take long to set up the connection to the Logitech Media Server, rename the device, and set up the audio via the spare USB port to a small Cambridge audio DacMagic headphone amp. Here's a quick snap of the device with ethernet connection to the left and power supply to the right with the SD card protruding. You can see the WiFi stick to the left, next to the ethernet connector.So far, so good.PiCorePlayer successfully saw the Wifi network. I entered the SSID and password, but the wifi stick resolutely refused to play ball after a reboot, leaving the device uncontactable except via ethernet. I subsequently investigated reviews of the Wifi stick I'd chosen. Turns out that the thing won't work with piCorePlayer, but will with Raspbian. Ho hum! I then ordered an Edimax device, which I should have done in the first place.In use, the Pi seems to work well, and plays audio robustly, no pops, clicks or other audio artefacts. In its transparent case it looks quite attractive in a 1970s Blake's 7 budget SciFi kind of style, what with the various flickering and flashing LEDs.A couple of days later, the replacement WiFi stick arrived. By this time, piCorePlayer version 1.12c was released. I reflashed the SD card, and repeated the setup routine. I also expanded the second partition to fill the rest of the SD card. This should allow me to install further extensions to piCore. The Edimax WiFi stick does seem to play ball with piCorePlayer, which can now take up residence next to the HiFi. I note that selecting the correct ALSA parameters for the external DAC is important to avoid pops, clicks and other audio degradation. PiCorePlayer's web interface makes setting up the audio (and Wifi) very easy and straightforward.The Pi is hooked up to a Cambridge Audio DACmagic 100, and thence to a Naim Nait3 integrated amplifier and Mission 720 speakers. I also tested it using a Cambridge Audio DACmagic XS DAC/Headphone amp.Next up...I have a HiFi Berry DAC card in transit. I have also soldered up an expansion board for a 2 x 16 LCD display.

Tags:
  345 Hits

Raspberry Pi as a Squeezebox

I’ve blogged in the past about the really rather wonderful but sadly discontinued Squeezebox system of networked media players (see for example 2013 – My year as a music consumer and Squeezebox RIP). It hadn’t escaped my notice that the tiny computer Raspberry Pi has been used as a low power Squeezebox, and I fancied a spot of tinkering to make a backup Squeezebox device should some of my current Squeezeboxes conk out (though it has to be said that I have two Squeezebox Radios, one Squeezebox Touch and one Squeezebox Classic, and I’ve never had any hardware problems to date).I looked around the web for tutorials on setting up a Raspberry Pi as a Squeezebox, and there do seem to be several ways to achieve this.First up would be to install Squeezeplug. This sets up the Raspberry Pi not only as a player, but as the Logitech Media Server (LMS) itself. As far as I can deduce, this setup would be useful as a low power media server that would be left running 24/7 - obviously with an external drive to hold the music files. Since I’m running LMS on a QNAP NAS already, I think this might be overkill!I then found this tutorial on installing Squeezelite on an Raspberry PI, with the stock Raspbian operating system - Installing Squeezelite Player on Raspbian. The same author decided to use a different OS to make a device that could be switched on and off without problems, resulting in...Unpluggable Squeezelite Player on TinyCore. This uses a small linux distro, PiCore (based on TinyCore) which runs in RAM and uses the Raspberry Pi’s SD card in read-only mode, meaning it can be switched on and off with no damage.As an alternative, there’s a pre-built version of the above, called PiCorePlayer. This may be the most straightforward way to set up the Raspberry Pi, and will be my first foray into the world of Raspberry Pi.Just now, I’m eagerly awaiting the arrival of my Model B Raspberry Pi (complete with SD card), a small plastic case and a USB WiFi stick.

Cost so far:Raspberry Pi Type B with 8GB SD card               £27.40Edimax Wireless Nano USB Adapter                     £8.95Case-CLR 1 Raspberry Pi Type B Case - Clear      £3.99Total (inc VAT) is                                                    £48.41

The 8Gb SD card is probably overkill for the purpose I have in mind. The RS website says it has the stock Raspbian OS, but I could put the multi-distro NOOB on it. I probably have a modestly sized SD card kicking around - the PiCorePlayer site says the entire thing is only 26Mb (though the latest img file is around 57Mb).I need the WiFi adapter because running an ethernet cable to the eventual location of the device is likely to be impractical. I expect to do all the set up on the command line, starting with the device hooked up by ethernet until the WiFi is setup, though if necessary I can borrow a keyboard and mouse for the setup. I have several 5V USB power power supplies that should fit the bill according to the Raspberry Pi website.My immediate plans are to hook the PiCorePlayer to a DAC via USB. Another future possibility would be to add a HiFiBerry DAC card. This would be rather fun as it’d require me to get out the soldering iron!

Tags:
  268 Hits

Smartphones, tablets and styli

It’s always struck me that handwriting was a natural way to use a tablet computer, though maybe this is a hangover from my days as a Pocket PC user! But the Apple Way is not to use a pen or stylus but to poke at a touch-sensitive screen with a finger tip.Steve Jobs famously disliked the idea of using a stylus with a tablet.

(Steve Jobs) It's like we said on the iPad, if you see a stylus, they blew it.
So iPad users generally have to make do with either their finger or a third party ‘stylus’ that mimicks a finger tip, usually with a squishy rubbery tip that frankly is not much use when it comes to writing. I’ve tried a few of these, without really finding the experience useful for writing - they are a bit more practical for scribbling quick diagrams in my experience.I also have a Samsung smartphone, the Galaxy Note 2. I bought this largely because it comes with a stylus and surprisingly good handwriting recognition software. I can use the stylus for text entry for most, if not all, of the apps for which it would be appropriate. The stylus fits snugly and neatly into the phone’s case.  It’s not a simple device - (this article explains how the thing works - Break It Down – How Does The S Pen Work?) but it works admirably, giving the real sensation of writing. In contrast to the spongy rubber blob of a typical iPad stylus, you pretty well know where the line you’re writing will appear on the screen. The S-pen is good enough in use that it may well be the deciding factor in which model of tablet I buy to replace my iPad3 in the future.There are several iPad apps I’ve always felt would benefit from the use of a stylus:
  • Any of a number of note-taking apps - ideally with handwriting recognition.
  • Sketching apps (which would include the Evernote app Penultimate).
  • Pdf annotation apps such as iAnnotate or Papership. Papership is particularly useful to me as it accesses my library of pdf files indexed and organised in Mendeley.
  • Evernote. This would be a dream, but really I think script entry would be limited to Penultimate. On my Galaxy Note 2, I can scribble into Evernote to my heart’s content.
A few weeks ago, the Evernote Market Place (which pops into my awareness from time to time when using Evernote) advertised the Jot Script iPad stylus by Adonit, which has the nearest thing to a pen-like point that I’ve seen in an iPad stylus. For a third-party iPad stylus, it’s a bit on the pricy side but I thought it would be worth a punt. This is something of a preliminary review after a few days of use.The Jot Script stylus works with all iOS devices, though you need to have Bluetooth 4 for all the advanced features such as palm rejection - this includes iPad3 and later models (and the iPad minis). Also, unlike the Samsung S-pen, it’s powered (by a AAA cell). You need to turn it on and let it pair with the iPad. In the hand, the Jot Script feels very much like a pen - it’s got a pretty fine point to it, and it’s pretty much the same length and weight as a largish ballpoint pen.I’ve tried the Jot Script with the following apps:Penultimate. This is a graphics app for sketching that’s part of the Evernote family, so your sketches and scribbles end up in Evernote. The difficulty I’ve had so far (only a few days in) is that the line being drawn doesn’t always appear where you think it will. I imagine this may get better with practice. I don’t find my handwriting particularly legible. The software offers quite good protection against accidental ‘inking’ by one’s wrist. Penultimate also offers a ‘drift’ function where you can zoom in to a page, and it drifts across as you write. This allows you to generate pages with reasonably fine text, but it strikes me as a ridiculous workaround of a pretty glaring defect in iPad design - the lack of a really functional stylus from the get-go. Still, it is quite good, and works quite well.JotStudio - made by Adonit, this is a pretty basic sketching app. It has a few pen types, and limited ‘pressure sensitivity’ - line width seems to be mostly dependent on the speed at which the line is drawn (this is true also for Penultimate). Only seems to function in landscape orientation. This works quite well, but has limited functionality.WritePad - this app features handwriting recognition and is made by PhatWare who used to make handwriting apps for the old PocketPC platform. I have trouble here because, as with the other apps, there’s a bit of uncertainty where the line will appear and when it’ll start appearing. I find it quite difficult to write sufficiently clearly (given the limitations of the iPad screen and the stylus) for effective speed writing and handwriting recognition. I find that if your wrist contacts the screen, you can’t write with the stylus (and you make a random squiggle where your wrist touches the screen). Limited use for me, but perhaps it’ll get better with practice.iAnnotate. Perhaps the leading pdf annotation software. The stylus is useful for freehand annotations. Works pretty well, though the highlighter tool seems to select rather more text than I intend to with the stylus.Papership. This is a pdf viewer and annotater that works with Mendeley libraries. The app is free, but the full range of annotation tools needs a £2.99 in-app purchase. This is worth it in my view. Papership is for me one of the killer apps. Annotated pdfs are snychronised back up to the Mendeley server, so the annotations are visible on your desktop PC or laptop. The Jot Script stylus makes reading and annotating research papers really easy and intuitive.My conclusion is that the iPad remains pretty much unworkable (for me at least) for text entry with a stylus, but that for quick diagrams and, more importantly for me, annotating pdfs, the Adonit stylus is a useful addition and one that's much easier to use than a finger tip or the more usual blunt rubbery stylus.For handwriting entry on a tablet or phone, I reckon that Samsung’s S-pen wins. When (or if) I’m in the market for a new tablet, I will try out the Galaxy Note 10.1 with the S-pen.

Tags:
  261 Hits

Spotify, its business model and its future

Prompted by an article in The Guardian (Spotify opens up analytics in effort to prove its worth to doubting musicians), I visited a Spotify website which seeks to de-mystify the periodic brouhaha around Spotify's business model and whether or not artists are paid properly for their music which is streamed via Spotify. The article by Spotify is really a series of mini-blog articles on a new site (www.spotifyartists.com).It's an agreeably affable page that makes a series of assertions:

Spotify’s model aims to regenerate this lost value by converting music fans from these poorly monetized formats to our paid streaming format, which produces far more value per listener. The chart below shows the money a Spotify Premium customer spends per year compared to the average spend of a US music consumer who buys music (not including those who spend $0 on music).

There's also the claim that Spotify Premium users in the USA bring in $120 per annum to Spotify, and therefore a proportion of that makes it to the artists. There's an overview of the annual royalty payout in the period 2009-2013 (it looks almost exponential). Taken overall, the average Spotify user apparently coughs up $41 per annum. But presumably this is the trackable income that Spotify makes through direct user subscriptions and advertising (for example $10 per month = $120 per annum - it's a fair bit more pricy in the UK). There's evidence of a solidly growing user base:[caption id="" align="alignnone" width="299"] The growing Spotify user base[/caption]Spotify also outline how their revenue is split - approximately 30% is kept by Spotify, with the rest going to rights-holders. I guess it's up to labels and the like what proportion of that gets back to the artists. But the means by which rights-holders get their slice seems a little complex, and it's not on a per-play basis. Essentially the criteria are as follows:

An artist’s royalty payments depend on the following variables, among others:

Continue reading
Tags:
  350 Hits

More objections to Spotify

Here's a BBC News page with a segment from a recent Newsnight programme discussing Spotify and whether it does artists a disservice -Spotify - friend or foe of musicians?We still see the issue of low royalty rates for the musicians, but increased ticket sales as a consequence of exposure via Spotify is mentioned as a bonus. But, at the risk of sounding like a stuck record (!), why has no-one actually looked into the effect of music-streaming services on music purchases? Perhaps I am an oddity who buys more because I can listen first, and extensively before buying an album?The internet offers a hugely diverse route into finding music, particularly the social aspects of last.fm, Spotify, Bandcamp and Soundcloud (all of which I use), and many others I don't have time for. Maybe this isn't all about piracy, lost sales and the like but is a new way of business that needs to be grappled with.

Tags:
  291 Hits

Spotify. Good or bad?

I've been a Spotify subscriber for about 9 months now, and I view it as a really exciting and useful way to listen to new music. But some in the music industry view it more darkly - see for example comment articles by David Byrne and Thom Yorke. These two articles provoked a response from Dave Allen, who takes a different view.Personally, I think there's a fundamental problem with the discussion (though I think I tend towards Dave Allen's view): that is that none of these articles really contain hard data on music purchasing within the Spotify subscribers (and indeed comparing those people with non-subscribers).For my part, I'm of an age where my music listening and buying has seen several game changes. My first record was this:[embed size="compact"]https://open.spotify.com/track/2A0VyjrAJQPXVKxRzxEePG[/embed]And my first LP was Dark Side of the Moon:[embed size="compact"]https://open.spotify.com/album/3a0UOgDWw2pTajw85QPMiz[/embed]But in those days, finding and buying music was very different. I spent loads of time browsing through the inky music papers (NME in my case), listening to friends' LPs (and taping them), and above all frequenting dark record shops. Most of those record shops were bizarrely idiosyncratic in their owners' attitudes (see this listing for examples!). My memories of those days are obviously coloured by rose-tinted spectacles, but the sense of community was great, along with pressures of poverty meaning that every music purchase was most definitely considered thoroughly. And not just in terms of the music itself - peer group issues were very definitely an issue! My affection for vinyl remains because my shelf of LPs, perhaps 5 feet of LPs, contains records firmly registered in my memory as markers of my life: I can recall the circumstances in which I bought virtually every one of them. I recently digitised the majority of them, and the process became the most astonishing memory trip. I suppose the affection I have for vinyl is obviously related to the the packaging, almost invariably superior to a CD package, but also relates to the need to look after, cherish, the object.CDs became the medium for music (I ignore the cassette tape). Oh how wonderful it was to not have to worry about scratches, crackles and generally damaged product. But something was lost for me - buying records became a rather humdrum and unexciting business, and as internet ordering became the norm, I found myself less and less likely to actually visit record shops. I live in a town almost bereft of record shops now, and the overall effect was that my interest in, and purchase of, music reached an all time low.A few years ago, a review of a device made by Logitech - the Squeezebox - in a Linux magazine piqued my interest. I've blogged before about this system, sadly discontinued by Logitech, though it lives on beyond the grave (see also other systems such as Sonos). I quickly began ripping my CDs to disk - running a music server on an old Ubuntu linux box, I made the initial false move of ripping to mp3. Recognising my mistake, I re-ripped to flac! Listening to music through my home network really revitalised my interest music. There were so many advantages in accessing albums without ferretting around shelves of CDs, searching for obscure tracks became so much easier and so forth. Over the years, my Squeezebox system grew. Now I operate a Squeezebox Touch, my original Squeezebox 3, two Squeezebox Radios, plus I use a software player on my MacBook Pro, and apps on iPads and Android devices. Along the way, I started using last.fm as a way of interacting with others, and trying to find new music. But still, accessing new music remained an issue, despite buying Mojo (for classic rock music and dead, decrepit and generally missing in action musicians) and The Wire (for my more avant-garde tastes).Enter Spotify. Admittedly, I was a little late to the music streaming party but I've been enthusiastic ever since. I rapidly upgraded from the advert-laden free account to a paid Premium account, largely to enable listening on my iPad. I only interact with one friend on Spotify, but even that is enough to open my eyes to a wide variety of music I wouldn't normally here. I frequently don't like her suggestions, occasionally hate them, but quite frequently really enjoy her playlists. I also widely use Spotify to check out albums I've read reviews of.So, in all this, what effect has Spotify had on my music listening? Well firstly, it's enabled me to listen to music I'd ordinarily never hear. Secondly, it allows me to check stuff out before shelling out for it. I can use Spotify in conjunction with the Squeezebox to generate "Smart Playlists", uncovering some hidden gems.And guess what? I have greatly increased the numbers of albums I buy. This is an impact on the music biz that doesn't seem to be considered in many commentary articles on music streaming services. Maybe I'm an outlier here, but the exposure to music leads to increased purchasing, at least in my case. And I blundered across a review of music listening/purchasing trends among 'young' people (with a foreword by Feargal Sharkey) which as I recall seemed to indicate an unexpected (to me) desire to own the music rather than merely have a download. Another important factor is that the young do have a lower disposable income, and I would expect them to use copying to increase their music collection - much as I and my fellow students did with cassette tapes back in the 1970s. I guess what I'm trying to suggest is that this whole issue of fair remuneration for artists is wholly unresolvable without a robust dataset. And, of course, we can add to the discussion the role of the music companies in all this.

Tags:
  430 Hits

BackupPC - a smart backup application!

BackupPC This is a very flexible backup system. I'm presently using it to backup a WinXP and two Ubuntu 7.10 laptops on a daily basis to my home server. It's pretty easy to configure, especially following this guide.

Tags:
  271 Hits