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

Re: fruitbox MP3 jukebox

Fri Aug 16, 2019 5:28 pm

fruitbox wrote:
Fri Aug 16, 2019 10:56 am
Hi karrika

If you let me know exactly how you want the skin to behave I can create it for you

Cheers
Mike
Wow! That would be super!

The thing is that I have written a new game called "On Duty" for the Atari Lynx handheld console. For some strange reason I got a desire to visit Portland Retro Gaming Expo that is about 3000 miles from here. Obviously I was late and all the spots in the main hall are taken.

But they found a location for me. Probably under the stairs in a cupboard like Harry Potter.

So I started to think what I could do with a tiny table and a single chair. My spot is only half size compared to normal stands.

Image

My plan goes like this:
While I am sitting at the stand I let the Jukebox play music as it is supposed to do. It is merely an eye catcher.

But when I am away I grab with me the games and the Lynx and leave just the jukebox there. It would be nice to have a set of small video clips about the games I have available. These clips could be on auto play.

So I am merely looking at the same thing as a few posts back. Playing small video clips in the Wurly skin.

I have already ordered large letters for the USB mini keyboard (A..E, 0..9). And I have decided on what every button will do. Creating the fruitbox.btn was easy.

I am still waiting for the 10" monitor from ebay.

PS. I also messed with the dates. I wanted to land in Portland on 18th of October. So I booked my flight from Iceland on the 17th. But the Earth rotates! I land at Portland on exactly the same time I started from Iceland. On the 17th, not the 18th. I thought the Earth was flat ;)

Tuco
Posts: 10
Joined: Mon Aug 12, 2019 11:39 pm

Re: fruitbox MP3 jukebox

Fri Aug 16, 2019 10:26 pm

fruitbox wrote:
Fri Aug 16, 2019 1:02 pm
Tuco wrote:
Fri Aug 16, 2019 11:02 am

Hi Mike,

Happy with my mods to play video but as mentioned above when the video finishes it 'appears to freeze' for about 45 seconds before the removal of the record happens.
Other question is how is the album art displayed. So far one of my songs displayed album art (only tried a few songs)
Is that to do with the ID tag?

Michael. (Tuco)
Hi Michael

The delay could be caused by a combination of load and unload times as set in the skin config file. If you want to post your mods I could see for myself on my setup.

The album art is actually taken from the Cover Art ID tag data embedded in the MP3 file itself. If it doesn't contain any then fruitbox has different alternatives for displaying images (see the NowPlayingArtworkMode skin config parameter in the user guide).

Cheers
Mike
Hi Mike,
Going to make a big post but here's the mods I did to the Wurly skin for video to play between the song lists.
Like you said, it's probably just a built in delay somewhere in the cfg.
For others who want to do this you also has to copy song_video.txt from the MikeTV skin.

[general]
SkinName = Wurly
SkinDescription = by chundermike
SkinSize = 1920 1080
Database = ../fruitbox.db
MusicPath = /mnt/usb
SortSongsBy Title
SortSongsBy Artist
SelectButtons = ABCDE
SelectButtons = 1234
AutoSelect = Yes
SelectTimeout = 150
SelectHoldTimeout = 150
AutoPageTurnTime = 3000
MaxPlaylistLength = 20
LoopPlaylist = no
AutoPlay = yes
AutoPlayGap = 3000
PlaysPerCoin1 = 0
SongsPerPage = 2
PageSize = 400 100
SongHistoryDepth = 20

PairSongs = Dual
ArtistDescription = Artist
ArtistDescription = " / "
ArtistDescription = PairedArtist

PageMoveStyle = 20 5 yes
SongLoadTime = 580 # optimised for 50Hz display; if load video "skips", then adjust this value
SongUnloadTime = 350 # as above
ArtistText = 0 0 0 0 255 centre true true false 0 0 300
AlbumText = 0 0 0 0 255 center false false false 0 0 300
SongText = 0 200 0 0 255 center true true false 0 0 360

[font]
File = typewriter.ttf
Height = 25

[font]
File = hatten.ttf
Height = 50
[font]
File = dotmatrx.ttf
Height = 20

[page]
Position = 12 50
Angle = 0
Background = page_bkgnd.png
Movedelay = 10

[page]
Position = 1500 50
Angle = 0
Background = page_bkgnd.png
Movedelay = 4

[page]
Position = 12 160
Angle = 0
Background = page_bkgnd.png
Movedelay = 5

[page]
Position = 1500 160
Angle = 0
Background = page_bkgnd.png
Movedelay = 9

[page]
Position = 12 270
Angle = 0
Background = page_bkgnd.png
Movedelay = 7

[page]
Position = 1500 270
Angle = 359
Background = page_bkgnd.png
Movedelay = 1

[page]
Position = 12 385
Angle = 1
Background = page_bkgnd.png
Angle = 1
Background = page_bkgnd.png
Movedelay = 6

[page]
Position = 1500 385
Angle = 0
Background = page_bkgnd.png
Movedelay = 10

[page]
Position = 12 500
Angle = 0
Background = page_bkgnd.png
Movedelay = 2

[page]
Position = 1500 500
Angle = 0
Background = page_bkgnd.png
Movedelay = 3

[status]
position = 486 40
size = 940 580
contents = song_video.txt
TickerTickPeriod = 1

[status]
Video = load_song.ogv
LoopVideo = no
Position = 486 40
Size = 940 580
Contents = status_load.txt
TimerTickPeriod = 1

[status]
Video = unload_song.ogv
LoopVideo = no
Position = 486 40
Size = 940 580
Contents = status_unload.txt
TimerTickPeriod = 1

[status]
Position = 700 750
Size = 525 100
Text = 2 182 255 182 255 center false true false 0 0 520
Contents = status0.txt
TimerTickPeriod = 50
linespacing = 1

[status]
Position = 700 780
Size = 525 130
Text = 2 182 255 182 255 center false true false 0 0 520
Contents = status1.txt
LineSpacing = 1

[status]
Position = 360 800
Size = 190 260
Text = 1 64 192 64 255 center false false false 0 0
Contents = status2.txt

[status]
Position = 1365 800
Size = 190 260
Text = 1 64 192 64 255 center false false false 0 0
Contents = status3.txt
TimerTickPeriod = 150

[status]
Contents select_lights_off.txt
Bitmap = instructions-left-off.png
Size = 318 380
Position = 0 640

[status]
Contents select_lights_on.txt
Bitmap = instructions-left-01.png
Bitmap = instructions-left-02.png
Bitmap = instructions-left-03.png
Size = 318 380
Position = 0 640
TimerTickPeriod = 1

[status]
Contents coin_lights_off.txt
Bitmap = instructions-right-off.png
Size = 318 380
Position = 1615 640

[status]
Contents coin_lights_on.txt
Bitmap = instructions-right-01.png
Bitmap = instructions-right-02.png
Bitmap = instructions-right-03.png
Size = 318 380
Position = 1615 640
TimerTickPeriod = 1

[bitmap]
File = foreground.png
Position = 0 0
Size = 1920 1080

DA313
Posts: 16
Joined: Fri Jun 07, 2019 12:00 am
Location: United States, Georgia

Re: fruitbox MP3 jukebox

Tue Aug 20, 2019 2:20 am

Mike, is there some way to make it autodelete the fruitbox.db on reboot, or in the alternative, automatically add new songs to the existing file as they appear. I want to be able to insert a usb turn it on, and it know what is on the USB doesn't match the existing file.

Does this make sense?
"From this nettle, danger, we pluck this flower, safety." (Shakespeare, Henry IV)

User avatar
rpt007
Posts: 59
Joined: Sat Jan 21, 2017 8:03 am
Location: Germany

Re: fruitbox MP3 jukebox

Tue Aug 20, 2019 7:12 am

As Mike stated a few posts ago: this is on the feature list for the next release.
Pls be patient as he is doing this great job in his free time.

DA313
Posts: 16
Joined: Fri Jun 07, 2019 12:00 am
Location: United States, Georgia

Re: fruitbox MP3 jukebox

Wed Aug 21, 2019 1:05 am

rpt007 wrote:
Tue Aug 20, 2019 7:12 am
As Mike stated a few posts ago: this is on the feature list for the next release.
Pls be patient as he is doing this great job in his free time.
I'm sorry. I guess I missed that. Yes, he is doing an AWESOME job.
"From this nettle, danger, we pluck this flower, safety." (Shakespeare, Henry IV)

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

Re: fruitbox MP3 jukebox

Wed Aug 21, 2019 10:01 am

DA313 wrote:
Wed Aug 21, 2019 1:05 am
rpt007 wrote:
Tue Aug 20, 2019 7:12 am
As Mike stated a few posts ago: this is on the feature list for the next release.
Pls be patient as he is doing this great job in his free time.
I'm sorry. I guess I missed that. Yes, he is doing an AWESOME job.
No worries,

I've decided rather than create a new massive release with all the new stuff in, I'll add a few things at a time to keep the releases simpler and safer, and more frequent.

The next release will concentrate on simplifying the setup and configuration (so auto database update, button config via GUI, error and warnings via GUI, etc, that sort of stuff)

Cheers
Mike

wyovino
Posts: 1
Joined: Wed Aug 28, 2019 3:55 pm

Re: fruitbox MP3 jukebox

Wed Aug 28, 2019 4:14 pm

Hi Mike,

I just started playing around with Raspberry Pi a few weeks ago and found FruitBox. Thanks for creating this software that is so richly configurable. I'm having a lot of fun with it and have been working on a new skin that is based on your Wurly skin. My plan is to build a retro-looking cabinet with flashing LED lights and a nice sound system. At this point I think I'm going to use a second RPi or two for the lighting effects. I was also trying to get it to play via bluetooth and while I did get it to work, the sound quality was terrible. After searching online, it seems that bluetooth and Wifi interfere with each other on the RPi 3B+. This was mostly an academic exercise and is not a showstopper.

One tip I have that might help someone. When I first loaded my mp3s and created the database, I noticed that some songs were not displaying any meta data even though it was there. After trying a number of different things, my old brain cells fired up and I remembered having a similar problem with mp3s on my car stereo. While editing the file properties on a Windows PC, I noticed that the songs that displayed properly had nothing in the "Comments" field and the ones that didn't display did have something there. Removing the comments made the meta data appear.

Again, thanks so much for your efforts. This is a lot of fun and it's helping me learn Linux at the same time. Win-win.

PS. I just noticed a typo in the Granite skin "now_playing.txt" file:

$IF_SONG_NOT_PLAYING$IF_SONG_NOT_LOADING
should be
$IF_NOT_SONG_PLAYING$IF_NOT_SONG_LOADING$

Bill

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

Re: fruitbox MP3 jukebox

Thu Aug 29, 2019 10:49 pm

Hi Bill

Glad you're having fun with fruitbox... am keen to see your new skin when it's done!

Thanks for the tip about the mp3 comment field...very interesting; I'll make sure a note is added to the user guide in the next release.

And also thanks for pointing out the mistake in the Granite skin... which I've now corrected on GitHub.

Cheers
Mike

sunflowertje
Posts: 1
Joined: Mon Sep 02, 2019 4:03 pm

Re: fruitbox MP3 jukebox

Mon Sep 02, 2019 4:07 pm

Just an answer to an old question as I spend some time answering this.....

If you want to use fruitbox without a monitor cq display you have to change the file /boot/config.txt

I used this:

hdmi_force_hotplug=1
hdmi_drive=2

This lets fruitbox think there is a monitor.

Greetz

Wim Blanken

Andrey Threat wrote:
Tue Oct 23, 2018 12:32 pm
Hi Mike!
I was finally able to finish my jukebox project. Took me sometime to design a hardware to make original buttons and coin holder work with rpi.

IMG_0442.JPG

But now I'm in dead end, so maybe you have some ideas.
So I've been running it headless obviously. And after a while, it just stops working. I would drop the coin, it will activate buttons, but nothing happens on rpi side.
But I'm still able to ssh, so I know raspbian is up running.

On the other side, when I have hdmi monitor connected, this never happens. I was hoping I will be able to see on the monitor what's going on.
So there is definitely something happening when hdmi signal is on.
What I tried to do, was to set up monitor blank and powerdown to 0. I feel like it helped a little bit, because now when I'm testing during the day it wont stop working. But when I came back to it this morning (it's been running all night) it's not working again.

I'm out of ideas. My only option now is to get a small monitor, and lock it inside the cabinet.

Maybe you or anybody else had similar problem?
Thanks.

bradsorph
Posts: 7
Joined: Thu Jan 17, 2019 8:28 pm

Re: fruitbox MP3 jukebox

Sat Sep 07, 2019 1:23 pm

rpt007 wrote:
Tue May 14, 2019 8:11 pm
.. could you pls tell us, where you purchased the alphanumeric keys. They look very „jukebox authentic“.
I bought the buttons on line searching for "rectangular arcade button", the alphanumeric labels have been printed using laser printer on transparent sticker paper (also bought on line).

User avatar
rpt007
Posts: 59
Joined: Sat Jan 21, 2017 8:03 am
Location: Germany

Re: fruitbox MP3 jukebox

Sat Sep 07, 2019 7:56 pm

Thanks @bradsorph,

will get me some; wasn't sure that they could be opened and modified, but I know from another answer that it is possibe and I will give it a try, as it seems to be worth the effort looking at your final result - awesome!

Raimund

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

Re: fruitbox MP3 jukebox

Thu Sep 12, 2019 11:00 pm

Tuco wrote:
Fri Aug 16, 2019 10:26 pm
Hi Mike,
Going to make a big post but here's the mods I did to the Wurly skin for video to play between the song lists.
Like you said, it's probably just a built in delay somewhere in the cfg.
For others who want to do this you also has to copy song_video.txt from the MikeTV skin.
Thanks for pointing me in the right way. I added just the video for files with video content. The normal records don't show covers but play the original rotating disks bitmaps.

Mike just approved my pull request. So now we have a new skin WurlyVideo
Enjoy!
Image

Tuco
Posts: 10
Joined: Mon Aug 12, 2019 11:39 pm

Re: fruitbox MP3 jukebox

Tue Sep 24, 2019 11:18 pm

karrika wrote:
Thu Sep 12, 2019 11:00 pm
Tuco wrote:
Fri Aug 16, 2019 10:26 pm
Hi Mike,
Going to make a big post but here's the mods I did to the Wurly skin for video to play between the song lists.
Like you said, it's probably just a built in delay somewhere in the cfg.
For others who want to do this you also has to copy song_video.txt from the MikeTV skin.
Thanks for pointing me in the right way. I added just the video for files with video content. The normal records don't show covers but play the original rotating disks bitmaps.

Mike just approved my pull request. So now we have a new skin WurlyVideo
Enjoy!
Image
Karrika,
I have made further mods to the original Wurly modded code I posted. I've done away with the record pick up / removal (as I find it an unnecessary delay) and I've also removed the delay between songs. Mine also displays the album artwork instead of the rotating disk bitmaps.

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

Re: fruitbox MP3 jukebox

Wed Sep 25, 2019 5:30 am

Tuco wrote:
Tue Sep 24, 2019 11:18 pm
karrika wrote:
Thu Sep 12, 2019 11:00 pm
Tuco wrote:
Fri Aug 16, 2019 10:26 pm
Hi Mike,
Going to make a big post but here's the mods I did to the Wurly skin for video to play between the song lists.
Like you said, it's probably just a built in delay somewhere in the cfg.
For others who want to do this you also has to copy song_video.txt from the MikeTV skin.
Thanks for pointing me in the right way. I added just the video for files with video content. The normal records don't show covers but play the original rotating disks bitmaps.

Mike just approved my pull request. So now we have a new skin WurlyVideo
Enjoy!
Image
Karrika,
I have made further mods to the original Wurly modded code I posted. I've done away with the record pick up / removal (as I find it an unnecessary delay) and I've also removed the delay between songs. Mine also displays the album artwork instead of the rotating disk bitmaps.
Well, I wanted to see the record pickup and I did not want to ser album art. In any case I am happy with my version and you are happy with yours. This is the great thing about Open Source win-win!

Tasoulios
Posts: 3
Joined: Thu Sep 26, 2019 11:57 am

Re: fruitbox MP3 jukebox

Thu Sep 26, 2019 12:04 pm

Hi, new to these forums, the reason i registered is because i can't find a solution to my problem in fruitbox.

Everything works fine but my issue is that i can't use songs using my native language (Greek).

The song names do appear in Greek on the graphical elements like the spinning tabs of the jukebox but they look like gibberish in the play list.

I don't know what else i have to do, the operating system seems to recognize Greek characters as i can write in Greek. So i don't know what else to do to make the songs appear properly in the playlist. This issue pretty much defeats the purpose of using this awesome program in my case which sucks.

Anyway, any help would be appreciated.

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

Re: fruitbox MP3 jukebox

Thu Sep 26, 2019 5:00 pm

Tasoulios wrote:
Thu Sep 26, 2019 12:04 pm
Hi, new to these forums, the reason i registered is because i can't find a solution to my problem in fruitbox.

Everything works fine but my issue is that i can't use songs using my native language (Greek).

The song names do appear in Greek on the graphical elements like the spinning tabs of the jukebox but they look like gibberish in the play list.

I don't know what else i have to do, the operating system seems to recognize Greek characters as i can write in Greek. So i don't know what else to do to make the songs appear properly in the playlist. This issue pretty much defeats the purpose of using this awesome program in my case which sucks.

Anyway, any help would be appreciated.
Hi

Maybe something to do with the fonts? Depending on which skin you are using, the fonts for the spinning tabs (pages) may be different to the fonts for the play list (status object). Try modifying the skin config file to change which fonts are used.

Also, could you send a screenshot?

Cheers
Mike

Tasoulios
Posts: 3
Joined: Thu Sep 26, 2019 11:57 am

Re: fruitbox MP3 jukebox

Fri Sep 27, 2019 6:57 am

fruitbox wrote:
Thu Sep 26, 2019 5:00 pm
Tasoulios wrote:
Thu Sep 26, 2019 12:04 pm
Hi, new to these forums, the reason i registered is because i can't find a solution to my problem in fruitbox.

Everything works fine but my issue is that i can't use songs using my native language (Greek).

The song names do appear in Greek on the graphical elements like the spinning tabs of the jukebox but they look like gibberish in the play list.

I don't know what else i have to do, the operating system seems to recognize Greek characters as i can write in Greek. So i don't know what else to do to make the songs appear properly in the playlist. This issue pretty much defeats the purpose of using this awesome program in my case which sucks.

Anyway, any help would be appreciated.
Hi

Maybe something to do with the fonts? Depending on which skin you are using, the fonts for the spinning tabs (pages) may be different to the fonts for the play list (status object). Try modifying the skin config file to change which fonts are used.

Also, could you send a screenshot?

Cheers
Mike
Thanks for the response.

Here's a screenshot

Image

You can see on the tabs above, at D1, the song is correct. But in the playlist it's a bunch of boxes. Using the Wurly skin, though not sure how to edit it for the fonds.

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

Re: fruitbox MP3 jukebox

Fri Sep 27, 2019 8:26 am

Tasoulios wrote:
Fri Sep 27, 2019 6:57 am

Image

You can see on the tabs above, at D1, the song is correct. But in the playlist it's a bunch of boxes. Using the Wurly skin, though not sure how to edit it for the fonds.
Hi

Yes, it looks like the font used for the "now playing" status doesn't include Greek characters. To change the font for this status, you need to edit skins/Wurly/fruitbox.cfg. The "now playing" status is provided by the status object on line 168 of this file. The font is specified by the first parameter of the "Text" entry on line 171. Currently it is set to 2 which references the third defined font in the file (line 45, dotmatrix font). For a quick test, you can change the 2 on line 171 to a zero, to reference the first defined font (line 37, typewriter). Or you could change the ttf filename on line 46 to any font you like (but remember to put the ttf file in the same directory). Note also that the dotmatrix font is also used for the "coming up" status (status1) so you will also need to change the font for that if you are just changing the Text number rather than ttf file for font 2.

Going forward, if you want to change all the English words in the skin to Greek, you will need to edit the status text files manually (the files referenced by the "Contents = " entries in each [status] section in fruitbox.cfg), making sure you don't change any of the predefined variables starting with "$" (see user guide section 7.2). Also note that some of the English words are not coded into the status files, but are actually part of the graphic files (e.g. instructions-left-01.png), so you will need to modify these in a graphics editor.

Cheers
Mike

Tasoulios
Posts: 3
Joined: Thu Sep 26, 2019 11:57 am

Re: fruitbox MP3 jukebox

Fri Sep 27, 2019 11:11 am

fruitbox wrote:
Fri Sep 27, 2019 8:26 am
Tasoulios wrote:
Fri Sep 27, 2019 6:57 am

Image

You can see on the tabs above, at D1, the song is correct. But in the playlist it's a bunch of boxes. Using the Wurly skin, though not sure how to edit it for the fonds.
Hi

Yes, it looks like the font used for the "now playing" status doesn't include Greek characters. To change the font for this status, you need to edit skins/Wurly/fruitbox.cfg. The "now playing" status is provided by the status object on line 168 of this file. The font is specified by the first parameter of the "Text" entry on line 171. Currently it is set to 2 which references the third defined font in the file (line 45, dotmatrix font). For a quick test, you can change the 2 on line 171 to a zero, to reference the first defined font (line 37, typewriter). Or you could change the ttf filename on line 46 to any font you like (but remember to put the ttf file in the same directory). Note also that the dotmatrix font is also used for the "coming up" status (status1) so you will also need to change the font for that if you are just changing the Text number rather than ttf file for font 2.

Going forward, if you want to change all the English words in the skin to Greek, you will need to edit the status text files manually (the files referenced by the "Contents = " entries in each [status] section in fruitbox.cfg), making sure you don't change any of the predefined variables starting with "$" (see user guide section 7.2). Also note that some of the English words are not coded into the status files, but are actually part of the graphic files (e.g. instructions-left-01.png), so you will need to modify these in a graphics editor.

Cheers
Mike
Thanks a lot for the response. Right now i'm away but tomorrow i will give it a shot and report here.

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

Re: fruitbox MP3 jukebox

Fri Sep 27, 2019 11:27 am

Just a small note. For fun I compiled fruitbox on my desktop Ubuntu 18.04.3 LTS (Bionic Beaver).

As it has fairly a fairly modern set of libraries I compiled it againsta dynamic libraries.

I also found out that compiling for Pi4 using Buster had some library conflicts. Perhaps this Makefile could help someone in case of library problems.

Code: Select all

diff --git a/build/Makefile b/build/Makefile
index 1b9ffb0..b56e084 100644
--- a/build/Makefile
+++ b/build/Makefile
@@ -1,10 +1,10 @@
 CPP         = g++
-CFLAGS      = -O2 -std=c++14 -D_RPI
+CFLAGS      = -O2 -std=c++14
 INC         = -I/opt/vc/include
 DEPS        = fruitbox.hpp fruitbox_types.hpp pages.hpp status.hpp playqueue.hpp audio.hpp config.hpp config_base.hpp database.hpp display.hpp \
               engine.hpp fruitbox_logo.hpp info_bkgnd.hpp chooser_arrow.hpp info_font.hpp status_events.hpp userguide.hpp bitmap.hpp joystick.hpp display_base.hpp input.hpp
 OBJ         = fruitbox.o playqueue.o audio.o config.o database.o display.o engine.o pages.o status.o userguide.o bitmap.o joystick.o input.o
-LIBS        = -lmpg123 -lm -ldl -L/opt/vc/lib/
+LIBS        = -lmpg123 -lm -ldl -lallegro -lallegro_memfile -lallegro_font -lallegro_ttf -lallegro_audio -lallegro_image -lallegro_video -lallegro_primitives -lallegro_acodec -lpthread
 STATIC_LIBS = allegro-static-5 allegro_memfile-static-5 allegro_font-static-5 allegro_ttf-static-5 allegro_primitives-static-5 \
               allegro_image-static-5 allegro_audio-static-5 allegro_acodec-static-5 allegro_video-static-5
 
@@ -13,7 +13,9 @@ STATIC_LIBS = allegro-static-5 allegro_memfile-static-5 allegro_font-static-5 al
 
 # ./fruitbox: $(OBJ)
 ./fruitbox: $(OBJ)
-       $(CPP) -Wall -o [email protected] $^ $(CFLAGS) $(LIBS) `pkg-config --libs --static $(STATIC_LIBS)`
+       $(CPP) -Wall -o [email protected] $^ $(CFLAGS) $(LIBS)
+
+#$(CPP) -Wall -o [email protected] $^ $(CFLAGS) $(LIBS) `pkg-config --libs --static $(STATIC_LIBS)`
 
 .PHONY: clean
 clean:

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

Re: fruitbox MP3 jukebox

Fri Sep 27, 2019 1:12 pm

karrika wrote:
Fri Sep 27, 2019 11:27 am
Just a small note. For fun I compiled fruitbox on my desktop Ubuntu 18.04.3 LTS (Bionic Beaver).

As it has fairly a fairly modern set of libraries I compiled it againsta dynamic libraries.

I also found out that compiling for Pi4 using Buster had some library conflicts. Perhaps this Makefile could help someone in case of library problems.

Code: Select all

diff --git a/build/Makefile b/build/Makefile
index 1b9ffb0..b56e084 100644
--- a/build/Makefile
+++ b/build/Makefile
@@ -1,10 +1,10 @@
 CPP         = g++
-CFLAGS      = -O2 -std=c++14 -D_RPI
+CFLAGS      = -O2 -std=c++14
 INC         = -I/opt/vc/include
 DEPS        = fruitbox.hpp fruitbox_types.hpp pages.hpp status.hpp playqueue.hpp audio.hpp config.hpp config_base.hpp database.hpp display.hpp \
               engine.hpp fruitbox_logo.hpp info_bkgnd.hpp chooser_arrow.hpp info_font.hpp status_events.hpp userguide.hpp bitmap.hpp joystick.hpp display_base.hpp input.hpp
 OBJ         = fruitbox.o playqueue.o audio.o config.o database.o display.o engine.o pages.o status.o userguide.o bitmap.o joystick.o input.o
-LIBS        = -lmpg123 -lm -ldl -L/opt/vc/lib/
+LIBS        = -lmpg123 -lm -ldl -lallegro -lallegro_memfile -lallegro_font -lallegro_ttf -lallegro_audio -lallegro_image -lallegro_video -lallegro_primitives -lallegro_acodec -lpthread
 STATIC_LIBS = allegro-static-5 allegro_memfile-static-5 allegro_font-static-5 allegro_ttf-static-5 allegro_primitives-static-5 \
               allegro_image-static-5 allegro_audio-static-5 allegro_acodec-static-5 allegro_video-static-5
 
@@ -13,7 +13,9 @@ STATIC_LIBS = allegro-static-5 allegro_memfile-static-5 allegro_font-static-5 al
 
 # ./fruitbox: $(OBJ)
 ./fruitbox: $(OBJ)
-       $(CPP) -Wall -o [email protected] $^ $(CFLAGS) $(LIBS) `pkg-config --libs --static $(STATIC_LIBS)`
+       $(CPP) -Wall -o [email protected] $^ $(CFLAGS) $(LIBS)
+
+#$(CPP) -Wall -o [email protected] $^ $(CFLAGS) $(LIBS) `pkg-config --libs --static $(STATIC_LIBS)`
 
 .PHONY: clean
 clean:
Thanks for these hints. If you are targeting for the Pi you'll need to keep the -D_RPI switch otherwise you'll omit GPIO support. Apart from that, it should compile for Ubuntu with no issues (that's what I do for the majority of the development work).

When I get my hands on a Pi4 I'll make sure I do the necessary build script changes for that.

Cheers
Mike

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

Re: fruitbox MP3 jukebox

Wed Oct 02, 2019 6:57 am

karrika wrote:
Fri Sep 27, 2019 11:27 am

I also found out that compiling for Pi4 using Buster had some library conflicts. Perhaps this Makefile could help someone in case of library problems.
Hi Karrika

You mentioned that you compiled fruitbox for the Pi4... did it actually run ok? There's a GitHub discussion issue going on which suggests fruitbox doesn't work on the Pi4 (Allegro can't create the display). Can you confirm this, as I haven't got a Pi4 to check.

Cheers
Mike

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

Re: fruitbox MP3 jukebox

Wed Oct 02, 2019 3:47 pm

The Pi4 does not create the display. But this is due to some x+++ library conflict that works with an older version but not the new version that is used in Buster.

As it compiles on my laptop running Bionic Ubuntu I thought that this should not be hard to fix. Due to too little time I created my jukebox using a Pi3A instead running stretch. My event where I need the Jukebox starts in 2 weeks in Oregon, US.

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

Re: fruitbox MP3 jukebox

Thu Oct 03, 2019 9:07 pm

I just updated the sw on my Pi4 and compiled rpi-fruitbox. I did not use static libs or the mpg123 and allegro tar files mentioned in the build directory.

The only complaint was that library pthread was not explicitely mentioned so I added it at the end of the linker list.

The gpio.cpp could not find the base address so I entered 0xFE000000.

The application compiles. The spinning logo is there. the database builds the list of tunes. And after that I got a segfault. It could by an error in my base address for GPIO.

Code: Select all

Initialising audio ...
Loading database '../fruitbox.db'...
60 songs found
Sorting songs by Title...
Sorting songs by Artist...
Building song pages...
[New Thread 0xa655b060 (LWP 952)]

Thread 1 "fruitbox" received signal SIGSEGV, Segmentation fault.
0x00014bd8 in std::unique_lock<std::mutex>::unlock() [clone .isra.28] ()
(gdb) bt
#0  0x00014bd8 in std::unique_lock<std::mutex>::unlock() [clone .isra.28] ()
#1  0x00095dbc in StatusDisplayClass::update(unsigned int) ()
#2  0x000978a4 in StatusDisplayClass::init(uints2_t, unsigned int) ()
#3  0x000750f4 in ConfigClass::PostProcess() ()
#4  0x0001b510 in main ()
(gdb) 

rubenp
Posts: 1
Joined: Fri Oct 04, 2019 6:58 pm

Re: fruitbox MP3 jukebox

Fri Oct 04, 2019 7:02 pm

Hi Karrika,

looks like you already got further than i could, mine does compile but only with the original MakeFile. Could you share your version of the makefile?

Return to “Graphics, sound and multimedia”