Code: Select all
/root/.asoundrc
Code: Select all
pcm.!default {
type plug
slave {
pcm "hw:1,0"
}
}
ctl!default {
type hw
card 1
}
Add this to /lib/modprobe.d/aliases.conf
Code: Select all
options snd-usb-audio index=-2
enable php short codes
Code: Select all
short_open_tag = On
Code: Select all
CREATE USER [user]@localhost IDENTIFIED by '[password]';
GRANT INSERT, UPDATE, DELETE, SELECT on music.* TO [user]@localhost WITH GRANT OPTION;
Code: Select all
root@beaglebone:/home# mkdir /mnt/airport
root@beaglebone:/home# mkdir /mnt/music_player_backups
Code: Select all
ln -s /mnt/airport /mp3_remote
/etc/fstab
Code: Select all
/dev/mmcblk0 /media/Data/sdCard auto rw,user,auto,nofail,exec 0 0
/usr/local/jukebox/mount_music.sh
Code: Select all
#!/bin/sh
mount -t cifs //[address]/T9-Airport/storage/mp3 /mnt/airport -o username=any,password=[password],sec=ntlm,vers=1.0 --verbose
mount -t cifs //[address]/T9-Airport/storage/music_player_backups /mnt/music_player_backups -o username=any,password=[password],sec=ntlm,vers=1.0 --verbose
Code: Select all
chmod 755 /usr/local/jukebox/*
to auto mount music drive
Code: Select all
#!/bin/sh
#modprobe -r mt7601u
#sleep 1
#modprobe mt7601u
#sleep 1
#rm /run/wpa_supplicant/wlan0
#sleep 1
#ifup wlan0
#sleep 1
/usr/local/jukebox/mount_music.sh
modprobe snd-aloop
darkice -c /usr/share/doc/darkice/examples/darkice.cfg &
exit 0
Code: Select all
chmod +x /etc/rc.local
systemctl daemon-reload
systemctl start rc-local
systemctl status rc-local
Code: Select all
apt-get install xinetd
apt-get install libmp3-info-perl
apt-get install libdbd-mysql-perl
apt-get install mpg123
apt install alsa-utils
Download IO 1.55 Perl module
https://cpan.metacpan.org/authors/id/C/ ... .61.tar.gz
https://cpan.metacpan.org/authors/id/T/ ... .55.tar.gz
Build and install them...
Code: Select all
perl Makefile.PL
make test
make install
/etc/xinetd.d/volume
Code: Select all
# default: on
# description: Volume is a part of the GlobeCom Jukebox
# which makes it possible to adjust the volume
# on a computer from PHP-pages.
service volume
{
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/local/jukebox/setvol
port = 1339
disable = no
}
at the bottom
Code: Select all
# Jukebox
volume 1339/tcp
This may not be needed
Code: Select all
ufw allow 1339
Code: Select all
# Clearing mp3's over 6 hours old every 2 hours
0 */2 * * * /usr/local/jukebox/clearlocalfiles.sh
0 2 1,8,15,22 * * /usr/local/jukebox/make_music_backups.sh
0 4 1,8,15,22 * * /usr/local/jukebox/prune_music_backups.sh
# restart every night. Temporary fix
0 4 * * * /sbin/shutdown -r +5
Delay rc.local until network is really available
Add the following to the [Service] section of /lib/systemd/system/rc-local.service
Code: Select all
ExecStartPre=/bin/sh -c 'until ping -c1 192.168.1.3; do sleep 1; done;'