I wasn't kidding when I said in another forum post to use the P3 as a standalone DJ Unit to play MP3. However, most of the time you would just want to plug in a USB drive and use that. You actually can!
This hack works in two stages: one to mount the USB when plugging it in, and another to trick the background indexer into adding the contents of the disk into the database. For this hack, you'll need to log in as root.
Phase one:
By default, the automount tool inside the Push mounts and USB key to /run/media on the wrong user- and group id. But that doesn't do us any good. We need it somewhere in our user library.
So let's set it up in /etc/fstab.
Add a new line in
Code: Select all
LABEL=MP3S /data/Music/Ableton/User\040Library/Music vfat nofail,uid=ableton,gid=users 0 0
This needs some explaining
LABEL=MP3S - I've got a USB drive and formatted it, I also labeled it 'MP3S'.
Alternatively, you can do '/dev/sda1', but that restricts some options if you want to add multiple USB drives.
/data/Music/Ableton/User\040Library/Music - The location where the drive is mounted to. Create that folder (with 'mkdir') first and change it to your liking. Replace spaces in the path with \040
vfat - depends on what filesystem you put on the drive. I formatted it in Windows, but other OS might format it in a different filesystem.
nofail,uid=ableton,gid=users nofail: if the drive isn't there during boot, it will not hang during mounting at the start of the P3
(don't try to leave this out, booting will take a long time - you've been warned!!!). uid needs to be ableton, and gid needs to be users, else the Ableton process running on the push isn't able to read from it.
Now plug in the USB key and check if it gets mounted in your desired location.
If it does, move the the next step. If it doesn't, execute the command 'mount -a' or check 'mount -l' and check for any error messages. Also, check if the drive isn't still being mounted to /run/media. By default, it should only have two entries:
Code: Select all
root@push:~# ls -l /run/media/
total 4
drwxr-xr-x 2 root root 40 Oct 25 12:14 nvme0n1p2
drwxr-xr-x 19 root root 4096 Sep 28 07:10 nvme0n1p4
Phase two
We need to 'trick' the Ableton indexer when the filesystem has changed. Now, I've been searching for it for some time (so perhaps Ableton or someone else can tell me how to do it correctly). But the only way I've been able to 'trigger' it, was to create a new file in the User Library and 'touch' the folder holding the mount.
The downside is you need to do this every time you plug in or remove the USB drive. But I've found a way! Every time you plug in or remove a drive, it triggers the 'mount.sh' script:
Simply add the following lines in
Code: Select all
touch /data/Music/Ableton/User\ Library/temp.mp3
touch /data/Music/Ableton/User\ Library/Music
rm /data/Music/Ableton/User\ Library/temp.mp3
Now every time you plug in the drive, it will ensure the indexing service triggers and updates the database with all the files on your USB key. Also removing the drive will trigger the update. I'm getting a good mount tonight for my camera, so I hope I can make some video clips showing this in action.
By the way, this method isn't limited. You can use the drive like any other folder in the P3. So from within Ableton you can transfer to and from this drive, make backups, etc.