shhammer5634
Posts: 57
Joined: Mon Dec 04, 2017 10:45 am
Location: Iowa, USA

Re: fruitbox Mp3 files

Sun May 13, 2018 11:10 pm

shhammer5634 wrote:
Sun May 13, 2018 9:10 pm
ljs12377 wrote:
Sun May 13, 2018 9:02 pm
shhammer5634 wrote:
Sun May 13, 2018 2:07 pm


Good morning (at least in my part of the world),

Working with something new can be quite frustrating. I don't know what your skill level is with Linux, which is the OS that is running your Raspberry PI. So please forgive me if I cover something you already know.

If you're putting the music in a folder on the SD card before you actually are using the SD card to run the PI, then that folder is most likely inaccessible from the OS. To get the music to reside there, you would have to copy it from another source such as a USB flash drive while actually running the PI. Just like moving stuff from machine to machine in Windows. Doing the copy of the music from a flash drive from the PI desktop is relatively simple, but running Fruitbox from the desktop is not a good idea and in most cases does not work correctly. So you can use the desktop to do maintenance type stuff, but not for running Fruitbox.

If you are doing the copy from within the PI, then the Music directory is most likely /home/pi/Music. Regardless of how you get your music files here, you should confirm that this is where they are and that you can actually see them there.

In the fruitbox.cfg file, you would point to your music path. If you have your music in the Music folder, and you can see it there when you are running the PI, then the path is /home/pi/Music. It is important to note that unlike Windows, Linux folder paths are case sensitive. So /home/pi/Music would not be the same as /home/pi/music.

Most of your examples that you gave showed that you were trying to use relative paths to your music. While they can be convenient, they can also come back to bite you. I prefer to use the full path to my music files. That way there is no confusion.

It is possible to play your music directly from a flash drive without having to copy it around. I do this to allow for changing up my available music selection periodically. That requires the flash drive be mounted as a drive. Flash drives do not auto mount when running the PI in console mode. So you would need to, as part of your Fruitbox startup procedure, have a way of verifying that the flash drive is inserted and then mount it before actually starting Fruitbox. I do this in a bash script. If the flash drive is not inserted, fruitbox won't start and the script complains. I also use switches (or flags) in the fruitbox startup to tell fruitbox where my music and database files are. That way they can all live happily on the flash drive and I don't have to mess with editing the skin file when I want to make some sort of change. This is just an overview of my method and would require further explanation if you're interested in trying it. I'd also be happy to share the startup script.

One other thing I would suggest if you haven't done so already is to make a copy of the Fruitbox user manual. It's actually a part of the software. I sent it to a file and then actually printed it on hard copy. On the console or in a command window (depending on how you're running your PI) change directory to where have Fruitbox living on your PI and type:

Code: Select all

./fruitbox --user-guide > userguide.txt
It will look like nothing happened, and you'll end back at a command prompt. But the entire user guide will now be in the userguide.txt file. You can view it or print it at your leisure.

I hope some of this helped.

Cheers,
Steve
Hi Steve

thanks for your help on this, i think i might slowly be getting there. I’ve managed to locate my flash Usb drive and found the mp3 files on it ../media/usb1 (i changed all this via this you tube video https://youtu.be/Q0W6ggl5yjY ) but when i run the programme it still says that it cannot find mp3 files although i know they are there when i run the command ls /media/usb1. I have been changing the config file by using nano skins/WallJuke/fruitbox.cfg

What would be the full path to /media/usb1

I’m interested in trying the switches and flags if your ok with that. (I’m slowly getting this!)

Thanks
Leigh
Hi Leigh,

You are making progress. That's great news! Before I can answer your question though, I need to know if you are running Fruitbox from inside the PI desktop or are starting up the PI in console mode.

Cheers,
Steve

Edit: On the assumption that you're running PI in console mode, I'll type something up shortly. I'm cooking supper right now. Food before computing in my house. :D
OK, supper is over and I'm sipping my Diet Coke so I have time to type. Again, if I cover something you already know, I'm sorry. Just trying to be thorough.

A little Linux 101 to begin: Linux does not use drive letters. Everything hangs off the root directory ('/' without anything after it). A single hard drive can be a single volume, or can be broken up into several volumes depending on how it's configured. A volume hangs off the root directory at a mount point. A mount point is a folder when viewed in a directory listing. If the associated volume isn't mounted, the folder is empty. If a volume is mounted, then there will be files and folders listed in the mount point folder.

I needed to power up my PI for this bit of explanation and what I see may be different that what you see so bear with me. When I insert my usb stick and have started PI in graphic desktop mode, the flash drive mounts under the /media/pi folder with the volume name of the flash drive. In my case, my flash drive is named MUSIC (all caps) so the full mount point becomes /media/pi/MUSIC. When I start PI in console mode, even if the flash drive is present, it doesn't automatically mount. So Fruitbox can't find it.

Most flash drives are seen by Linux as a hard drive. So when you have the flash drive connected to PI, regardless of whether you are running in console or graphic mode, Linux creates a device node for it in the /dev folder. In this case, drive device nodes begin with the prefix sd, have one letter following, and a number to indicate the partition. In my case, my flash drive only has one partition on it. So in the /dev folder when I have the flash drive plugged in, I have an sda entry which is the flash drive itself and an sda1 entry which is the first (and in this case the only) partition (or volume) on the flash drive. That makes the path to the partition containing my music /dev/sda1. That path will be important later.

With your flash drive plugged in and your PI running in console mode so that you have a command-line prompt type:

Code: Select all

ls -l /dev/sd*
This will return at least two entries. /dev/sdX and /dev/sdX1 where X is the letter we are looking for.

Now at the command-line prompt type:

Code: Select all

ls -l /media/usb1
If you get "total 0" the mount point is there and ready to use. Skip this next bit.

If you get any other response than "total 0" then that mount point doesn't exist. You can create that mount point by typing:

Code: Select all

sudo mkdir /media/usb1
Once you know your mount point and the device name of your music partition we can mount it so it can be seen in Linux. Regular flash drives require special handling in Linux to be mounted so they can be used. I'll show you what my mount command looks like and hopefully from what we looked at previously you'll be able to figure out what to substitute to make it work for you. The basic syntax of mount is:

Code: Select all

mount [flags] [device] [mount point]
Mount needs to be run as root. You do that by prepending "sudo " to the front of the command string. So my full mount command is:

Code: Select all

sudo mount -t vfat -o umask=000 /dev/sda1 /media/pi/MUSIC
Explanation: Factory formatted flash drives have a fat32 format (It's a Windows/DOS thing). Linux expects to see something else. So we have to tell Linux to expect fat32 instead. -t vfat does this. One other thing in order to be able to write the database to the flash drive, we need permission to do so. By default we don't have. -o umask=000 gives us permission (actually it gives us more than we need, but it works).

Once I do that, then I can type:

Code: Select all

cd /media/pi/MUSIC
ls -l
And see all my MP3 files. If you get this far, then you're ready to start Fruitbox.

Change directory to where you have Fruitbox installed. At the command-line type:

Code: Select all

./fruitbox --cfg [path-to-your-fruitbox.cfg-file] --database [mount-point-of-your-flash-drive] --music-path [mount-point-of-your-flash-drive] 
Mine looks like this:

Code: Select all

./fruitbox --cfg /home/pi/Fruitbox/skins/Seeburg3W1/fruitbox.cfg --database /media/pi/MUSIC --music-path /media/pi/MUSIC
Explanation: My Fruitbox is installed in a folder under my home folder: /home/pi/Fruitbox. The skin I'm using is a custom one I designed for my project that looks like the flip pages of a Seeburg wall box from the 1950's. My mount point for my music is /media/pi/Music. Regardless of which of my flash drives I plug in, this is always the mount point I use. Using these command-line switches, you can tell Fruitbox to look at your mount point for the music and database and ignore the entries for those things in your fruitbox.cfg. If it doesn't find a database, it will make one. If you change the music you have on the flash drive, you need to erase the fruitbox.db file from the flash drive. This will force Fruitbox to re-read the list of music files and re-create the database.

Please try what I have outlined above. If it works for you and you want my startup script, let me know and I'll post it here for you. If I've created more questions that I've answered, I'm sorry. Ask away and I'll do my best.

Steve

Edit:Posting the script anyway. Let me know what happens.

Code: Select all

# . /bin/bash

# Script for starting Fruitbox.
# Mounts the flash drive or hard drive at the specified mount point and
# then starts Fruitbox pointing to the mount point for both the music and
# database.  Output is run off to logfile.txt for later review.

# Check to see if there's an external hard drive attached
if [ ! -e "/dev/sda1" ];
    then
      echo -e "No Music drive found.\nPlease connect a USB drive with the music to play.\nExiting"
    exit
fi

# Mount the external hard drive
sudo mount -t vfat -o umask=000 /dev/sda1 /media/pi/MUSIC

# Start up fruitbox
cd Fruitbox
./fruitbox --cfg /home/pi/Fruitbox/skins/Seeburg3W1/fruitbox.cfg --database /media/pi/MUSIC/fruitbox.db --music-path /media/pi/MUSIC 2>&1 > logfile.txt

# Clean up after running fruitbox
sudo umount /dev/sda1
cd /home/pi
#clear
exit

ljs12377
Posts: 12
Joined: Tue Jan 07, 2014 10:22 pm

Re: fruitbox Mp3 files

Mon May 14, 2018 10:17 am

shhammer5634 wrote:
Sun May 13, 2018 11:10 pm
shhammer5634 wrote:
Sun May 13, 2018 9:10 pm
ljs12377 wrote:
Sun May 13, 2018 9:02 pm


Hi Steve

thanks for your help on this, i think i might slowly be getting there. I’ve managed to locate my flash Usb drive and found the mp3 files on it ../media/usb1 (i changed all this via this you tube video https://youtu.be/Q0W6ggl5yjY ) but when i run the programme it still says that it cannot find mp3 files although i know they are there when i run the command ls /media/usb1. I have been changing the config file by using nano skins/WallJuke/fruitbox.cfg

What would be the full path to /media/usb1

I’m interested in trying the switches and flags if your ok with that. (I’m slowly getting this!)

Thanks
Leigh
Hi Leigh,

You are making progress. That's great news! Before I can answer your question though, I need to know if you are running Fruitbox from inside the PI desktop or are starting up the PI in console mode.

Cheers,
Steve

Edit: On the assumption that you're running PI in console mode, I'll type something up shortly. I'm cooking supper right now. Food before computing in my house. :D
OK, supper is over and I'm sipping my Diet Coke so I have time to type. Again, if I cover something you already know, I'm sorry. Just trying to be thorough.

A little Linux 101 to begin: Linux does not use drive letters. Everything hangs off the root directory ('/' without anything after it). A single hard drive can be a single volume, or can be broken up into several volumes depending on how it's configured. A volume hangs off the root directory at a mount point. A mount point is a folder when viewed in a directory listing. If the associated volume isn't mounted, the folder is empty. If a volume is mounted, then there will be files and folders listed in the mount point folder.

I needed to power up my PI for this bit of explanation and what I see may be different that what you see so bear with me. When I insert my usb stick and have started PI in graphic desktop mode, the flash drive mounts under the /media/pi folder with the volume name of the flash drive. In my case, my flash drive is named MUSIC (all caps) so the full mount point becomes /media/pi/MUSIC. When I start PI in console mode, even if the flash drive is present, it doesn't automatically mount. So Fruitbox can't find it.

Most flash drives are seen by Linux as a hard drive. So when you have the flash drive connected to PI, regardless of whether you are running in console or graphic mode, Linux creates a device node for it in the /dev folder. In this case, drive device nodes begin with the prefix sd, have one letter following, and a number to indicate the partition. In my case, my flash drive only has one partition on it. So in the /dev folder when I have the flash drive plugged in, I have an sda entry which is the flash drive itself and an sda1 entry which is the first (and in this case the only) partition (or volume) on the flash drive. That makes the path to the partition containing my music /dev/sda1. That path will be important later.

With your flash drive plugged in and your PI running in console mode so that you have a command-line prompt type:

Code: Select all

ls -l /dev/sd*
This will return at least two entries. /dev/sdX and /dev/sdX1 where X is the letter we are looking for.

Now at the command-line prompt type:

Code: Select all

ls -l /media/usb1
If you get "total 0" the mount point is there and ready to use. Skip this next bit.

If you get any other response than "total 0" then that mount point doesn't exist. You can create that mount point by typing:

Code: Select all

sudo mkdir /media/usb1
Once you know your mount point and the device name of your music partition we can mount it so it can be seen in Linux. Regular flash drives require special handling in Linux to be mounted so they can be used. I'll show you what my mount command looks like and hopefully from what we looked at previously you'll be able to figure out what to substitute to make it work for you. The basic syntax of mount is:

Code: Select all

mount [flags] [device] [mount point]
Mount needs to be run as root. You do that by prepending "sudo " to the front of the command string. So my full mount command is:

Code: Select all

sudo mount -t vfat -o umask=000 /dev/sda1 /media/pi/MUSIC
Explanation: Factory formatted flash drives have a fat32 format (It's a Windows/DOS thing). Linux expects to see something else. So we have to tell Linux to expect fat32 instead. -t vfat does this. One other thing in order to be able to write the database to the flash drive, we need permission to do so. By default we don't have. -o umask=000 gives us permission (actually it gives us more than we need, but it works).

Once I do that, then I can type:

Code: Select all

cd /media/pi/MUSIC
ls -l
And see all my MP3 files. If you get this far, then you're ready to start Fruitbox.

Change directory to where you have Fruitbox installed. At the command-line type:

Code: Select all

./fruitbox --cfg [path-to-your-fruitbox.cfg-file] --database [mount-point-of-your-flash-drive] --music-path [mount-point-of-your-flash-drive] 
Mine looks like this:

Code: Select all

./fruitbox --cfg /home/pi/Fruitbox/skins/Seeburg3W1/fruitbox.cfg --database /media/pi/MUSIC --music-path /media/pi/MUSIC
Explanation: My Fruitbox is installed in a folder under my home folder: /home/pi/Fruitbox. The skin I'm using is a custom one I designed for my project that looks like the flip pages of a Seeburg wall box from the 1950's. My mount point for my music is /media/pi/Music. Regardless of which of my flash drives I plug in, this is always the mount point I use. Using these command-line switches, you can tell Fruitbox to look at your mount point for the music and database and ignore the entries for those things in your fruitbox.cfg. If it doesn't find a database, it will make one. If you change the music you have on the flash drive, you need to erase the fruitbox.db file from the flash drive. This will force Fruitbox to re-read the list of music files and re-create the database.

Please try what I have outlined above. If it works for you and you want my startup script, let me know and I'll post it here for you. If I've created more questions that I've answered, I'm sorry. Ask away and I'll do my best.

Steve

Edit:Posting the script anyway. Let me know what happens.

Code: Select all

# . /bin/bash

# Script for starting Fruitbox.
# Mounts the flash drive or hard drive at the specified mount point and
# then starts Fruitbox pointing to the mount point for both the music and
# database.  Output is run off to logfile.txt for later review.

# Check to see if there's an external hard drive attached
if [ ! -e "/dev/sda1" ];
    then
      echo -e "No Music drive found.\nPlease connect a USB drive with the music to play.\nExiting"
    exit
fi

# Mount the external hard drive
sudo mount -t vfat -o umask=000 /dev/sda1 /media/pi/MUSIC

# Start up fruitbox
cd Fruitbox
./fruitbox --cfg /home/pi/Fruitbox/skins/Seeburg3W1/fruitbox.cfg --database /media/pi/MUSIC/fruitbox.db --music-path /media/pi/MUSIC 2>&1 > logfile.txt

# Clean up after running fruitbox
sudo umount /dev/sda1
cd /home/pi
#clear
exit
Hi Steve,

Many Thanks for taking the time to explain all this to me, I'll give all this new information you've passed on a good run through tonight when I'm back from work and see how i get on! I'll let you know the results

Thanks Leigh

nino65
Posts: 7
Joined: Mon May 07, 2018 9:46 pm

Re: fruitbox MP3 jukebox

Mon May 14, 2018 6:23 pm

Good evening to everyone
I have a question to ask, when I press the button to get a credit, it does not make me add more credits.
Is there a possibility to insert other credits and add them to the current credit?
What settings should I put in order to have a credit for two songs?

ljs12377
Posts: 12
Joined: Tue Jan 07, 2014 10:22 pm

Re: fruitbox Mp3 files

Mon May 14, 2018 9:12 pm

ljs12377 wrote:
Mon May 14, 2018 10:17 am
shhammer5634 wrote:
Sun May 13, 2018 11:10 pm
shhammer5634 wrote:
Sun May 13, 2018 9:10 pm


Hi Leigh,

You are making progress. That's great news! Before I can answer your question though, I need to know if you are running Fruitbox from inside the PI desktop or are starting up the PI in console mode.

Cheers,
Steve

Edit: On the assumption that you're running PI in console mode, I'll type something up shortly. I'm cooking supper right now. Food before computing in my house. :D
OK, supper is over and I'm sipping my Diet Coke so I have time to type. Again, if I cover something you already know, I'm sorry. Just trying to be thorough.

A little Linux 101 to begin: Linux does not use drive letters. Everything hangs off the root directory ('/' without anything after it). A single hard drive can be a single volume, or can be broken up into several volumes depending on how it's configured. A volume hangs off the root directory at a mount point. A mount point is a folder when viewed in a directory listing. If the associated volume isn't mounted, the folder is empty. If a volume is mounted, then there will be files and folders listed in the mount point folder.

I needed to power up my PI for this bit of explanation and what I see may be different that what you see so bear with me. When I insert my usb stick and have started PI in graphic desktop mode, the flash drive mounts under the /media/pi folder with the volume name of the flash drive. In my case, my flash drive is named MUSIC (all caps) so the full mount point becomes /media/pi/MUSIC. When I start PI in console mode, even if the flash drive is present, it doesn't automatically mount. So Fruitbox can't find it.

Most flash drives are seen by Linux as a hard drive. So when you have the flash drive connected to PI, regardless of whether you are running in console or graphic mode, Linux creates a device node for it in the /dev folder. In this case, drive device nodes begin with the prefix sd, have one letter following, and a number to indicate the partition. In my case, my flash drive only has one partition on it. So in the /dev folder when I have the flash drive plugged in, I have an sda entry which is the flash drive itself and an sda1 entry which is the first (and in this case the only) partition (or volume) on the flash drive. That makes the path to the partition containing my music /dev/sda1. That path will be important later.

With your flash drive plugged in and your PI running in console mode so that you have a command-line prompt type:

Code: Select all

ls -l /dev/sd*
This will return at least two entries. /dev/sdX and /dev/sdX1 where X is the letter we are looking for.

Now at the command-line prompt type:

Code: Select all

ls -l /media/usb1
If you get "total 0" the mount point is there and ready to use. Skip this next bit.

If you get any other response than "total 0" then that mount point doesn't exist. You can create that mount point by typing:

Code: Select all

sudo mkdir /media/usb1
Once you know your mount point and the device name of your music partition we can mount it so it can be seen in Linux. Regular flash drives require special handling in Linux to be mounted so they can be used. I'll show you what my mount command looks like and hopefully from what we looked at previously you'll be able to figure out what to substitute to make it work for you. The basic syntax of mount is:

Code: Select all

mount [flags] [device] [mount point]
Mount needs to be run as root. You do that by prepending "sudo " to the front of the command string. So my full mount command is:

Code: Select all

sudo mount -t vfat -o umask=000 /dev/sda1 /media/pi/MUSIC
Explanation: Factory formatted flash drives have a fat32 format (It's a Windows/DOS thing). Linux expects to see something else. So we have to tell Linux to expect fat32 instead. -t vfat does this. One other thing in order to be able to write the database to the flash drive, we need permission to do so. By default we don't have. -o umask=000 gives us permission (actually it gives us more than we need, but it works).

Once I do that, then I can type:

Code: Select all

cd /media/pi/MUSIC
ls -l
And see all my MP3 files. If you get this far, then you're ready to start Fruitbox.

Change directory to where you have Fruitbox installed. At the command-line type:

Code: Select all

./fruitbox --cfg [path-to-your-fruitbox.cfg-file] --database [mount-point-of-your-flash-drive] --music-path [mount-point-of-your-flash-drive] 
Mine looks like this:

Code: Select all

./fruitbox --cfg /home/pi/Fruitbox/skins/Seeburg3W1/fruitbox.cfg --database /media/pi/MUSIC --music-path /media/pi/MUSIC
Explanation: My Fruitbox is installed in a folder under my home folder: /home/pi/Fruitbox. The skin I'm using is a custom one I designed for my project that looks like the flip pages of a Seeburg wall box from the 1950's. My mount point for my music is /media/pi/Music. Regardless of which of my flash drives I plug in, this is always the mount point I use. Using these command-line switches, you can tell Fruitbox to look at your mount point for the music and database and ignore the entries for those things in your fruitbox.cfg. If it doesn't find a database, it will make one. If you change the music you have on the flash drive, you need to erase the fruitbox.db file from the flash drive. This will force Fruitbox to re-read the list of music files and re-create the database.

Please try what I have outlined above. If it works for you and you want my startup script, let me know and I'll post it here for you. If I've created more questions that I've answered, I'm sorry. Ask away and I'll do my best.

Steve

Edit:Posting the script anyway. Let me know what happens.

Code: Select all

# . /bin/bash

# Script for starting Fruitbox.
# Mounts the flash drive or hard drive at the specified mount point and
# then starts Fruitbox pointing to the mount point for both the music and
# database.  Output is run off to logfile.txt for later review.

# Check to see if there's an external hard drive attached
if [ ! -e "/dev/sda1" ];
    then
      echo -e "No Music drive found.\nPlease connect a USB drive with the music to play.\nExiting"
    exit
fi

# Mount the external hard drive
sudo mount -t vfat -o umask=000 /dev/sda1 /media/pi/MUSIC

# Start up fruitbox
cd Fruitbox
./fruitbox --cfg /home/pi/Fruitbox/skins/Seeburg3W1/fruitbox.cfg --database /media/pi/MUSIC/fruitbox.db --music-path /media/pi/MUSIC 2>&1 > logfile.txt

# Clean up after running fruitbox
sudo umount /dev/sda1
cd /home/pi
#clear
exit
Hi Steve,

Many Thanks for taking the time to explain all this to me, I'll give all this new information you've passed on a good run through tonight when I'm back from work and see how i get on! I'll let you know the results

Thanks Leigh
Hi once again Steve,

All up and running now! I had a good read through your notes that you sent and decided to re-install rasbian from scratch as i was only running the lite version. With the full version in desktop mode i was able to see all the devices i had plugged in and the full file path names. Thanks for your help on this one it is much appreciated!!

Another new one if you know anything about these... I have a touchscreen that works on the GUI but not inside the TouchOne skin. It is a touchgenie overlay. Is there a quick way to get this up and running or is this not possible?

Once again many thanks
Leigh

User avatar
fruitbox
Posts: 287
Joined: Mon Feb 22, 2016 7:35 pm
Location: UK

Re: fruitbox MP3 jukebox

Mon May 14, 2018 9:18 pm

nino65 wrote:
Mon May 14, 2018 6:23 pm
Good evening to everyone
I have a question to ask, when I press the button to get a credit, it does not make me add more credits.
Is there a possibility to insert other credits and add them to the current credit?
What settings should I put in order to have a credit for two songs?
Hi,

In the config file there are four parameters related to credits:

Code: Select all

PlaysPerCoin1
PlaysPerCoin2
PlaysPerCoin3
PlaysPerCoin4
These are designed to mimic jukebox machines with up to four coin slots (for example, coin slot 1 could be for 5c, slot 2 50c, slot 3 $1, etc.), and so you can assign different values to each. If *all* of these values are set to zero (or not defined in the config file), then fruitbox enters "FreePlay" mode, and pressing any of the credit buttons has no effect.

If one of more of the above parameters is set to a non-zero value, then fruitbox starts up in "credit" mode, and you have to insert coins (by pressing ButtonCoin1, ButtonCoin2, ButtonCoin3 and/or ButtonCoin4) before you can select a song. The credits will increase every time you press a credit button.

When fruitbox is running, you can switch between freeplay and credit modes by pressing the ButtonFree button. If you started in free-play mode, then by definition all your four PlaysPerCoin parameters wil be zero. Obviously this is not compatible in credit mode, so fruitbox will force all these values to 1 when you switch.

So in your situation, I suspect you are starting fruitbox in free-play mode, so you have two choices...

1) Set PlaysPerCoin1 = 2 in the configuration file (so you get two song plays for each credit), or
2) Press ButtonFree when fruitbox is running, to switch to credit mode

Hope this is clear?

Cheers,
Mike

shhammer5634
Posts: 57
Joined: Mon Dec 04, 2017 10:45 am
Location: Iowa, USA

Re: fruitbox Mp3 files

Mon May 14, 2018 9:20 pm

ljs12377 wrote:
Mon May 14, 2018 9:12 pm
ljs12377 wrote:
Mon May 14, 2018 10:17 am
shhammer5634 wrote:
Sun May 13, 2018 11:10 pm


OK, supper is over and I'm sipping my Diet Coke so I have time to type. Again, if I cover something you already know, I'm sorry. Just trying to be thorough.

A little Linux 101 to begin: Linux does not use drive letters. Everything hangs off the root directory ('/' without anything after it). A single hard drive can be a single volume, or can be broken up into several volumes depending on how it's configured. A volume hangs off the root directory at a mount point. A mount point is a folder when viewed in a directory listing. If the associated volume isn't mounted, the folder is empty. If a volume is mounted, then there will be files and folders listed in the mount point folder.

I needed to power up my PI for this bit of explanation and what I see may be different that what you see so bear with me. When I insert my usb stick and have started PI in graphic desktop mode, the flash drive mounts under the /media/pi folder with the volume name of the flash drive. In my case, my flash drive is named MUSIC (all caps) so the full mount point becomes /media/pi/MUSIC. When I start PI in console mode, even if the flash drive is present, it doesn't automatically mount. So Fruitbox can't find it.

Most flash drives are seen by Linux as a hard drive. So when you have the flash drive connected to PI, regardless of whether you are running in console or graphic mode, Linux creates a device node for it in the /dev folder. In this case, drive device nodes begin with the prefix sd, have one letter following, and a number to indicate the partition. In my case, my flash drive only has one partition on it. So in the /dev folder when I have the flash drive plugged in, I have an sda entry which is the flash drive itself and an sda1 entry which is the first (and in this case the only) partition (or volume) on the flash drive. That makes the path to the partition containing my music /dev/sda1. That path will be important later.

With your flash drive plugged in and your PI running in console mode so that you have a command-line prompt type:

Code: Select all

ls -l /dev/sd*
This will return at least two entries. /dev/sdX and /dev/sdX1 where X is the letter we are looking for.

Now at the command-line prompt type:

Code: Select all

ls -l /media/usb1
If you get "total 0" the mount point is there and ready to use. Skip this next bit.

If you get any other response than "total 0" then that mount point doesn't exist. You can create that mount point by typing:

Code: Select all

sudo mkdir /media/usb1
Once you know your mount point and the device name of your music partition we can mount it so it can be seen in Linux. Regular flash drives require special handling in Linux to be mounted so they can be used. I'll show you what my mount command looks like and hopefully from what we looked at previously you'll be able to figure out what to substitute to make it work for you. The basic syntax of mount is:

Code: Select all

mount [flags] [device] [mount point]
Mount needs to be run as root. You do that by prepending "sudo " to the front of the command string. So my full mount command is:

Code: Select all

sudo mount -t vfat -o umask=000 /dev/sda1 /media/pi/MUSIC
Explanation: Factory formatted flash drives have a fat32 format (It's a Windows/DOS thing). Linux expects to see something else. So we have to tell Linux to expect fat32 instead. -t vfat does this. One other thing in order to be able to write the database to the flash drive, we need permission to do so. By default we don't have. -o umask=000 gives us permission (actually it gives us more than we need, but it works).

Once I do that, then I can type:

Code: Select all

cd /media/pi/MUSIC
ls -l
And see all my MP3 files. If you get this far, then you're ready to start Fruitbox.

Change directory to where you have Fruitbox installed. At the command-line type:

Code: Select all

./fruitbox --cfg [path-to-your-fruitbox.cfg-file] --database [mount-point-of-your-flash-drive] --music-path [mount-point-of-your-flash-drive] 
Mine looks like this:

Code: Select all

./fruitbox --cfg /home/pi/Fruitbox/skins/Seeburg3W1/fruitbox.cfg --database /media/pi/MUSIC --music-path /media/pi/MUSIC
Explanation: My Fruitbox is installed in a folder under my home folder: /home/pi/Fruitbox. The skin I'm using is a custom one I designed for my project that looks like the flip pages of a Seeburg wall box from the 1950's. My mount point for my music is /media/pi/Music. Regardless of which of my flash drives I plug in, this is always the mount point I use. Using these command-line switches, you can tell Fruitbox to look at your mount point for the music and database and ignore the entries for those things in your fruitbox.cfg. If it doesn't find a database, it will make one. If you change the music you have on the flash drive, you need to erase the fruitbox.db file from the flash drive. This will force Fruitbox to re-read the list of music files and re-create the database.

Please try what I have outlined above. If it works for you and you want my startup script, let me know and I'll post it here for you. If I've created more questions that I've answered, I'm sorry. Ask away and I'll do my best.

Steve

Edit:Posting the script anyway. Let me know what happens.

Code: Select all

# . /bin/bash

# Script for starting Fruitbox.
# Mounts the flash drive or hard drive at the specified mount point and
# then starts Fruitbox pointing to the mount point for both the music and
# database.  Output is run off to logfile.txt for later review.

# Check to see if there's an external hard drive attached
if [ ! -e "/dev/sda1" ];
    then
      echo -e "No Music drive found.\nPlease connect a USB drive with the music to play.\nExiting"
    exit
fi

# Mount the external hard drive
sudo mount -t vfat -o umask=000 /dev/sda1 /media/pi/MUSIC

# Start up fruitbox
cd Fruitbox
./fruitbox --cfg /home/pi/Fruitbox/skins/Seeburg3W1/fruitbox.cfg --database /media/pi/MUSIC/fruitbox.db --music-path /media/pi/MUSIC 2>&1 > logfile.txt

# Clean up after running fruitbox
sudo umount /dev/sda1
cd /home/pi
#clear
exit
Hi Steve,

Many Thanks for taking the time to explain all this to me, I'll give all this new information you've passed on a good run through tonight when I'm back from work and see how i get on! I'll let you know the results

Thanks Leigh
Hi once again Steve,

All up and running now! I had a good read through your notes that you sent and decided to re-install rasbian from scratch as i was only running the lite version. With the full version in desktop mode i was able to see all the devices i had plugged in and the full file path names. Thanks for your help on this one it is much appreciated!!

Another new one if you know anything about these... I have a touchscreen that works on the GUI but not inside the TouchOne skin. It is a touchgenie overlay. Is there a quick way to get this up and running or is this not possible?

Once again many thanks
Leigh
I'm very glad you're up and running. Unfortunately I don't have any experience with the touch screen aspect. I want to, just not there yet. Mike, the software author may be your best resource for that. I have seen a lot of discussion on the forum about diagnosing them but haven't been paying attention.

Enjoy your new jukebox.

Steve

ljs12377
Posts: 12
Joined: Tue Jan 07, 2014 10:22 pm

Re: fruitbox Mp3 files

Mon May 14, 2018 9:33 pm

shhammer5634 wrote:
Mon May 14, 2018 9:20 pm
ljs12377 wrote:
Mon May 14, 2018 9:12 pm
ljs12377 wrote:
Mon May 14, 2018 10:17 am


Hi Steve,

Many Thanks for taking the time to explain all this to me, I'll give all this new information you've passed on a good run through tonight when I'm back from work and see how i get on! I'll let you know the results

Thanks Leigh
Hi once again Steve,

All up and running now! I had a good read through your notes that you sent and decided to re-install rasbian from scratch as i was only running the lite version. With the full version in desktop mode i was able to see all the devices i had plugged in and the full file path names. Thanks for your help on this one it is much appreciated!!

Another new one if you know anything about these... I have a touchscreen that works on the GUI but not inside the TouchOne skin. It is a touchgenie overlay. Is there a quick way to get this up and running or is this not possible?

Once again many thanks
Leigh
I'm very glad you're up and running. Unfortunately I don't have any experience with the touch screen aspect. I want to, just not there yet. Mike, the software author may be your best resource for that. I have seen a lot of discussion on the forum about diagnosing them but haven't been paying attention.

Enjoy your new jukebox.

Steve
Many thanks Steve. Much appreciated

User avatar
fruitbox
Posts: 287
Joined: Mon Feb 22, 2016 7:35 pm
Location: UK

Re: fruitbox Mp3 files

Mon May 14, 2018 9:36 pm

ljs12377 wrote:
Mon May 14, 2018 9:12 pm

Hi once again Steve,

All up and running now! I had a good read through your notes that you sent and decided to re-install rasbian from scratch as i was only running the lite version. With the full version in desktop mode i was able to see all the devices i had plugged in and the full file path names. Thanks for your help on this one it is much appreciated!!

Another new one if you know anything about these... I have a touchscreen that works on the GUI but not inside the TouchOne skin. It is a touchgenie overlay. Is there a quick way to get this up and running or is this not possible?

Once again many thanks
Leigh
Hi Leigh,

fruitbox defaults to assuming the touch screen is the official raspberry Pi one, so if it's not you have to tell it otherwise.

What you need to do is first of all find out the name of the touchscreen by typing...

Code: Select all

cat /proc/bus/input/devices | more
You will get a load of information, a page at a time (press space to move to the next page, or ENTER to move a line at a time). Each input device will be described, but you are looking for lines that start with N: Name=. You should be able to identify your touchscreen by it's name. When you have found it, make a note of its name, and then run fruitbox with the --touch-device option. You need to also run this with the --config-buttons option to map your buttons to the touch screen. There have been a few explanations previously in this forum, so it's worth checking back if you get stuck (and also consult the user guide). When you specify the --touch-device option be sure to follow it with at least part of the name - just one word will do, as long as it's unique to that device so fruitbox doesn't get it mixed up with another device which has the same word in its name. So for example if your touchscreen name has the word Genie in it, you will need to run fruitbox like this...

Code: Select all

sudo ./fruitbox --config-buttons --touch-device Genie
..this will allow you to configure the buttons for Touch (for TouchOne skin you only need Left/Right, Random, Skip, Vol+ and Vol- ... for the other buttons just press <ESC> on the keyboard rather than touching the screen). Then fruitbox will create a file called fruitbox.btn which it will then use the next time you run it normally.

Just a word of warning however; in the current release there are a few known issues with working with some touch devices, so if you are unlucky your touch screen won't work.. However, in the next fruitbox release (1.12) I think those issues have been resolved. The next release will be available in the next week or two, but there's loads of great new changes in it so it's under test as we speak.

Cheers,
Mike

ljs12377
Posts: 12
Joined: Tue Jan 07, 2014 10:22 pm

Re: fruitbox MP3 jukebox

Tue May 15, 2018 11:53 am

Thanks for that Mike I'll give it a go later tonight when home and see what happens! Thanks for this software I've been after something like this for quite a while!

Cheers
Leigh

nino65
Posts: 7
Joined: Mon May 07, 2018 9:46 pm

Re: fruitbox MP3 jukebox

Tue May 15, 2018 12:03 pm

Grazie Mike per la risposta

User avatar
fruitbox
Posts: 287
Joined: Mon Feb 22, 2016 7:35 pm
Location: UK

Re: fruitbox MP3 jukebox

Tue May 15, 2018 9:34 pm

Release v1.12 teaser...
Attachments
MikeTV.jpg
MikeTV.jpg (98.12 KiB) Viewed 2257 times

PittStone
Posts: 12
Joined: Mon Apr 23, 2018 6:48 pm

Re: fruitbox MP3 jukebox

Wed May 16, 2018 12:45 am

fruitbox wrote:
Tue May 15, 2018 9:34 pm
Release v1.12 teaser...
Awesome. Can we Play Music-Video Clips with the Update?

User avatar
fruitbox
Posts: 287
Joined: Mon Feb 22, 2016 7:35 pm
Location: UK

Re: fruitbox MP3 jukebox

Wed May 16, 2018 6:03 am

PittStone wrote:
Wed May 16, 2018 12:45 am
fruitbox wrote:
Tue May 15, 2018 9:34 pm
Release v1.12 teaser...
Awesome. Can we Play Music-Video Clips with the Update?
Yes! ... but only in ogv (Theora + Vorbis) format.

I've been using ffmpeg to convert any video format to ogv...

Code: Select all

ffmpeg -i yourvideo -b:v 2000000 -vf scale=640:360 yourvideo.ogv
Mike

PittStone
Posts: 12
Joined: Mon Apr 23, 2018 6:48 pm

Re: fruitbox MP3 jukebox

Wed May 16, 2018 9:43 am

fruitbox wrote:
Wed May 16, 2018 6:03 am
PittStone wrote:
Wed May 16, 2018 12:45 am
fruitbox wrote:
Tue May 15, 2018 9:34 pm
Release v1.12 teaser...
Awesome. Can we Play Music-Video Clips with the Update?
Yes! ... but only in ogv (Theora + Vorbis) format.

I've been using ffmpeg to convert any video format to ogv...

Code: Select all

ffmpeg -i yourvideo -b:v 2000000 -vf scale=640:360 yourvideo.ogv
Mike
Ah O.k. But i prefer "Xmedia Recode" for Converting any Formats to any Formats. Its still the Best Converter i found.

User avatar
fruitbox
Posts: 287
Joined: Mon Feb 22, 2016 7:35 pm
Location: UK

Re: fruitbox MP3 jukebox

Wed May 16, 2018 9:48 am

PittStone wrote:
Wed May 16, 2018 9:43 am

Ah O.k. But i prefer "Xmedia Recode" for Converting any Formats to any Formats. Its still the Best Converter i found.
That app uses ffmpeg ;)

Papakriminalis
Posts: 5
Joined: Wed May 16, 2018 6:20 am

Re: fruitbox MP3 jukebox

Wed May 16, 2018 11:43 am

Hello!
First, thank you for this beautiful sw.
Second. I tried running with the WallJuke skin but it does not work. The program needs more memory (as I read in the forum) but I have selected 512 with the memory division. This may be because I have the desktop open? Is it necessary to run it only in console mode?

Thank you!.
P.S.
I have repaired the Status0.txt of the WallSmall skin as follows:
PLAYING NOW:
$ IF_SONG_PLAYING $ NOW_PLAYING_TITLE $ END_IF
$ IF_NOT_SONG_PLAYING $ IF_NOT_SONG_LOADING $ IF_NOT_SONG_UNLOADING $ IF_TIMER_HI ** SELECT SONG ** $ END_IF $ END_IF $ END_IF $ END_IF $ IF_SONG_PLAYING for $ NOW_PLAYING_ARTIST $ END_IF
$ IF_SONG_PLAYING $ NOW_PLAYING_ELAPSED_TIME / $ NOW_PLAYING_LENGTH $ END_IF


The original shows an erroneous message due to an error with the var "xxxSONG_NOT_xxxx" when the correct one was "xxxNOT_SONG_xxx"
I hope you do not mind.

User avatar
fruitbox
Posts: 287
Joined: Mon Feb 22, 2016 7:35 pm
Location: UK

Re: fruitbox MP3 jukebox

Wed May 16, 2018 12:33 pm

Papakriminalis wrote:
Wed May 16, 2018 11:43 am
Hello!
First, thank you for this beautiful sw.
Second. I tried running with the WallJuke skin but it does not work. The program needs more memory (as I read in the forum) but I have selected 512 with the memory division. This may be because I have the desktop open? Is it necessary to run it only in console mode?

Thank you!.
P.S.
I have repaired the Status0.txt of the WallSmall skin as follows:
PLAYING NOW:
$ IF_SONG_PLAYING $ NOW_PLAYING_TITLE $ END_IF
$ IF_NOT_SONG_PLAYING $ IF_NOT_SONG_LOADING $ IF_NOT_SONG_UNLOADING $ IF_TIMER_HI ** SELECT SONG ** $ END_IF $ END_IF $ END_IF $ END_IF $ IF_SONG_PLAYING for $ NOW_PLAYING_ARTIST $ END_IF
$ IF_SONG_PLAYING $ NOW_PLAYING_ELAPSED_TIME / $ NOW_PLAYING_LENGTH $ END_IF


The original shows an erroneous message due to an error with the var "xxxSONG_NOT_xxxx" when the correct one was "xxxNOT_SONG_xxx"
I hope you do not mind.
Hi,

I would recommend you run directly from the console (256M of GPU memory has always worked for WallJuke). Maybe there are some other apps running which have grabbed GPU memory too?

Thanks for correcting the skin... well spotted. I have now made the same changes to the file in GitHub.

Cheers,
Mike

Papakriminalis
Posts: 5
Joined: Wed May 16, 2018 6:20 am

Re: fruitbox MP3 jukebox

Wed May 16, 2018 3:09 pm

Thanks I try it

PittStone
Posts: 12
Joined: Mon Apr 23, 2018 6:48 pm

Re: fruitbox MP3 jukebox

Wed May 16, 2018 6:10 pm


nino65
Posts: 7
Joined: Mon May 07, 2018 9:46 pm

Re: fruitbox MP3 jukebox

Wed May 16, 2018 7:55 pm

Good evening to everyone
I wanted to delete the rpi-fruitbox-master folder from RASPBIAN STRETCH WITH DESKTOP to insert the new folder with the changes made.
How do you do it does not make me erase it.

User avatar
karrika
Posts: 1051
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: fruitbox MP3 jukebox

Thu May 17, 2018 9:19 am

fruitbox wrote:
Tue May 15, 2018 9:34 pm
Release v1.12 teaser...
I love it!

The format conversion is no problem. Currently I have a few music clips with video that I would LOVE to play. Combining this with normal music in jukebox is really appreciated.

Papakriminalis
Posts: 5
Joined: Wed May 16, 2018 6:20 am

Re: fruitbox MP3 jukebox

Fri May 18, 2018 9:09 am

Hello everyone
I have two doubts with this great software:
1.-Is there any way to put it in a batch file? I searched the forum but I can not find it. I'm sure it's easy, but my Linux level is too low.
2.-Could it be compatible to hear music through the USB input?

Thanks

shhammer5634
Posts: 57
Joined: Mon Dec 04, 2017 10:45 am
Location: Iowa, USA

Re: fruitbox MP3 jukebox

Fri May 18, 2018 1:51 pm

Papakriminalis wrote:
Fri May 18, 2018 9:09 am
Hello everyone
I have two doubts with this great software:
1.-Is there any way to put it in a batch file? I searched the forum but I can not find it. I'm sure it's easy, but my Linux level is too low.
2.-Could it be compatible to hear music through the USB input?

Thanks
Hello to you.

The answer to question 1 is yes. If you look back a few posts you'll see a discussion I had with another person about much the same thing. In fact I posted a copy of the script (batch file) I use to run my copy of Fruitbox.

The answer to question 2 is, it depends. If you're planning on playing music stored on a USB device, the yes. If you are using a USB hard drive you'll need to have a way to power that drive. The Raspberry PI power supply may not be able to do that for you. Flash drives work just fine. That's what I use. If you want to stream the music over USB, then no.

The same discussion I had about the script also has a discussion of how to use a USB device as a source of music files.

If there's anything else, just ask.

Cheers,
Steve

CB-Globetrotter
Posts: 3
Joined: Fri May 18, 2018 5:18 pm

Re: fruitbox MP3 jukebox

Fri May 18, 2018 6:01 pm

Hello everybody,
I have a problem with the music volume output at 3.5mm. With miniature amplifier 2x12W sine wave to test.
I have 2 SD one with Dektop Version and on one with Lite Version with Fruitbox. When I start the Raspi with the desktop version, I get maximum volume .. in decibels 95db, I start fruitbox I have a maximum of 45db. In the room, Is top for the night :-)
The keys "=" + "-" have no function in all skins !?
Entering the [Sounds] SongVolume (0..100) in the fruitbox.cfg had no effect.
Is there an offset setting on the SoundVolume, or is Raspi's default?
My English too bad, so translation from Google.
Greeting Didi

CB-Globetrotter
Posts: 3
Joined: Fri May 18, 2018 5:18 pm

Re: fruitbox MP3 jukebox

Sat May 19, 2018 10:50 am

Hello everybody,
It has resolved itself.
Since my post was still not registered after 70 minutes, I found the solution in 3 other forums.
Greeting Didi
Mike Top Program, Thx

Return to “Graphics, sound and multimedia”