Debian 8 MPD Install With Botic Optional
Debian 8 MPD Install With Botic Optional
----------------------------------------------------------------------------------------------------------
Index:
Chapter 3 : running Debian/Botic from the SD-card or from EMMc flash memory ?
Chapter 4 : updating Debian Linux and installing Music Player Deamon (MPD)
Chapter 5 : getting your music over LAN from a NAS or other computer
USB DAC:
As most of you know Linux + MPD is a fine platform for playing music to a DAC connected to
the USB output of the BeagleBone Black (BBB).
I mention BeagleBone Black (with wired LAN) as this platform is probably the safest choice as
there might be issues with other BeagleBone products due to other requirements in software
which are not included so you need to fix it yourself.
If you are not a Linux expert I guess you will have a hard time fixing it.
So if you are using BBB USB out USB DAC follow chapters 1 – 2 – 3 – 4 – 5 - 6.
I2S DAC:
Since Miero developed a special driver enabling the possibility to get the I2S signal out directly
from the header pins we get other options handling the audio signal.
This special driver is called “Botic” and is more complicated to handle compared to using USB
out to a USB DAC.
Please realise that the standard Debian Linux does not provide I2S out.
So if you are using BBB I2S out Isolator*/reclocker*/DAC follow chapters
1 – 2 – 3 – 4 – 5 – 7 - 8.
* The isolator and/or reclocker are optional, see Twisted Pear Audio (and others) for options.
For more information on Botic see:
http://bbb.ieero.com/
https://www.diyaudio.com/forums/twisted-pear/258254-support-botic-linux-driver.html
https://github.com/miero/linux-beagleboard-botic
http://www.twistedpearaudio.com
When using I2S out you can use the USB port for something else like a thumb-drive with
music or an external harddisk with even more music.
This external harddisk can contain all your music so you do not need to do the “music over
LAN network” related steps from chapter 5.
See the article about “how to mount USB storage” on hifiduino how to mount your direct
connected storage devices:
https://hifiduino.wordpress.com/2014/03/19/beaglebone-black-accessing-usd-and-usb-storage/
==========================================================
Please note that the image file is compressed (like a ZIP file) and you need to unzip it first with
a program like “7ZIP” (free download from internet)
Use program “Win32Diskimager” (free download from internet) to select the 3.5 Gb image file
and copy it to and micro-SD-card (select correct Drive-letter for card) and press the button
“Write”
==========================================================
Chapter 2 : installing Debian Linux
Insert SD card in BeagleBone, hold “boot button” above the SD-card and power up.
At start all 4 LED’s on BBB will light and then you can release the boot button.
The boot button forces the BBB to boot from SD-card even when functioning OS is on EMMc.
At first time booting from SD-card after 1-2 minutes the BBB should be running and connected
with your LAN.
Use an IP scanner like “Advanced IP Scanner” (free download from internet) and look for
device “arm” or “Texas Instruments”
Smart would be to save the session so you can select it easier the next time.
Press “Open” and working with Linux starts now !!
PuTTY will open a terminal screen (similar like Microsoft DOS before Windows was standard)
All text in red is what you need to type yourself as command and press “Enter”
If you are not confident with re-typing long and strange commands copy / paste is done like
this:
Copy a command from this document is standard Windows (select with mouse and type
“Ctrl+C”) but to paste in Linux you only need to right-click with your mouse on the green
cursor to paste the text/command.
The other way around is selecting some text in Linux with your mouse is already enough to
copy it and you can paste it in Windows as usual with “Crtl+V” or right-click again in Linux if
you want to copy text from one Linux file to another.
----------------------------------------------------------------------------------------------------------
Login: debian
Password: temppwd
When you start a new PuTTY session you always need to activate root privileges again with
sudo su !!!
==========================================================
Chapter 3 :
running Debian/Botic from the SD-card or from EMMc flash memory ?
Please realise that you are running Linux from the SD card now, which is relatively slow, and
less expected lifetime of the SD-card compared of running of the onboard flash memory EMMc.
You better keep running from SD-card for now anyway until we completely finish the
configuration.
When completed we can still copy the SD-card to EMMc (BBB rev. C !!) and keep the SD-card
as backup (do not change the files and keep it safe) when you need to re-flash EMMc if you by
accident removed some files or made other configuration mistakes in EMMc.
To copy the SD-card now to EMMC and continue configuration in EMMc can be done too but
when you need to re-flash in the future you also need to repeat all following steps again …
your choice.
My preference is to create an SD-card with the final configuration and keep that one safe.
A benefit to run Linux from the SD-card is when you need to change hardware just put the
card in the new BBB and it will work immediately like usual.
----------------------------------------------------------------------------------------------------------
You will see after Ctrl+O and “Enter” at the bottom confirmation that the file was saved by
mentioning “Wrote xx lines” :
If it shows “access denied” you probably forgot to activate the administrator rights earlier by
sudo su
----------------------------------------------------------------------------------------------------------
To copy SD-card configuration to EMMc: only for BBB rev. C with 4GB EMMc !!
reboot
If you made a mistake by trying to flash to a 2GB EMMc when EMMc is full all 4 led’s will start
blinking on/off simultaneously.
If you are not familiar with Linux it will be very hard to edit /boot/uEnv.txt now and
put “#” again at the beginning of the EMMc flasher to de-activate this.
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh
I guess you better start all over again and forget the part about flashing to EMMc or buy a
BeagleBone rev. C with 4GB EMMc.
==========================================================
apt-get update
This will update the library index of all the Linux software packages which is available on the
internet
apt-get upgrade
This will upgrade all software to the newest version as the “apt-get update” above also
provides version information so Linux knows what needs to be upgraded.
This process can take quite some time and it will ask you if you want to continue so press “y”
when asked.
You can also confirm “Yes” automatically by typing apt-get upgrade -y so it will do the upgrade
without questions. This also works when installing programs with command
“apt-get install name-of-program -y”
----------------------------------------------------------------------------------------------------------
Do you remember the old but very useful DOS program “Norton Commander” ??
Linux has the same called “Midnight Commander” or mc in Linux.
If you know how to use it then it is a very easy tool otherwise keep using the typed commands
in red text.
How to use mc is found here: https://midnight-commander.org/wiki/doc
To install:
Instead of using “nano” you can now find the file in Midnight Commander and open (edit) it
there by pressing “F4”.
F3 is a safe way of viewing the file first without risk of changing anything.
F3 also closes the file again.
----------------------------------------------------------------------------------------------------------
==========================================================
Chapter 5 : getting your music over LAN from a NAS or other computer
cifs-utils is needed for file access over the network when music files are on a NAS or external
computer:
mkdir /mnt/music
Linux needs external drives to be linked to their internal file system by the command “mount”
for which the folder /mnt is mostly used.
Linux works with NFS to access external folders so you need to activate this on your NAS or
external computer.
To link the external drive automatically during boot we need to set this in the file fstab:
nano /etc/fstab
add line: //IPaddressNAS/Folder /mnt/music cifs
username=???,password=???,uid=mpd,iocharset=utf8 0 0
(make sure this is in one line but my text editor breaks it in 2 lines when writing this
instruction)
The username and password is only necessary when you have set so on your shared drives or
folders on your NAS.
mount –a
Now you should see your music folders identical as on your NAS: (here in mc)
reboot
Check again folder /mnt/music/ if the Music files/folders are still present.
I had some issues keeping “mount -a” stick after reboot so I always check.
Some NAS or OS on external file servers need special options for the mount in /ect/fstab …
here you are on your own but there is enough “fstab” mount information on the internet
related to your NAS or file server.
==========================================================
(this is when using an USB DAC only … for I2S output follow with the Botic section)
Device hw:1,0 is the DAC connected to the USB port of the BeagleBone.
reboot
Find a suitable MPD app for your Android or IOS device (or Windows client if controlled via a
PC) and set the required settings and you should be able to play your music.
Almost every App loads the album covers from the original music folders.
For this the http protocol is used so make sure http is also enabled on the shared music
drive/folders.
==========================================================
To download Botic:
wget http://repo.ieero.com/botic/pool/main/l/linux-upstream/linux-image-4.8.13-botic7-
rc3_1_armhf.deb
You can check here if there are any newer Botic versions to download:
http://repo.ieero.com/botic/pool/main/l/linux-upstream/
dpkg -i linux-image-4.8.13-botic7-rc3_1_armhf.deb
To activate Botic:
nano /boot/uEnv.txt
Remove “#” before dtb= and complete line like this: dtb=am335x-boneblack-botic.dtb
And add # at the start of this line: “enable_uboot_cape_universal=1” further down this file.
Device hw:0,0 is for using I2S out from 40 pin header instead of sending audio over USB
reboot
Make sure you continue at the same line and add each additional parameter with a space
between the parameters if you add more than one parameter.
The Botic settings as described at the end of chapter 7 are related to these I/O pins.
Make sure you first check the current Botic settings with the command:
grep . /sys/module/snd_soc_botic/parameters/*
Only if these settings do not match with your connections or signals you need to enter the
correct settings in /boot/uEnv.txt at cmdline=coherent….. as described in chapter 7.
Here you see the input and output pins on the BBB P9 header:
The green settings are the default settings by Botic:
snd_soc_botic.ext_masterclk=?
0 no external clocks, just onboard for 48k freq
1 external clock for 44k1 + onboard for 48k
2 external clock for 48k only
3 external clocks for 44k1 and 48k (default)
+4 invert polarity of clock selection switch GPIO0_15
9 external clock for 44k1 only
snd_soc_botic.dsd_format_switch=?
0 DSD switch is disabled
1 DSD switch is enabled (default)
+2 invert polarity of format selection switch GPIO0_14
snd_soc_botic.serconfig=????
MMMM 8ch I2S output or 4ch DSD output (default)
I--- 2ch I2S output on mcasp0_axr0 pin
-I-- 2ch I2S output on mcasp0_axr1 pin
--I- 2ch I2S output on mcasp0_axr2 pin
---I 2ch I2S output on mcasp0_axr3 pin
DD-- 2ch DSD output on mcasp0_axr0 and mcasp0_axr1 pins
MM-- 4ch I2S output or 2ch DSD output on mcasp0_axr0 and mcasp0_axr1 pins
--MM 4ch I2S output or 2ch DSD output on mcasp0_axr2 and mcasp0_axr3 pins
S--- 2ch SPDIF output on mcasp0_axr0 pin
-S-- 2ch SPDIF output on mcasp0_axr1 pi
snd_soc_davinci_mcasp.mute_pin=?
(not set by the system, add this parameter when needed)
-1 mute pin functionality is disabled
or these additive numbers:
+1 signal mute on pin 0
+2 signal mute on pin 1
+4 signal mute on pin 2
+8 signal mute on pin 3
+ 16777216 invert the mute signal
snd_soc_botic.dai_format=?????
+1 I2S mode
+2 Right Justified mode (LSB)
+3 Left Justified mode (MSB)
+4 L data MSB after FRM LRC
+5 L data MSB during FRM LRC
+0 NB_NF: normal BCLK & LRCK
+512 NB_IF: normal BCLK, inverted LRCK
+768 IB_NF: inverted BCLK, normal LRCK
+1024 IB_IF: inverted BCLK & LRCK
+4096 CBM_CFM: DAC is BCLK & LRCK master
+8192 CBS_CFM: DAC is BCLK slave, LRCK master
+12288 CBM_CFS: DAC is BCLK master, LRCK slave
+16384 CBS_CFS: DAC is BCLK & LRCK slave
snd_soc_botic.clk_44k1=????????
Default value: 22579200
snd_soc_botic.clk_48k=????????
Default value: 24576000
snd_soc_botic.blr_ratio=??
For I2S mode default value is 64.
Other valid values are 32 and 48 (and maybe others).
==========================================================
----------------------------------------------------------------------------------------------------------
I have a personal issue with my Synology NAS (PC hardware with Xpenology) and can’t get
http support operational for my shared Music folder so I can not load cover art in my iOS app.
But I can set /mnt/music for http and point the app to the BBB IP instead of NAS IP:
nano /etc/webfs.conf
Change the following: # document root
web_root=”/mnt/music”
# port to listen on
web_port=”8080”
General note:
As I am not a Linux specialist (merely put all fragments of information together from the
internet) I hope this manual is useful for many novice Linux / Botic users.
Sometimes it can be helpful having an extra SD-card and installing an older Linux version.
Like mentioned I had some issues with “mount -a” not sticking after reboot what apparently
was not the case with Debian 8 … why ?? I have no clue but feel free to experiment if you run
into issues.
Having 2 cards, one with Debian 8 and one with Debian 9 or one without and one with Botic
makes you very flexible for testing until everything works perfect ͦ