bernyone
Posts: 50
Joined: Fri Sep 29, 2017 8:42 pm

Re: fruitbox MP3 jukebox

Sun Dec 31, 2017 11:03 am

Gpio issues.....

So i have this wonderful bit of software all running beautifully (Mike once again you're amazing for creating exactly what i needed!!)

I've now added 15 buttons to the front of my jukebox and connected to the Gpio's and installed retrogame and altered the .cfg to the correct buttons ect but when i press the buttons it reboots my pi......

Anyone know what im doing wrong?
IMG_20171231_110100.jpg
IMG_20171231_110100.jpg (91.23 KiB) Viewed 1645 times
IMG_20171231_110143.jpg
IMG_20171231_110143.jpg (107.66 KiB) Viewed 1645 times
IMG_20171231_110204.jpg
IMG_20171231_110204.jpg (34.26 KiB) Viewed 1645 times
Grounds are all linked to pin 39

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

Re: fruitbox MP3 jukebox

Sun Dec 31, 2017 11:36 am

bernyone wrote:
Sun Dec 31, 2017 11:03 am
Gpio issues.....

So i have this wonderful bit of software all running beautifully (Mike once again you're amazing for creating exactly what i needed!!)

I've now added 15 buttons to the front of my jukebox and connected to the Gpio's and installed retrogame and altered the .cfg to the correct buttons ect but when i press the buttons it reboots my pi......

Anyone know what im doing wrong?IMG_20171231_110100.jpg
IMG_20171231_110143.jpg
IMG_20171231_110204.jpg

Grounds are all linked to pin 39
Looks brilliant!

Does it matter which button(s) you press when the Pi reboots, or any button? Have you checked your wiring carefully; you may have a power rail (3 or 5V) connected to a button so when you press it will cause a power short to ground, which would cause the Pi to reset I expect...

Or perhaps one of the GPIO you are using is already assigned to something else?
Cheers,
Mike

bernyone
Posts: 50
Joined: Fri Sep 29, 2017 8:42 pm

Re: fruitbox MP3 jukebox

Sun Dec 31, 2017 11:58 am

Hi mike thanks for the rapid reply

Its a fresh build dedicated to fruitbox so shouldn't have anything thats assigned to anything else.....
IMG_20171231_115448.jpg
IMG_20171231_115448.jpg (81.25 KiB) Viewed 1627 times
I used this guide which corresponds to the numbers in this (switched 24 & 25 as i read there no no's)
IMG_20171231_110204.jpg
IMG_20171231_110204.jpg (34.26 KiB) Viewed 1627 times
Not all the buttons reboot it but at least 4/5 definitely do (haven't actually tested all 15 lol)

bernyone
Posts: 50
Joined: Fri Sep 29, 2017 8:42 pm

Re: fruitbox MP3 jukebox

Sun Dec 31, 2017 12:09 pm

Im thinking the issue could be one of these.....
IMG_20171231_120730.jpg
IMG_20171231_120730.jpg (127.51 KiB) Viewed 1624 times

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

Re: fruitbox MP3 jukebox

Sun Dec 31, 2017 12:58 pm

bernyone wrote:
Sun Dec 31, 2017 12:09 pm
Im thinking the issue could be one of these.....

IMG_20171231_120730.jpg
Hi

If you plug a USB keyboard in can you control the jukebox without using the buttons without it Rebooting? (Just trying to isolate the button hardware from the software). Also if you run raspi-config from the command line you can check and disable the default interface options from the advanced options. These include RS232 and I2C/SPI interfaces which use the GPIO pins. That said, I don't recall having any issues with my GPIO buttons so it's more likely an issue with the actual wiring itself I would guess...perhaps you have a short between a couple of pins?

Mike

bernyone
Posts: 50
Joined: Fri Sep 29, 2017 8:42 pm

Re: fruitbox MP3 jukebox

Sun Dec 31, 2017 2:49 pm

Having issues getting on this site (traffic presumably)

Gotta be hardware issue as fruitbox is running lovely using the keyboard (had it running all day

I insulated all the ends so im doubtful its a short (although not ruling anything out tbh)

Ive swapped the ground pin and now they dont work at all.....

bernyone
Posts: 50
Joined: Fri Sep 29, 2017 8:42 pm

Re: fruitbox MP3 jukebox

Sun Dec 31, 2017 2:56 pm

so ive swapped the ground pin and now the 5 pins that rebooted the pi now are inputting the letter M and the other 10 are not working at all......

heres the retrogame.cfg in case im missing something simple

# Sample configuration file for retrogame.
# Really minimal syntax, typically two elements per line w/space delimiter:
# 1) a key name (from keyTable.h; shortened from /usr/include/linux/input.h).
# 2) a GPIO pin number; when grounded, will simulate corresponding keypress.
# Uses Broadcom pin numbers for GPIO.
# If first element is GND, the corresponding pin (or pins, multiple can be
# given) is a LOW-level output; an extra ground pin for connecting buttons.
# A '#' character indicates a comment to end-of-line.
# File can be edited "live," no need to restart retrogame!

# Here's a pin configuration for the PiGRRL 2 project:


LEFT 22 # left
RIGHT 17 # right
1 20 # 1
2 19 # 2
3 13 # 3
4 12 # 4
A 21 # A
B 16 # B
C 26 # C
D 6 # D
E 5 # E
BACKSPACE 4 # SKIP
M 23 # MUTE
ESC 27 # POWER
SPACE 18 # RANDOM

# For configurations with few buttons (e.g. Cupcade), a key can be followed
# by multiple pin numbers. When those pins are all held for a few seconds,
# this will generate the corresponding keypress (e.g. ESC to exit ROM).
# Only ONE such combo is supported within the file though; later entries
# will override earlier.

bernyone
Posts: 50
Joined: Fri Sep 29, 2017 8:42 pm

Re: fruitbox MP3 jukebox

Sun Dec 31, 2017 4:12 pm

HOW TO LOOK AN IDIOT IN 1 SMALL STEP....

Had the pin guide UPSIDE DOWN :roll:

Working flawlessly!!!!!!

Jon

SORRY MIKE

sasquatch001
Posts: 20
Joined: Thu Dec 14, 2017 11:08 pm

Re: fruitbox MP3 jukebox

Sun Dec 31, 2017 4:24 pm

:D

That made me smile. Glad it's working as it looks amazing!

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

Re: fruitbox MP3 jukebox

Sun Dec 31, 2017 5:20 pm

bernyone wrote:
Sun Dec 31, 2017 4:12 pm
HOW TO LOOK AN IDIOT IN 1 SMALL STEP....

Had the pin guide UPSIDE DOWN :roll:

Working flawlessly!!!!!!

Jon

SORRY MIKE
Hi Jon

Nearly always the most weird bugs have the most simple reasons! Glad you got it sorted...and just in time for new years eve :D

Your jukebox looks amazing...a brilliant advert for fruitbox ;)

Happy new year,

Mike

OklahomaGreyBeard
Posts: 35
Joined: Thu Feb 11, 2016 3:14 am

Re: fruitbox MP3 jukebox

Tue Jan 02, 2018 4:00 pm

So much more of this makes sense now. You kept referring me to the user manual which didn't make sense to me since it was of no use. Apparently when I typed in the command to create it, I fat fingered something and the resulting file contained only the same few lines you get from the command prompt if you launch fruitbox incorrectly. Now it is populated correctly and is of much use.

One of the things I always had WinCab doing was running from a usb keypad as a controller. I've noticed though that fruitbox doesn't seem to respond to the keypad numbers though, only the ones above the qwerty keyboard. My attempts to re-map them using loadkeys has not been successful. Would it be a major hassle to make the keys re-mappable to any keypress or at least have it respond to the keypad numbers as well?

Also, I've always ran WinCab using different configs to load different decades of music based on AMI's top hits lists. Fruitbox handles this quite nicely but my song sorting is a bit off. I spent quite a bit of time getting the "b sides" of each song lined up so it appears just as it would on a real jukebox. Would it be possible to add a field for sorting of songs by an artist? That way if I have an artist with 6 songs, I can always load the "a side" on the top of the tag and ensure the right "b side" is paired with it even if I have to manually edit the database file.

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

Re: fruitbox MP3 jukebox

Tue Jan 02, 2018 4:36 pm

OklahomaGreyBeard wrote:
Tue Jan 02, 2018 4:00 pm
So much more of this makes sense now. You kept referring me to the user manual which didn't make sense to me since it was of no use. Apparently when I typed in the command to create it, I fat fingered something and the resulting file contained only the same few lines you get from the command prompt if you launch fruitbox incorrectly. Now it is populated correctly and is of much use.

One of the things I always had WinCab doing was running from a usb keypad as a controller. I've noticed though that fruitbox doesn't seem to respond to the keypad numbers though, only the ones above the qwerty keyboard. My attempts to re-map them using loadkeys has not been successful. Would it be a major hassle to make the keys re-mappable to any keypress or at least have it respond to the keypad numbers as well?

Also, I've always ran WinCab using different configs to load different decades of music based on AMI's top hits lists. Fruitbox handles this quite nicely but my song sorting is a bit off. I spent quite a bit of time getting the "b sides" of each song lined up so it appears just as it would on a real jukebox. Would it be possible to add a field for sorting of songs by an artist? That way if I have an artist with 6 songs, I can always load the "a side" on the top of the tag and ensure the right "b side" is paired with it even if I have to manually edit the database file.
Hi

Glad you've got the user guide working now. Regarding the re-mappable buttons, I appreciate that this would be beneficial and have been giving it some thought. So in the next release I plan to include this feature, as part of a general upgrade to the button handling, which will also include support for USB joystick devices, support direct GPIO input and lay the groundwork for ultimately supporting touchscreen input.

For sorting songs by artist, this already exists in fruitbox...see the 'SortSongsBy' parameter. A point worth noting is that in theory you can specify this parameter several times in the config file (with different sort criteria) and fruitbox will perform several sorts in the order in which they appear in the config file. Not sure if this helps (and I've not tried it in anger).

And speaking of configuration parameters specified multiple times, it is also possible to specify the MusicPath parameter as many times as you like, so you can get fruitbox to scan completely different places when generating the database file. This may be of use too...

Cheers,
Mike

OklahomaGreyBeard
Posts: 35
Joined: Thu Feb 11, 2016 3:14 am

Re: fruitbox MP3 jukebox

Wed Jan 03, 2018 2:02 am

For sorting songs by artist, this already exists in fruitbox...see the 'SortSongsBy' parameter. A point worth noting is that in theory you can specify this parameter several times in the config file (with different sort criteria) and fruitbox will perform several sorts in the order in which they appear in the config file. Not sure if this helps (and I've not tried it in anger).
Actually that is perfect. I can sort by Artist, Album, then Track Number and it will be perfect. My only issue now is turning it off long enough to work on it...

OklahomaGreyBeard
Posts: 35
Joined: Thu Feb 11, 2016 3:14 am

Re: fruitbox MP3 jukebox

Wed Jan 03, 2018 4:07 pm

So about 2AM lightning struck my brain and I started to attempt a new skin. I wanted to take advantage of the ability for animation yet be unique. It's using preliminary graphics just to see if it'll actually work and so far I think it's pretty decent. The linked video has almost no sound to avoid a YouTube copyright flag but you can still get the idea. Now I think it's time for sleep

https://www.youtube.com/watch?v=Kn-8MUAGSQk

OklahomaGreyBeard
Posts: 35
Joined: Thu Feb 11, 2016 3:14 am

Re: fruitbox MP3 jukebox

Fri Jan 05, 2018 3:06 am

I know you're working on adding things to this and I've been having a blast playing with skinning. As you can tell, I'm not creating the "standard" jukebox look and have a question about the labels for song selection. Is there currently a way to have it show a joined Artist - Title (including the dash or other separator)?

Right now I can do it with a left and right justification and plus/minus offsets but it just doesn't look natural on short artist/title combinations.

Actually I found a fairly kludged workaround. Copy the database contents into a google spreadsheet, copy the artist column in front of the title, insert another column with the dash, merge the three columns then copy and paste back into the database. Then I only show the title. Apparently by default it adds a white artist field if I don't put one in it so I added it and placed it off screen.

Yea an added field in the database for combined would be much simpler.

As always, thank you for the awesome software.

-mike

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

Re: fruitbox MP3 jukebox

Fri Jan 05, 2018 6:16 am

I just modified the WallJuke skin for the Official 7" screen. At the same time I changed the buttons from A1 to 11 format. So there is just 7 buttons to press 1,2,3,4,Next Page,Prev Page,Skip

Image

The new skin WallSmall will be made to a pull request to the repo shortly.

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

Re: fruitbox MP3 jukebox

Fri Jan 05, 2018 8:39 am

The fruitbox on the 7" official display does not use the HDMI video at all.

I know that it is possible to run omxplayer at the same time with a switch "--display 5" to send a music video to a second HDMI screen.

Does the fruitbox use omxplayer for the audio? Would it be possible to also play mp4 files in the jukebox with video output to a second screen with this technique?

I was mainly thinking of including old cartoons like All The Cats Join In (1946) by Benny Goodman

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

Re: fruitbox MP3 jukebox

Fri Jan 05, 2018 9:07 am

OklahomaGreyBeard wrote:
Fri Jan 05, 2018 3:06 am
I know you're working on adding things to this and I've been having a blast playing with skinning. As you can tell, I'm not creating the "standard" jukebox look and have a question about the labels for song selection. Is there currently a way to have it show a joined Artist - Title (including the dash or other separator)?

Right now I can do it with a left and right justification and plus/minus offsets but it just doesn't look natural on short artist/title combinations.

Actually I found a fairly kludged workaround. Copy the database contents into a google spreadsheet, copy the artist column in front of the title, insert another column with the dash, merge the three columns then copy and paste back into the database. Then I only show the title. Apparently by default it adds a white artist field if I don't put one in it so I added it and placed it off screen.

Yea an added field in the database for combined would be much simpler.

As always, thank you for the awesome software.

-mike
Yep no problem - I can add another format for that. Your skin looks promising btw!

Cheers
Mike

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

Re: fruitbox MP3 jukebox

Fri Jan 05, 2018 9:09 am

karrika wrote:
Fri Jan 05, 2018 6:16 am
I just modified the WallJuke skin for the Official 7" screen. At the same time I changed the buttons from A1 to 11 format. So there is just 7 buttons to press 1,2,3,4,Next Page,Prev Page,Skip

Image

The new skin WallSmall will be made to a pull request to the repo shortly.
Looks good! Thanks for your contribution. It'll make a good starting point for the touchscreen work ;)

The new skin has now been merged into the GitHib master.

Cheers
Mike

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

Re: fruitbox MP3 jukebox

Fri Jan 05, 2018 9:22 am

karrika wrote:
Fri Jan 05, 2018 8:39 am
The fruitbox on the 7" official display does not use the HDMI video at all.

I know that it is possible to run omxplayer at the same time with a switch "--display 5" to send a music video to a second HDMI screen.

Does the fruitbox use omxplayer for the audio? Would it be possible to also play mp4 files in the jukebox with video output to a second screen with this technique?

I was mainly thinking of including old cartoons like All The Cats Join In (1946) by Benny Goodman
Hi

That's the biggest ask yet! Fruitbox uses libmpg123 for the audio (mp3) and Allegro for the sound effects, so doesn't fit into the omxplayer architecture at all.

Probably the best way forward for this is to perhaps have fruitbox write a text description to an external "now_playing" file which could be read in real time by a separate app running alongside fruitbox which would play the video out the HDMI?

Any thoughts about that?

Cheers,
Mike

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

Re: fruitbox MP3 jukebox

Fri Jan 05, 2018 9:41 am

fruitbox wrote:
Fri Jan 05, 2018 9:22 am
karrika wrote:
Fri Jan 05, 2018 8:39 am
The fruitbox on the 7" official display does not use the HDMI video at all.

I know that it is possible to run omxplayer at the same time with a switch "--display 5" to send a music video to a second HDMI screen.

Does the fruitbox use omxplayer for the audio? Would it be possible to also play mp4 files in the jukebox with video output to a second screen with this technique?

I was mainly thinking of including old cartoons like All The Cats Join In (1946) by Benny Goodman
Hi

That's the biggest ask yet! Fruitbox uses libmpg123 for the audio (mp3) and Allegro for the sound effects, so doesn't fit into the omxplayer architecture at all.

Probably the best way forward for this is to perhaps have fruitbox write a text description to an external "now_playing" file which could be read in real time by a separate app running alongside fruitbox which would play the video out the HDMI?

Any thoughts about that?

Cheers,
Mike
Sounds good. I could probably use the sound from fruitbox and just show the video using omxplayer. In any case I don't want the audio to go through HDMI as I have the AudioInjector card with a mechanical volume pot on the HAT card.

I have a cheap low res LED projector that could beam the cartoon from inside the Jukebox front grill. So it does not have to be in perfect sync.

It might even be possible to use aplay to swap the audio between omxplayer and fruitbox during the video...

Does fruitbox support dbus commands? I could monitor the current tune playing through dbus. I did it on Clementine. The version has changed to v2 since then. So this might not work anymore...

Code: Select all

import dbus

# Clementine lives on the Session bus
session_bus = dbus.SessionBus()

# Get Clementine's player object, and then get an interface from that object,
# otherwise we'd have to type out the full interface name on every method call.
player = session_bus.get_object('org.mpris.clementine', '/Player')
iface = dbus.Interface(player, dbus_interface='org.freedesktop.MediaPlayer')

# Call a method on the interface
metadata = iface.GetMetadata()
print metadata["title"]
print metadata["artist"]

Last edited by karrika on Fri Jan 05, 2018 9:51 am, edited 1 time in total.

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

Re: fruitbox MP3 jukebox

Fri Jan 05, 2018 9:50 am

karrika wrote:
Fri Jan 05, 2018 9:41 am
fruitbox wrote:
Fri Jan 05, 2018 9:22 am
karrika wrote:
Fri Jan 05, 2018 8:39 am
The fruitbox on the 7" official display does not use the HDMI video at all.

I know that it is possible to run omxplayer at the same time with a switch "--display 5" to send a music video to a second HDMI screen.

Does the fruitbox use omxplayer for the audio? Would it be possible to also play mp4 files in the jukebox with video output to a second screen with this technique?

I was mainly thinking of including old cartoons like All The Cats Join In (1946) by Benny Goodman
Hi

That's the biggest ask yet! Fruitbox uses libmpg123 for the audio (mp3) and Allegro for the sound effects, so doesn't fit into the omxplayer architecture at all.

Probably the best way forward for this is to perhaps have fruitbox write a text description to an external "now_playing" file which could be read in real time by a separate app running alongside fruitbox which would play the video out the HDMI?

Any thoughts about that?

Cheers,
Mike
Sounds good. I could probably use the sound from fruitbox and just show the video using omxplayer. In any case I don't want the audio to go through HDMI as I have the AudioInjector card with a mechanical volume pot on the HAT card.

Does fruitbox support dbus commands? I could monitor the current tune playing through dbus. I did it on Clementine. The version has changed to v2 since then. So this might not work anymore...

Code: Select all

import dbus

# Clementine lives on the Session bus
session_bus = dbus.SessionBus()

# Get Clementine's player object, and then get an interface from that object,
# otherwise we'd have to type out the full interface name on every method call.
player = session_bus.get_object('org.mpris.clementine', '/Player')
iface = dbus.Interface(player, dbus_interface='org.freedesktop.MediaPlayer')

# Call a method on the interface
metadata = iface.GetMetadata()
print metadata["title"]
print metadata["artist"]

Hi,

Haven't used dbus before, but it looks like the right way to go, so I'll add this to the feature list for a future release.

If you have any ideas on what sort of messaging you need then please let me know. Maybe the best way is to implment it like the status objects so that the message contents are totally flexible and can be defined just like a status Contents file perhaps, so can include any of the $ status variables as well as user-defined text...

Cheers,
Mike

OklahomaGreyBeard
Posts: 35
Joined: Thu Feb 11, 2016 3:14 am

Re: fruitbox MP3 jukebox

Sun Jan 07, 2018 4:31 pm

So through experimenting, I've found you can also apply a rotation to variable text objects such as $NOW_PLAYING but when I do it rotates all text items on the screen. Is there a way to rotate individual text objects?

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

Re: fruitbox MP3 jukebox

Sun Jan 07, 2018 4:59 pm

OklahomaGreyBeard wrote:
Sun Jan 07, 2018 4:31 pm
So through experimenting, I've found you can also apply a rotation to variable text objects such as $NOW_PLAYING but when I do it rotates all text items on the screen. Is there a way to rotate individual text objects?
Hi,

The rotation is applied to the whole object, so if for example you have a status object with several text elements it will rotate everything in that object. The way around this is to split the status object into two separate status objects, and, in your case just have the $NOW_PLAYING in one status object (which you apply the rotation to), and the other object containing everything else (which you don't rotate).

...or it may be that you are just specifying the Angle config property for the status object you want to rotate, and not specifying the Angle for subsequent status objects defined in the config file. If this is the case, the subsquent status objects will inherit the Angle value from the previous object, so the rotation will be applied to everything after the first one in which the Angle is defined. To get around this, just specify the Angle value as zero for each and every object after the one you wish to rotate (including bitmaps etc).

Hope this helps,

Cheers,
Mike

OklahomaGreyBeard
Posts: 35
Joined: Thu Feb 11, 2016 3:14 am

Re: fruitbox MP3 jukebox

Sun Jan 07, 2018 5:27 pm

fruitbox wrote:
Sun Jan 07, 2018 4:59 pm

...or it may be that you are just specifying the Angle config property for the status object you want to rotate, and not specifying the Angle for subsequent status objects defined in the config file. If this is the case, the subsquent status objects will inherit the Angle value from the previous object, so the rotation will be applied to everything after the first one in which the Angle is defined. To get around this, just specify the Angle value as zero for each and every object after the one you wish to rotate (including bitmaps etc).

Hope this helps,

Cheers,
Mike
That was it, thanks.

Return to “Graphics, sound and multimedia”

Who is online

Users browsing this forum: No registered users and 7 guests