I've obtained
- A Raspberry Pi 3, from The Pi Hut, along with an 8GB SD card and a development box
- An ODAC USB DAC from Head n Hifi, which is pretty cool
- Maybe I should have considered an I2S-connected DAC, but I figured that one I could re-use with any computer would be handy
- MinimServer as a UPnP-enabled media server
- Linn Kinsky as a UPnP control point
- MPD as a renderer, with upmpdcli as a UPnP interface
- My initial thinking, based on this article, was to use volumio, but that isn't supported on RPi 3 yet, not sure why it's so different from RPi 2 but hey... Other packages are available, but for the moment so I understand what's going on, I'm going to hand-roll it. Maybe in future I'll just use a package.
I also need hard drives for holding music files, so I'm currently using a 2.5" format 250GB drive that was my MacBook Pro drive until I got an SSD :-), connected via a SATA-USB cable. I've formatted this as exFAT, which was the option on the MacBook, but it proved slightly tricky to mount on the RPi... Problem solved with HTPC Guides, a wonderful site that I think I will live at for a while...
Steps so far:
Steps so far:
- Tried ODAC with main hifi - sounds really good, using Audirvana Pro on free trial
- Music disk
- Formatted 250GB drive as exFAT on MacBook
- Copied some files to it - I need to work out how best to label and index these, lots of room for experiment there!
- iPhone
- Loaded Kinsky - seems to find Minimserver just fine
- Now I need a "room" for it to play in!
- RPi
- Until my additional RPi arrives, I'll put everything on one, rather than having a separate media server and renderer...
- Loaded with latest Raspbian jessie, and updated to latest
- Installed MinimServer - can be detected by Kinsky!
- Attached drive - can see files; I wonder if I need to do anything about the power supply, since it's running on USB power
- Following the guide here, but the setfacl commands are apparently not supported on this device type?!
- Installed MPD and upmpdcli
- I attempted this but I suspect that this build is set up for Debian wheezy, not jessie, I'm getting errors...
- The originator of the revised upmpdcli expected a 0.19 version MPD instead of the 0.16 that existed when wrote the note; checking www.musicpd.com they are up to 0.19..x..x.x, so we'll revert
- So renamed the mpd.list in /etc/apt/sources.list.d so it's ignored...
- Did a sudo apt-get update
- Did a sudo apt-get install mpd
- That worked ok - now for upmpdcli...
- Requires upmpdcli.list in the sources.list.d directory, so renamed the old mpd one for that!
- Did sudo apt-get update; sudo apt-get install upmpdcli
- Damn....
- Reading package lists... Done
- Building dependency tree
- Reading state information... Done
- E: Unable to locate package upmpdcli
- Mistyped... mdp vs mpd...
- Still doesn't work!
- Reading the MPD installation instructions, it appears that I need to use "jessie" instead of "unstable" in the sources list file...
- No, I don't! I need ".../debian/..." not ".../mpd-debian/..." and "unstable" not "jessie" i.e.
- deb http://www.lesbonscomptes.com/upmpdcli/downloads/debian/ unstable main
- deb-src http://www.lesbonscomptes.com/upmpdcli/downloads/debian/ unstable main
- Now running... Hurray!
- pi@raspberrypi:/etc/apt/sources.list.d $ ps -ef |grep mpd
- mpd 4326 1 0 11:44 ? 00:00:00 /usr/bin/mpd --no-daemon
- upmpdcli 5367 1 0 12:15 ? 00:00:00 /usr/bin/upmpdcli -D -c /etc/upmpdcli.conf
- I may still need to switch to the upmpdcli version of MPD to resolve some bugs, in which case I'll need to review the sources files
Working!! At least, Kinsky is seeing both the server and the renderer, and in principle I'm playing some music, but I need to connect it to the stereo...
It transpires that MPD can't see the DAC! Now I need to check I've got that configured right...
OK, reconnected ODAC - now it can be seen, and I can use
aplay -D plughw:1,0 /usr/share/sounds/alsa/Noise.wav
to play white noise. -D hw:1,0 doesn't work though!!
Also, speaker-test -c2 -D hw:1,0 works ok as well. WTF?? [Later: Realised clever old speaker-test generates a pink noise signal that suits the DAC, because it clearly enquires what the DAC can do and gives it to it!]
Tried alsamixer -c 0 which displays the ncurses control - raised volume to top of green, did same for -c 1, now aplay -D hw:[0|1],0 FrontCentral.wav seems to work.
Current state:
It transpires that MPD can't see the DAC! Now I need to check I've got that configured right...
OK, reconnected ODAC - now it can be seen, and I can use
aplay -D plughw:1,0 /usr/share/sounds/alsa/Noise.wav
to play white noise. -D hw:1,0 doesn't work though!!
Also, speaker-test -c2 -D hw:1,0 works ok as well. WTF?? [Later: Realised clever old speaker-test generates a pink noise signal that suits the DAC, because it clearly enquires what the DAC can do and gives it to it!]
Tried alsamixer -c 0 which displays the ncurses control - raised volume to top of green, did same for -c 1, now aplay -D hw:[0|1],0 FrontCentral.wav seems to work.
Current state:
pi@raspberrypi:~ $ amixer -c 1
Simple mixer control 'PCM',0
Capabilities: pvolume pswitch pswitch-joined
Playback channels: Front Left - Front Right
Limits: Playback 0 - 110
Mono:
Front Left: Playback 79 [72%] [-15.50dB] [on]
Front Right: Playback 79 [72%] [-15.50dB] [on]
so I've got some volume on there. I wonder if I should go to 0db?
More interesting info about ALSA and RPi here... I've set the ODAC to 100% volume, so let's see what happens.
Tried
Tried
aplay -v -c 2 -D plughw:1,0 /media/pi/Thomas\ Dolby/Oceanea\ EP/Lossless/03\ To\ The\ Lifeboats.wav
Playing WAVE '/media/pi/Thomas Dolby/Oceanea EP/Lossless/03 To The Lifeboats.wav' : Signed 24 bit Little Endian in 3bytes, Rate 48000 Hz, Stereo
Plug PCM: Hardware PCM card 1 'ODAC-revB' device 0 subdevice 0
Its setup is:
stream : PLAYBACK
access : RW_INTERLEAVED
format : S24_3LE
subformat : STD
channels : 2
rate : 48000
exact rate : 48000 (48000/1)
msbits : 24
buffer_size : 24000
period_size : 6000
period_time : 125000
tstamp_mode : NONE
period_step : 1
avail_min : 6000
period_event : 0
start_threshold : 24000
stop_threshold : 24000
silence_threshold: 0
silence_size : 0
boundary : 1572864000
appl_ptr : 0
hw_ptr : 0
with success! But why?? Note it's plughw, not hw.
Found out! hw provides direct unmediated access to the hardware driver, so if the sample rates etc. are not supported by the device, it just errors. plughw provides an intermediate software layer that converts the data stream to match the modes provided by the card. Hurray. so
aplay -v -c 2 -D hw:1,0 /media/pi/Thomas\ Dolby/Oceanea\ EP/Lossless/03\ To\ The\ Lifeboats.wav
works just fine! So how do I make sure all this works from mod?
Easy... just modified /etc/mpd.conf so that it has hw:1,0, and Robert is your father's brother. Ridiculous. I think the main points are
Easy... just modified /etc/mpd.conf so that it has hw:1,0, and Robert is your father's brother. Ridiculous. I think the main points are
- Make sure the DAC is properly plugged in! Check using the ALSA utilities
- Check the replay volume
- Know your format - if the format is not supported by the DAC, then plughw will be required - critical if I'm to get a straight-through path organised
- I have some nominal 24/96 material in AIFF (CD) (Bowie's Blackstar) but it appears to be 3 bytes when the card is claiming it supports only 2 i.e. 16 bits?! So it doesn't play..
- Curiously, the ODAC web site says "Audio Formats 16/44, 16/48, 16/88.2, 16/96, 24/44, 24/48, 24/96" - that includes 24/96!!
This blog talks about sndfile as a possible decoder choice - put that in mpd.conf, makes no difference, I suspect mpd has all the modules/plug-ins it needs, and only needs to be configured for the ones that change its behaviour from an i/o point of view.
Tried converting Blackstar.aif to Blackstar.flac - now Kinsky appears to be having trouble forgetting the old one! Checked the file content, it appears to be 24 bit, according to Apple mdls.
Tried converting Blackstar.aif to Blackstar.flac - now Kinsky appears to be having trouble forgetting the old one! Checked the file content, it appears to be 24 bit, according to Apple mdls.
No comments:
Post a Comment