Temporary Setup Things...

This is a rebuild of the old GJukebox, but with YII2 on a Beaglebone Black
Post Reply
kylesands
Site Admin
Posts: 6
Joined: Fri Dec 08, 2023 6:00 pm

Temporary Setup Things...

Post by kylesands »

Audio.....

Code: Select all

/root/.asoundrc

Code: Select all

pcm.!default {
 type plug
 slave {
 pcm "hw:1,0"
 }
}
ctl!default {
 type hw
 card 1
}
Force USB sound card to NOT take first (0) device

Add this to /lib/modprobe.d/aliases.conf

Code: Select all

options snd-usb-audio index=-2
PHP.ini
enable php short codes

Code: Select all

short_open_tag = On
create a db user

Code: Select all

CREATE USER [user]@localhost IDENTIFIED by '[password]';
GRANT INSERT, UPDATE, DELETE, SELECT on music.* TO [user]@localhost WITH GRANT OPTION;
Make mount points

Code: Select all

root@beaglebone:/home# mkdir /mnt/airport
root@beaglebone:/home# mkdir /mnt/music_player_backups
Make sym link

Code: Select all

ln -s /mnt/airport /mp3_remote
Mount sdCard
/etc/fstab

Code: Select all

/dev/mmcblk0 /media/Data/sdCard auto rw,user,auto,nofail,exec 0 0
Script to mount music drive
/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
Make executable

Code: Select all

chmod 755 /usr/local/jukebox/*
Add /etc/rc.local
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
Set rc.local to auto start

Code: Select all

chmod +x /etc/rc.local
systemctl daemon-reload
systemctl start rc-local
systemctl status rc-local
Install

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 MPEG-MP3Info 0.61 Perl module
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
Create volume xinetd

/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
}
Add service to /etc/services
at the bottom

Code: Select all

# Jukebox
volume 1339/tcp
Open port 1339
This may not be needed

Code: Select all

ufw allow 1339
Added cron tasks

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;'
Post Reply