Monday, 4 February 2013

An alternative lower layer

At the weekend, I went to that there London. A friend had his house all set up with Skifta a DLNA compliant integration thingy. Some initial thoughts on that platform made for interesting crossover with what SCANPI is already doing for me.

  1. Playing Music is all good and works with his DLNA compliant Blu-ray player.
  2. Having to scroll through all his various attached devices took ages - perhaps a single consolidated view of all music across all devices would make sense.
  3. Selecting what to play from multiple devices (Android tablet + phone) = last one wins.
  4. Queueing - very frustrating that there is no way to locally (i.e. on the current browsing device) queue up a number of items to play.
  5. Feedback - the currently playing track is shown, but nothing about how long is left / has played / etc is available on the tablet Skifta service. The phone's internal DLNA media controller did have this information.
  6. We couldn't find a way to get the MP3 or M3U versions of export from SCANPI to push to the currently selected Blu-ray player

Short summary: I need to read more about http://www.dlna.org/ and perhaps copy and paste some stuff to make a SCANPI installed PI a compliant device? (BOTH a device which knows about content AND a device to which content can be sent/played).

Friday, 25 January 2013

Doing Presentations, Humans

Following our acceptance to talk at OGN30, we have begun work on some slides. It don't half focus the mind into making things make sense to the outside world. As a sneak preview - the *key* slide *might* look a bit like this:

You may (should) know about this already, but it's a thing that we only saw a month or so ago and have stuck some details in place on scanpi. As you do; humans.txt for scanpi.

Comments as always welcome via the usual channels.

Monday, 14 January 2013

A time to talk (OGN30)

SCANPI has confirmed an opportunity to talk to you all at Oxford Geek Night number 30 (http://oxford.geeknights.net/). It's upstairs at The Jericho Tavern on the 13th March (the date will be updated on the OGN website within the next day or so).

We're in the microslots and are now discussing what will fit into the 5 minutes allocated. If there is something specific you want to hear about, shout (or whisper) into the comments.

Friday, 11 January 2013

SCANPI like NEWS

A couple of things in the last couple of weeks or so ...

Barcode inventor (Norman Woodland) dies. Should I rename SCANPI in honour [or blatant questionable marketing manoeuvre?] to NoWo, NorWoo, NorJos, NoJo, or NoJoWo? Votes as you feel like it to the comments.

Amazon gives digital version free. If you bought the CD from Amazon (They are also somehow remembering the past 10 years worth of your purchases) - you get access to the MP3 version from their cloud. Catch no 1 = 250 songs for free in their cloud? Catch no 2 = If you were gifted the CD then the gifter gets the MP3 copy? Catch no 3 = If it didn't come via Amazon at all, then obviously you don't get those ones. This *could* however form the basis of a 'scan the barcode to get the MP3' - a reasonable extension to where we're going with SCANPI? Perhaps. Once more, votes and comments in the box below as you see fit.

Friday, 28 December 2012

Installing SCANPI SHELLPLAYER

The wee app (SCANPI SHELLPLAYER) is written as a set of 9 shell scripts. It's kind of explained at https://bitbucket.org/parbuthnott/scanpi-shellplayer/overview.

Once you've gone to the bitbucket, downloaded it and sent it off to your PI, it's all ready for linking action.

We put the whole 9 files and in one place, with the 'queue' and 'played' directories created next to the shell files. All are in a loopback mounted drive on the big disc under /mnt/scanpi.

== AFTER INITIAL INSTALLATION AND INDEX RUN ==
(the files and directories in place and tested...)
pi@raspberrypi /mnt/scanpi/shellplayer $ ls -l
-rwxrwxr-x 1 pi       www-pub   1827 Nov 13 10:58 album.sh
-rw-r--r-- 1 pi       pi      705587 Dec 25 14:03 allmusicrandom.txt
-rwxrwxr-x 1 www-data www-pub 707812 Dec 21 01:31 allmusic.txt
-rwxrwxr-x 1 pi       www-pub   1297 Nov 13 10:58 band.sh
-rwxrwxr-x 1 pi       www-pub   1481 Nov 13 10:59 exit.sh
-rwxrwxr-x 1 pi       www-pub    284 Dec 28 16:51 go.sh
drwxrwxr-x 2 www-data www-pub  33792 Dec 28 16:57 played
-rwxrwxr-x 1 pi       www-pub   3359 Nov 18 14:39 play.sh
drwxrwxr-x 2 pi       www-pub   5120 Dec 28 16:57 queue
-rwxrwxr-x 1 pi       www-pub   1124 Nov 18 13:24 queue.sh
-rwxrwxr-x 1 pi       www-pub   1066 Nov 18 22:28 reindex.sh
-rwxrwxr-x 1 pi       www-pub   1243 Nov 25 12:12 skip.sh
-rwxrwxr-x 1 pi       www-pub   2286 Nov 13 10:59 track.sh

== TIE-ING THE SHELLPLAYER BITS TOGETHER ==
(make a pile of shortcuts to the shellplayer for the pi user.)
cd
sudo ln -s /mnt/scanpi/ scanpi
sudo ln -s scanpi/shellplayer/album.sh a
sudo ln -s scanpi/shellplayer/band.sh b
sudo ln -s scanpi/shellplayer/exit.sh e
sudo ln -s scanpi/shellplayer/go.sh g
sudo ln -s scanpi/shellplayer/play.sh p
sudo ln -s scanpi/shellplayer/queue.sh q
sudo ln -s scanpi/shellplayer/reindex.sh r
sudo ln -s scanpi/shellplayer/skip.sh s
sudo ln -s scanpi/shellplayer/track.sh t

With the above in place, you should be able to ssh to your PI and type './g' and press 'enter' to start the playing function. Typing './e' and pressing 'enter' will exit / stop the playing function. Typing './s' and pressing 'enter' will skip the current playing track.

If there isn't anything in the queue directory, the shellplayer takes the next line from the allmusicrandom.txt file and plays and removes that. The allmusicrandom.txt file is a randomized list of all the available '.mp3' files in the relevant music directory and is created and updated with the 'reindex.sh' or './r' function.

Queueing something up can be done at an artist / band ('./b'), album ('./a') or track ('./t') level. If you understand the syntax, a specific track can be queued up using the queue function ('./q') directly.

Have fun and feel free to comment on all of this. We've got a browser based queue and playing function all ready in the wings and will post about that soon.

Monday, 17 December 2012

Instructions for SCANPI setup

TODO number 2. Taken from the bitbucket see this...
== INSTALLING BITS ==
(get an updated set of files onto the PI)
* sudo apt-get update
* sudo apt-get install vim
* sudo apt-get install apache2
* sudo apt-get install php5
* sudo apt-get install mpg123

== SETTING UP USERS ==
(ensures that apache can read, write, etc)
* sudo groupadd www-pub
* sudo usermod -a -G www-pub pi
* sudo usermod -a -G www-pub www-data

== SET UP AUDIO OUT ==
(points the audio out the headphone socket instead of the HDMI)
* sudo amixer cset numid=3 1

== MOUNTING USB HDD ==
(first make places to mount and set permissions)
sudo mkdir -p /mnt/2tb_USB_hard_disc
sudo mkdir -p /mnt/scanpi
sudo chmod 775 /mnt
sudo chmod 775 /mnt/2tb_USB_hard_disc
sudo chmod 775 /mnt/scanpi

(mount the main disc and test...)
sudo mount -o uid=pi,gid=www-pub /dev/sda1 /mnt/2tb_USB_hard_disc
ls /mnt/2tb_USB_hard_disc/

(create a loopback disc for mounting a second partition)
sudo losetup /dev/loop0 /mnt/2tb_USB_hard_disc/virtualfs

(mount the loopback disc and test...)
sudo mount -t ext3 /dev/loop0 /mnt/scanpi/
ls /mnt/scanpi/

if that all works, then you can do it 'properly'.

== MAKING THE MOUNT STICKY AFTER REBOOT ==
(edit the HDD details for main disc and loopback)
* sudo vim /etc/fstab

 #!shell
 proc            /proc           proc    defaults          0       0
 /dev/mmcblk0p1  /boot           vfat    defaults          0       2
 /dev/mmcblk0p2  /               ext4    defaults,noatime  0       1
 # a swapfile is not a swap partition, so no using swapon|off from here on,
 use  dphys-swapfile swap[on|off]  for that

* AFTER EDITING

 #!shell
 proc            /proc           proc    defaults          0       0
 /dev/mmcblk0p1  /boot           vfat    defaults          0       2
 /dev/mmcblk0p2  /               ext4    defaults,noatime  0       1

 # EXTERNAL DISC MOUNTS
 UUID=4830-1CF9 /mnt/2tb_USB_hard_disc vfat uid=pi,gid=www-pub 0 0
 /mnt/2tb_USB_hard_disc/virtualfs /mnt/scanpi ext3 loop,auto 0 0

 # a swapfile is not a swap partition, so no using swapon|off from here on,
 use  dphys-swapfile swap[on|off]  for that

(test the remounting)
* sudo mount -a

== SETTING STATIC IP ==
(making comms easier = set PI as 192.168.0.227)
* more /etc/network/interfaces

 #!shell
 auto lo

 iface lo inet loopback
 iface eth0 inet dhcp

 allow-hotplug wlan0
 iface wlan0 inet manual
 wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
 iface default inet dhcp

== AFTER EDITING ==
* more /etc/network/interfaces

 #!shell
 auto lo

 iface lo inet loopback
 iface eth0 inet static
 address 192.168.0.227
 netmask 255.255.255.0
 gateway 192.168.0.1

 allow-hotplug wlan0
 iface wlan0 inet manual
 wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
 iface default inet dhcp

* sudo /etc/init.d/networking restart (might work for you... for me, it
 showed warning... so I did a reboot)
* reboot = ip correct.

After all that, you should have PI with all the bits running, installed, etc. You should be able to get the Apache It Works page at http://192.168.0.227. If you can't, add comment and we'll look into it.

Thursday, 13 December 2012

How to get here: part 1

You want to get here?
An UL for you...
  • Get yourself a Raspberry Pi (start here:http://www.raspberrypi.org/faqs)
  • Purchase a big disc (something from here probably)
  • Do some background reading: see the other UL below...
  • Make them talk to one another (that's this post here:TODO)
  • Setup PI as a server etc (and that's written up here)
  • Burn in some way all music to the big disc
  • Install the wee app(s) (here)
  • SCANPIMOB in use (a video? or some such?:TODO)

In progress at first installation...