Raspberry Pi audio player and/or server using piCorePlayer
with BBC Sounds and Qobuz via a USB DAC

Version: 2022-04-05 picoreplayer 8.1.0, install from scratch. Notes by: John A. Phillips

SEE FOR INFORMATION

·      https://www.picoreplayer.org/ (see the configuration options); and

·      https://docs.picoreplayer.org/how-to/ (installation HOWTO).

SELECT A CONFIGURATION OPTION (SEE THE URL ABOVE)

·      Option 3: Integrated player and music server in one box (Squeezelite and LMS): use basic setup steps 1 – 5 incl., 7 onward.

·      Option 2: Dedicated music server (LMS): use basic setup steps 1 – 4 incl., 6 onward.

·      Option 1: Dedicated player (Squeezelite): use basic setup steps 1 – 5 incl.

ASSEMBLE THE EQUIPMENT

For the permanent installation:

·      RPi, PSU and case.

·      µSD card (16 GB suffices but it could be smaller).

·      USB 2.0 A to B cable (AKA printer cable) to connect the RPi player to the DAC.

·      Wireless or Ethernet network connection to the RPi.

·      Web browser on the network to control the RPi music server (e.g. on a PC or mobile phone); or a specialist control application (e.g. iPeng 9 for the iPhone).

·      BBC Sounds account (and the BBC Sounds application for iPhone).

·      Qobuz subscription (and the Qobuz application for iPhone).

·      USB memory stick for storing music library files on the RPi music server.

For setup:

·      Host PC with network access and browser.

·      µSD card adaptor for the host PC.

·      µSD card image burner on the host PC (multi-OS: RPi imagerhttps://www.raspberrypi.org/downloads/ – there are others).

Potentially useful but not essential:

·       Spare µSD card for experimenting.

·      µSD card formatter on the host PC (for Windows: SD Card Formatterhttps://www.sdcard.org/downloads/formatter/).

·      SSH terminal application (e.g. PuTTY) running on a networked PC to run commands directly on the RPi. This can occasionally be useful after setup. Alternatively use a USB keyboard and HDMI TV/display.

·      TV/display with HDMI input and HDMI lead to observe directly what the RPi is doing but only during the early setup steps (e.g. boot-up), not thereafter.

DO THE BASIC SETUP STEPS FOR YOUR OPTION

1. Create a bootable µSD card. On the host PC, optionally format the µSD card. Download picoreplayer [1]. Write it onto the µSD card and verify the flashed image if possible [2].

2. Connect the RPi to your network. To set up wireless from the start, on the host PC, create a file called wpa_supplicant.conf [3] and copy it onto the top level of the flashed µSD card. Alternatively connect to the network via an Ethernet cable. Or do both (and turn off WiFi if not being used).

3. Safely eject the µSD card, insert it into the RPi and power-up the RPi. [Options 1 and 3] Also connect and power the USB DAC here before the RPi is powered-up. Wait (less than a couple of minutes) until the next step works.

4. Open the PCP-homepage with a browser on the host PC. Use PCP-homepage = http://pcp.local. Alternatively, if the default RPi hostname resolves via DNS on your network, use PCP-homepage = http://piCorePlayer/ or use the IP address your network assigns to the RPi (PCP-homepage = http://<IP address>/).

5. [Options 1 and 3] Set up the USB DAC. With the USB DAC powered and connected, under the Squeezelite Settings tab, set:

(i)        Audio device output: “USB audio” (from the menu) and “Save” (there may be an INFO message about the OUTPUT field setting – click “OK”).
(ii)       Output setting: <DAC-specific> [5].
(iii)      Max sample rate: <DAC-specific> [5].
(iv)      Upsample setting: “vE:::28:::” (resamples only unsupported rates).

And click “Save”. Reboot (this can be delayed until after any further optional steps below).

6. [Option 2] Disable Squeezelite (for LMS only). Under the Tweaks tab (the “Audio tweaks” heading) check “No” against “Squeezelite” and click “Save” (effective after a later reboot).

7. [Options 2 and 3] Prepare for LMS. Under the Main Page tab, click “Resize FS”. Use the whole µSD card [7] and click “Resize”. This takes maybe two minutes with several reboots.

8. [Options 2 and 3] Install and start LMS. Under the LMS tab:

(i)        Select “Player/Server” menus and click “Install LMS” [4].
(ii)       With no mysqueezebox.com account to integrate (or if this is not desired) set “No MySB” to “yes” and click “No MySB”.
(iii)      Click “Start LMS”.

9. [Options 2 and 3] Do the initial LMS set-up. Open the port 9000 LMS-homepage with a browser. Use LMS-homepage = http://pcp.local:9000. Alternatively, use LMS-homepage = http://piCorePlayer:9000/ if the default name resolves via DNS; or use LMS-homepage = http://<IP address>:9000/ using the IP address assigned to the RPi; or there is a link at the top of the PCP-homepage. Then:

(i)        Skip setting the Local Music Folder – click “Next”.
(ii)       Skip setting the Playlist Folder – click “Next”.

And click “Finish”.

10. [Options 2 and 3] Install plugins: BBC Sounds, Qobuz and Airplay renderer. Under Settings -> Plugins:

(i)        Tick to enable the “BBC Sounds”, “Qobuz” and “ShairTunes2 (fork)” plugins.

And click “Apply” [4]. There may be a warning about third party content – if so, click “OK”. Click “Restart now” when prompted. Wait for the “OK” panel to appear and then wait some more (another 60 seconds?) for the re-start to happen before you click that “OK”.

Reload the Plugins page to check that the plugins are active. Reload the LMS-homepage to check for Qobuz and BBC Sounds in “My Apps”. This complete process often needs patience and occasionally needs some re-tries for downloads to arrive and install.

11. [Options 2 and 3] Configure plugins: BBC Sounds, Qobuz via LMS and Qobuz via iPhone:

(i)        Under Settings -> Advanced -> BBC Sounds enter the BBC Sounds account and password. Click “Sign In” and wait for “Successfully signed in” to be displayed. Set preferences as desired. Click “Apply” [8].
(ii)       Under Settings -> Advanced -> Qobuz enter the Qobuz account and password. Set preferences as desired and click “Apply” [9].
(iii)      Under Settings -> Advanced -> ShairTunes2 (fork) tick “let timing references drift” and click “Apply”.

OPTIONAL SETUP STEPS FOR ALL OPTIONS

A1. [Recommended] Change the RPi default password. On the PCP-homepage, under the Main Page tab, select “Beta” menus (note the warning). Select the “Security Page” and under the “tc password” tab change the password from the default (“piCore”) to something new and click “Save”. Test the user “tc” login if you have PuTTY or a keyboard and display.

Restore menus to “Player” [Option. 1] or “Player/Server” [Options 2 and 3]

A2. [Recommended] Change the player’s name and the hostname from default to something meaningful [10]. This is especially recommended if two or more piCorePlayer boxes are on the network.

(i)        Under the Squeezelite Settings tab change the player’s name and click “Save”.
(ii)       Under the Tweaks tab change the hostname and click “Save”. Effective after a reboot.

NB: Browser access by name will change (perhaps with some caching delay). Use the new name (or use the assigned IP address as detailed previously).

A3. Turn off power supply LED after booting. Under the Tweaks tab, put text “echo 0 | sudo tee /sys/class/leds/led1/brightness” in the “User command #1” box and click “Save”. The same with “led2” turns off the activity LED if desired. Effective after a reboot.

A4. Turn off test/install features. Under the Tweaks tab, check “No” against “Broadcast .local” and click “Save”. Check “No” against “piCorePlayer Tabs” and click “Save”. Check “No” against “LMS Controls Toolbar” and click “Save”.

A5. Turn off the HDMI output. This should reduce power consumption a little. Disconnect the HDMI lead if used earlier. Under the Tweaks tab, set HDMI power to “off” and click “Save” (will download a PCP extension [4]). Effective after a reboot.

A6. Check for any piCorePlayer software updates. On the Main Page tab, do any required updates with “Patch Update” first then “Minor Update” (these may or may not actually do an update [4], and may need a reboot).

OPTIONAL SETUP STEPS FOR SQUEEZELITE PLAYER [options 1 and 3]

S1. Auto-start a favourite (e.g., a radio station) at power-up. If favourites are already set up on an available LMS server (see below), under the Tweaks tab select a favourite, set “Auto-start favourite” to “Enabled” and click “Save” [6].

Check with the “Test” button. Return to this step if LMS is set up later.

S2. Check for Squeezelite software updates. On the Main Page tab, “Update Squeezelite Extensions” (these may or may not actually do an update [4] and may need a reboot).

S3. Add DSD playback by the DAC (DSD-64 and DSD-128 streams via DoP). Under the Squeezelite Settings tab, set “Device supports DSD/DoP” to “0:dop” and click “Save”. There is a short tick from my DAC when changing rate. Also note the later alternative setup for DSD transcoded by LMS.

S4. Disable analogue audio. Under the Squeezelite Settings tab, click “Card Control” to disable the onboard analogue soundcard and click “Save”. Needs a reboot and then sometimes you need to check the audio output setting and re-set it if required.

S5. Reduce Ethernet to 100 Mbit/s to protect USB.  Install ethtool.tcz via “Extensions” on the Main Page tab. Under the Tweaks tab, put text “sudo ethtool -s eth0 speed 100 duplex full” in the “User command #2” box and click “Save”. 

OPTIONAL SETUP STEPS FOR LMS SERVER [options 2 and 3]

Configure LMS

M1. Turn off LMS volume control leaving the audio system’s volume control fully in charge. Under Settings -> Player tab -> <Player Name> Audio (<Player Name>=CDA2 for me). The player must be turned on to see the settings:

(i)        Set Volume Control to “Output level is fixed at 100%”.
(ii)       Make sure “Volume Adjustment/Replay Gain” is turned off (it should be by default).

And click “Apply”.

M2. Additional user interface. Under Settings -> Plugins: Tick to enable the “Material skin” plugin and click “Apply” [4]. The interface is accessed as LMS-homepage/material/. Note the earlier points about procedure when installing plugins.

Set up favourite BBC radio station(s)

B1. Set up radio station(s) as favourites. Under My Apps -> BBC Sounds -> Stations & Schedules -> <station> -> <station> LIVE, click relevant heart symbol(s). Check by playing a station from the LMS-homepage favourites list. If desired, return to Squeezelite setup (options 1 and 3) to auto-start a favourite [6].

Adjust interface time and date formats

F1. On the LMS-homepage, under Settings -> Interface, set time and date formats according to taste and set items per page and click “Apply”. For me: Short date = YYYY-MM-DD (ISO); Long date = YYYY-MM-DD WWWW; Time = hh:mm (24h).

Set up local music library on USB memory stick

U1. On the PCP-homepage, under the Main Page tab click “Extensions” and wait for the network checks. Under the “Available” tab select “exfat-utils.tcz” and click “Load”.

U2. Under the LMS tab, under Install and Enable additional File Systems click “Install”.

U3. Connect a USB stick or low power disc to a RPi USB port.

U4. Under the LMS tab, under Pick … USB disks to mount:

(i)        Tick the disk mount point (/dev/sda1), name the mount point (/mnt/<name> with <name>=LocalMusic for me) and click “Set USB Mount”.
(ii)       For a first time install of the USB stick click “Set Write Permissions”.

U5. On the LMS-homepage, under Settings -> Basic Settings add a Media Folder called /mnt/<name>/, optionally set Media Library Name = <name> but it could be left blank or be different, tick what files it contains and click “Apply”.

U6. If the above does not successfully re-scan the library, under “Rescan Media Library” select “Clear library and rescan everything” and click “Rescan”.

Provide Samba access from Windows PC to local music library

W1. On the PCP-homepage under the LMS tab and the Setup Samba Share panel click “Install”.

W2. Set up Samba: Server Name = “LMS”; Server WorkGroup = “WorkGroup”; Share Name = “LMSmusic”; Share Path = “/mnt/LocalMusic”; Create File mode = “0755”; click “Set Shares”.

W3. Enter a Samba password for user “tc” (this is not the same as the host password for user “tc”) and click “Set Password” [11].

Add alternative DSD playback via LMS conversion of DSD to PCM

D1. On the LMS-homepage, under Settings -> Plugins tick to enable the “DSDPlayer” plugin and click “Apply” [4].

D2. under Advanced -> File Types disable “Native” under DFF and DSF leaving “dsdplay” under FLAC and click “Apply”. Note also the alternative DSD setup for Squeezelite, which this step overrides.

Update LMS and LMS plugins as desired

N1. On the PCP-homepage, under the LMS tab, under “Set Branch” select “Stable”; click “Set Branch”; click “Update LMS” then click “Manual Update”.

N2. If the LMS-homepage shows that an update to the current version of LMS is available, on the PCP-homepage under the LMS tab click the “Nightly Update” button.

N3. If the LMS-homepage shows that an update to one or more LMS plugins is available, on the LMS-homepage, under Settings -> Plugins tick the new versions to use and click “Apply”. Note the earlier points about procedure when installing plugins.

NOTES

[1]       The Standard 32bit Kernel. The 64bit Kernel can be used for the right RPi but may not work any better. The RealTime Kernel is no longer supplied.

[2]       Ignore any operating system complaints about unformatted unused space. Also, note that flashing a µSD card is not always reliable. If booting the RPi from the card fails, or some function fails to work, try flashing it again.

[3]       Use the following text configured for the wireless network’s <country> (<country> = GB in my case), <SSID> and <password>:

# Maintained by piCorePlayer
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=staff
# Two Character Country Code
country=<country>
update_config=1

network={
            ssid="<SSID>"
            psk="<password>"
            key_mgmt=WPA-PSK
            auth_alg=OPEN
}

If this file is created with a text editor as “wpa_supplicant.txt”, view file name extensions, remove the “.txt” extension and replace it with “.conf”. I suspect Windows line terminators vs Unix line terminators is significant but dos2unix can fix that.

Wireless can be set up at the start and disabled later if not finally needed.

[4]       The step fails (and some others too) if SourceForge’s piCorePlayer.sourceforge.net project page is down (it does happen). If so, the step will need to be re-tried later.

[5]       For me, Output setting = “hw:CARD=Amanero,DEV=0” (for available options click “more>” next to “Output setting”). For me, Max Sample Rate = “44100,48000,88200,96000,176400,192000,352800,384000:0”.

[6]       Auto-start must be enabled on the player (Squeezelite) but favourites are set up on the server (LMS).

[7]       Alternatively use a convenient size to leave unused space on the card for music or something else. This partition must accommodate LMS (about 45 Mbytes), the LMS cache and any other added plugins/features.

[8]       The BBC Sounds app on an iPhone will play via AirPlay but this always resamples from BBC’s 48 kHz sampling rate to 44.1 kHz.

[9]       Ensure the Qobuz app on an iPhone only streams and downloads from Wi-Fi (disable mobile data). Also download from WiFi at no more than 16/44 (Apple AirPlay always resamples to 16/44 for remote players – there is no point in trying better via iPhone).

[10]    For me, default player name => “CDA2” [Options 1 and 3] and “LMS” [Option 2]. Default hostname => “CDA2” [Option 1] or “LMS” [Options 2 and 3]. Squeezelite seems to report the player name to the DHCP server and hence to the local DNS while LMS (without Squeezelite) seems to report the hostname.

[11]    Access from a Windows PC is via running “\\LMS\LMSmusic” or adding this as a network location. If the share does not appear as a network location under “This PC”, use “Map network drive” to the share with “connect using different credentials” ticked then using the Samba password. This should be remembered by Windows in future. The music library on the Linux PC is \\linux\Music or \\192.168.1.3\Music.

VERIFICATION CHECKS

·      Check the http://LMS:9000, http://LMS:9000/material and iPeng interfaces.

·      Check that BBC Radio 3 plays automatically when the player boots.

·      Play BBC stations from LMS.

·      Play BBC stations from iPhone via AirPlay.

·      Play LMS library PCM files.

·      Play LMS library DSD files native (turn on native DSD if turned off).

·      Play LMS library DSD files transcoded to PCM (turn off native DSD if turned on).

·      Play Qobuz streams from LMS.

·      Play Qobuz streams from iPhone via AirPlay.