the itjerk

my adventures with technology

Category Archives: Audio

audio bliss with the piCorePlayer + HiFiBerry

If one thing has changed in the past forty years of my listening to music, it’s not the music; as Lemmy said in his documentary, (to paraphrase) “you always return to the music of your youth because that’s when you figured out what music you like”. What has changed is how I listen to music; as much as I still enjoy flipping a vinyl record over (and that delicious analogue sound), nothing beats the convenience of digital streaming. Basically, I want all my music on a computer so I can access it, with a click, wherever I may be.

Not like any of this is new. Since the iTunes revolution, music has been reduced to ones and zeros, in more ways than one. The album has vanished, and CDs are mere content delivery units. Services such as Spotify, Pandora, Google Music, Amazon Prime, iTunes Airplay, etc… are the new record stores, serving and predicting what music one wants to hear. Their respective apps, and devices such as Sonos, Beep, Amazon Echo, and the newly announced Chromecast Audio are all there to push that music your way.

But I want my music, the music on my computer. Logitech Media Server, aka SlimServer or Squeezebox Server, has been my go-to for music streaming for probably a decade now. Problem is Logitech stopped making Squeezeboxes years ago. Beep seemed like a nice substitute, but honestly it mostly crashes, far too often to be considered usable.

Screenshot from 2015-09-30 04:04:27

The most elegant and inexpensive solution is the Raspberry Pi equipped with a HiFiBerry DAC running piCorePlayer. The latter has made some serious leaps in the past year in terms of usability and stability, and with the addition of the HifiBerry, sonically as well. So all of this is a long winded way of giving the trio another, hopefully louder shout-out for earning the top spot in my hifi rig. It works, it’s simple and it sounds fantastic. Thank you!

On the web:
piCorePlayer

amazon echo, arrived

echo
I received my Amazon Echo unit this week, several months after ordering it. The $99 (with Prime Membership) unit is sleek, solid, and very black. While it should have been simple to configure – get the app for Android (or via the web, as long as it’s on one’s wireless network) and follow the instructions – getting it to sign into my wifi required a call to Amazon and then a talk to the development team. (Seems the issue was with the app not recognizing WPA/WPA2 correctly). Anyway, that aside, I was up and running.
Alexa has problems understanding:
“What time is it in a stop stop?”
“Would you like to eat it blueberries?”
“when is the next bus gonna be at at us an in game”

And knowing pretty basic stuff:
Who did the chicago blackhawks play tonight?
Q&A
Sorry, I couldn’t find the answer to your question.

But she’s kinda funny:
“Would you like to eat a blueberry?
Q&A
I don’t have preferences or desires.

Are you a man?
Q&A
I’m female in character.

Are you hungry?
Q&A
I don’t get hungry or thirsty, but thank you for asking.

The kids love her,
What is eighty one minus twenty eight?
Q&A
81 minus 28 is 53.

Yet her pronunciation isn’t so good (“Jonathan Toes” vs “Toews”)

The Echo App logs “cards” of what Alexa has heard, allowing one to send feedback to Amazon, which presumably will help improve her.
She’s perfect for playing music and sounds very good, but wouldn’t it be great if she could find a UPnP server on my local network and access that? So yes, the possibilities of Echo are boundless – think Wikipedia reader, think Translator, think Sports – but she’s definitely a work in progress. I can’t wait however until I can call her Samantha or… Sudo!

squeeze2upnp + beep = lms

Screenshot from 2015-03-11 18-56-42

Logitech Media Server (LMS), the old Squeezebox Server or Slimserver, is my go-to for playing my music library on hard disk. I use a Squeezebox v3, various Raspberry Pi’s, and now with the help of this nice little program, my Beep. Squeeze2upnp (sq2u) is as it says, “a bridge between LMS and uPNP devices”. It translates LMS instructions for UPnP devices. More simply, it makes my Beep appear as a playback device in any LMS app or webpage.

You can download Squeeze2upnp below, it’s precompiled for Linux and Windows. There’s instructions in the user guide on how to set it up and get it running. Make sure your Beep is playing while Squeeze2upnp is in “discovery” mode, and be sure to daemonize it with the “-z” option, otherwise CPU usage goes through the roof. You will also have to edit the config.xml file to support FLAC playback. Also, you may have to monkey with your firewall, I’m not sure what ports it uses, but it caused an issue for me. (more later).

to discover UPnP devices on local subnet and configure sq2u to play them:
./squeeze2upnp-x86 -i config.xml
to daemonize sq2u:
./squeeze2upnp-x86 -z

That’s it, give it a few minutes and your UPnp device will appear
Big shout out to philippe44 for his active development of the Squeeze2upnp program. I had an issue with it crashing, sent him a debug file, and all is now well. That’s the beauty of FOSS.

Update: philippe44 is currently working on a third-party plug-in for LMS that automates discovery and playback to your Beep inside the LMS interface. Check out the thread above at slimdevices.com for more info.

On the web
https://github.com/philippe44/LMS-to-uPnP

this is beep

Just before the holidays I received Beep, a $99 music streaming device. It’s a very simple thing, whose purpose is to provide wireless streaming capability to dumb systems, like a pair of powered speakers, stereo system, boom box, well, just about anything that has an audio input that accepts either 3.5mm analog or digital optical output. I especially like that last part, digital. The Beep runs on 5VDC, sports a metallic finish and consists of a large multifunction knob (start/pause/skip/stop/volume) and some cool flashing lights.

It’s controlled by an app, available on either Android or iOS, that also helps you setup the player on your network. When I first got it, Beep was pretty limited. I could play either Spotify or Pandora, or in my case, neither (because I don’t use either service), though it now also supports SomaFM radio. Okay, it’s still pretty limited. No support for Google Play, Amazon Music, that iTunes thingy, etc.
Screenshot_2015-03-09-17-01-40
Recently however, Beep have added support for DLNA music servers. This is great news, because I can now play all the music on my local media server via the Beep. In order for me to do so, I first installed MiniDLNA software on my Ubuntu box using apt-get, manually edited the config file to get it setup, and opened a few ports in my computer’s firewall, 8200 TCP and 1900 UDP to let MiniDLNA out. It would have been easier if the Beep would just connect to my Squeezebox Server (aka LMS), but it’s just not there, yet…

It would also be better if Beep were a little more stable, and transparent. Throughout the day it randomly lights up “smiley face” (looking for network connection) and “sun shining” (all lights glowing, who knows what this means). That’s ultimately going to be the hard sell on Beep: without a display, no one wants to decode blinking lights; what’s it doing? why is it doing that? It just needs to work.

To use Beep as a renderer (something that plays media from a DLNA server), I had to get another Android app, BubbleUPnP. It’s a fairly straight forward app, though I did have to install the “demo server” in order for it to find my MiniDLNA server. Not sure if this is me or the app, but it was not very intuitive to figure out. That done, however, I can stream my server’s music library to whatever I connect my Beep to.
Screenshot_2015-03-09-16-50-06

On the web:
Beep | Bringing music to every room in your home
MiniDLNA
BubbleUPnP Server

new year brings model b+, beep, chromebook

Happy holidays and all that. Xmas brought a few new electronics to the household, here’s a very brief recap:

Raspberry Pi B+ replaced the old model B. I have a feeling that the old one was a dud somehow because every time it had an unclean shutdown, I had to reformat the SD card. Anyway, in with the new out with the old.

I received my Beep unit just before the holidays, in fact, even before email notification of the shipment. But of what use is a music player – one that handles digital output btw – if there is not any software that can access the music that you actually own!?! In a box it will sit until I can use it with something other than Spotify or Pandora.

The Acer Chromebook is quite nice, though the keyboard takes a little getting used to. Supervised mode is a bust because although you can limit/restrict web access, it is not possible to allow a supervised user the use of apps or extensions.  Really Google?

gear…

10552619_587868511324026_138143329154628104_n

linux box, clean install

Hardware all happy, it’s time to do a clean install of Ubuntu 14.04 LTS. The most important step before installing is to get a complete backup and a list of applications/settings etc. before tearing down the old computer! It’s also a good time to think about your new system, so consider what needs to be installed, and what needs to stay backed up, and what needs to be forgotten.

After installing from disk and running apt-get update/upgrade, there are a few usability tweaks I want to do right away:
1. Add packages nautilus-terminal, openssh-server, numlockx, update-motd, weather-util, landscape-common.
2. Setup ssh keys for my hosted server, and secure sshd!
3. Disable guest login in lightDM.
4. Import bookmarks and set panel applets (this could be a lot easier Canonical).
5. Fix writing to USB drives, then flash motherboard bios (F9 to F12)
sudo hdparm -r0 /dev/sdg

Then,
1. Configure router DHCP to give computer a fixed IP via MAC address.
2. Set privacy options in Unity. Include Imageviewer and Movie ;).
3. Install firewall (using gufw).
4. The fstab entries: Mount my new media hard drive. Side note here, always, always mount these things to /mnt/. The /media/ directory is not for anything in /etc/fstab. My backup directory (which is on a NAS drive), I have to enable cifs-utils, and set the cifs password.
5. Restore data from backup, sparingly.
6. Install applications, ditto.

Music stuff:
1. sudo apt-get install eyed facc lame flac vorbis-tools moc sox
2. I also installed Audex, Banshee, EasyTag, DeVeDe, Asunder, VLC, Audacious and Audacity.
3. Reinstall Logitech Media Server, located here.

Webserver:
1. Reinstall LAMP. You’ll be prompted to set MYSQL password, so be prepared with the one for your old databases!
sudo apt-get update.
sudo apt-get install tasksel
sudo tasksel install lamp-server

2. Create empty MYSQL databases, then restore backups. It’s as easy as:
mysql -u root -p
Create database databasename;
exit

then
mysql -u root -p databasename < path/to/backup.sql
3. Copy website backup to /var/www (or wherever), fix permissions. Then set initial directory in sites-available/default.conf and restart apache2.
4. For Drupal, I need to install php5-gd and add cron.php to crontab. For clean urls, I need to enable mod_rewrite (a2enmod rewrite) and configure .htaccess by adding this to sites-available/default.conf:

<Directory /var/www>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
<Directory>

5. Restart apache2.

SSD:
Because I now have a speedy SSD drive (oh yes, it’s fast!), I read up on potential tweaks to improve performance and life of the drive. With 14.04, the trim command is executed weekly (/etc/cron.weekly/fstrim) by default. This is fine because my box is on 24/7, otherwise it should be moved to rc.local so it executes on boot. If you want to check if trim is enabled, try this script:
sudo hdparm -I /dev/sda | awk '/.*TRIM supported.*/{ if ($1 == "*") print "Yes, TRIM is enabled"; else print "No, TRIM is not enabled.";}'
1. Add noatime parameter to /etc/fstab for / to disable file read stamps.
2. Create a virtual file system with /etc fstab:
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0
3. Then, move browser Firefox and Chromium caches to /tmp
4. Change swappiness? Actually I don’t use swap. RAM is cheap and faster!
5. Finally, I debated moving /home off the SSD, but couldn’t discern any benefit: I mean, every $$$ notebook ships with one, right? Easy to get sucked into all the tweaking… So I’ll opt for just paring down what’s in my home folder, and moving music, photos and videos to my /mnt/media drive. Heck I should buy another disk and create a RAID 1 for all that media…

Anyway, that’s got me up and running. Job complete.

HiFiBerry DAC

hifiberry-kit

HiFiBerry

Arriving today from Switzerland, the €36 (delivered) HiFiBerry is a “high-resolution digital-to-analog converter for the Raspberry Pi …with a Dedicated 192kHz/24bit high-quality Burr-Brown DAC for best sound quality.” The daughter-board plugs directly onto the RPi’s onboard connector P5, but does require you to solder an 8-pin header to the RPi in order to do so. You’ll also need to solder the output(s) you want on the HiFiBerry as well. Easy enough, I had it connected in a few minutes, and did a quick check to see if the RPi recognized it, then went to the piCorePlayer web interface to configure it to send sound through the HiFiBerry.

aplay -l
card 1: sndrpihifiberry [snd_rpi_hifiberry_dac], device 0: HifiBerry DAC HiFi pcm5102a-hifi-0 []

How does it sound? Fantastic, very clean and detailed, in a word, audiophile grade. The key is Inter-IC Sound or I2S. You can read all about it here but it’s a short, isolated path for PCM data, with extremely low jitter. Which is a great thing, because both analog out and USB audio on the RPi weren’t optimal for quality sound. No noticeable noise floor (as I’m running the TA2024 without a volume pot), it’s a dead silent performer (which is a great thing). Cheers to the RPi people for making I2S available on the Pi, and to the HiFiBerry folks for an affordable, high quality product.

IMG_20140331_151340

piCorePlayer

Screenshot from 2014-03-23 18:59:18

piCorePlayer

Another Raspberry Pi distro today, this one is piCorePlayer, a “dedicated Squeezebox player .. for your Raspberry pi board.. that runs a Microcore and Squeezelite.” Small it is, I used an ancient Palm 64MB SD card to write the image on, and it runs in RAM so no need to worry about the image ever getting corrupt; you can simply unplug the RPi to stop it. Everything worked effortlessly, I even got the USB wireless going, along with the USB DAC from Xitel. The RPi shows up in Logitech Media Server just as any other Squeezebox player. The benefit here is that I don’t have another interface to get used to; I am already using ol’ Slimserver. piCorePlayer supports a lot of outputs from the RPi, including analog audio, hdmi, usb audio (though the tweak for fixing crackles didn’t really work for me), and the I2S interface, which means I’ll be able to try it when I receive my HifiBerry!

update: upgraded to piCoreplayer 1.14d crackles still remain via usb output.

tripath ta2024

To further the geek factor, I hooked my new Rasberry Pi up to a $8 t-amp I finally got to wiring up after a year or two in the box. It’s got the TA2024 chip, and sounds pretty sweet. I’ll get it hardwired into a case for it at some point.
Update: modded with Auricaps. Sounds fantastic, rich tones, deeper bass.
IMG_20140327_204313