Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    15

    Success: MusicIP and Spicefly Sugarcube running on Raspberry Pi

    I managed to get MusicIP (headless), sugarcube, and the MusicIP plugin on raspberry pi LMS working with the help of Qemu. This is a inexpensive and simple setup without requiring an intel processor architecture.

    For my 25k track collections, a new mix keeps one core of the raspberry pi 2 busy for approximately 10 seconds, while LMS continues to play in the background.
    Basically all is working so far. I have not tested validation of music, as all my tracks have been validated and fingerprints archived using the Windows version of MusicIP. Scanning / adding 25k tracks to MusicIP takes approximately 30 minutes
    High Level tutorial (I used a Max2Play installation of LMS):


    Download and unpack MusicIP 1.8 for linux (http://www.spicefly.com/article.php?...sicip-software)


    You have to edit your /etc/apt/sources.list file and every file in /etc/apt/sources.list.d, adding [arch=armhf] behind each occurence of deb.
    So for example the line
    deb http://archive.raspbian.org/raspbian jessie main contrib non-free
    would become
    deb [arch=armhf] http://archive.raspbian.org/raspbian jessie main contrib non-free

    For the Max2Play installation, following two files had to be modified:
    sudo nano /etc/apt/sources.list
    sudo nano /etc/apt/sources.list.d/raspi.list


    Next, we have to add package sources for i386 packages to our apt configuration. We'll do it the obvious way and take the official Debian repositories.
    Of course you are free to choose other mirrors, if you prefer.
    To do that, you create the file /etc/apt/sources.list.d/i386.list via sudo nano /etc/apt/sources.list.d/i386.list and insert the following:

    deb [arch=i386] http://ftp.debian.org/debian/ jessie main contrib non-free
    deb [arch=i386] http://ftp.debian.org/debian/ jessie-updates main contrib non-free
    deb [arch=i386] http://security.debian.org/ jessie/updates main contrib non-free


    Then add the i386 architecture and update packages:
    sudo dpkg --add-architecture i386
    sudo apt-get update



    Install binfmt, qemu and libc for i386:
    sudo apt-get install binfmt-support qemu-user
    sudo apt-get install libc6:i386

    Ignore warnings about certificates


    You can start the MusicMagic server (in my case installed in the pi home-directory):
    sudo /home/pi/MusicIP/MusicMagicMixer/MusicMagicServer start
    It should be accessible viahttp://localhost:10002/server

    ignore warnings about ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored, the server runs anyway.


    To start the sever everytime when the raspberry boots:
    sudo cp /home/pi/MusicIP/MusicMagicMixer/mmserver /etc/init.d
    cd /etc/init.d
    sudo nano mmserver

    Edit the file and add the header for the init daemon, adapt the pathes. My version looks like:


    ------------
    #! /bin/sh

    ### BEGIN INIT INFO
    # Provides: mmserver
    # Required-Start: $remote_fs $syslog
    # Required-Stop: $remote_fs $syslog
    # Default-Start: 2 3 4 5
    # Default-Stop: 0 1 6
    # Short-Description: Start MusicIP daemon at boot time
    # Description: Enable service provided by daemon.
    ### END INIT INFO



    # NON-PRIVIELEGED USER TO RUN MUSICMAGICSERVER.
    USER=pi
    # PATH TO THE MUSICMAGICMIXERSERVER
    export MUSICHOME=/home/pi/MusicIP/MusicMagicMixer/
    case $1 in
    start)
    # next line was original
    # su - $USER -c $MUSICHOME"MusicMagicServer start & > /dev/null"
    sudo -u pi /home/pi/MusicIP/MusicMagicMixer/MusicMagicServer start & > /dev/null 2>&1
    echo "Running MusicMagicServer"
    exit
    ;;
    stop)
    # next line was original
    # su - $USER -c $MUSICHOME"MusicMagicServer stop & > /dev/null"
    sudo -u pi /home/pi/MusicIP/MusicMagicMixer/MusicMagicServer stop & > /dev/null 2>&1
    echo "Stopped MusicMagicServer"
    exit
    ;;
    *)
    echo "Usage: /etc/rc.d/init.d/mmserver { start | stop }"
    exit
    ;;
    esac


    --------



    Then register the start script and reboot:
    sudo update-rc.d mmserver defaults
    sudo reboot


    The MusicIP plugin should run out of the box (may require restart of LMS to recognize the MusicIP server in case LMS is started to early).



    Spicefly Sugarcube requires some modifications to prevent timeouts (maybe C Parker can create a new version with these extended timeouts included):

    Modifications in plugin.pm (line number for version 4.75 of sugarcube):

    Original Plugin.pm line 666:
    my$http=Slim::Networking::SimpleAsyncHTTP->new(\&ScalarLoop,\&gotErrorViaHTTP,{caller=>'Spic efly',callerProc=>\&ArrayLoop,client=>$client});


    New modified line 666:
    my$http=Slim::Networking::SimpleAsyncHTTP->new(\&ScalarLoop,\&gotErrorViaHTTP,{caller=>'Spic efly',callerProc=>\&ArrayLoop,client=>$client,time out=>60});

    Original line 887:
    if($sugarcube_activefilter eq '0'||$sugarcube_activefilter eq '(None)'){$log->debug("Genre Filter is not set\n");}else{$mypageurl=($mypageurl.'&filter='.$s ugarcube_activefilter);}}my$http=Slim::Networking: :SimpleAsyncHTTP->new(\&ScalarLoop,\&gotErrorViaHTTP,{caller=>'Spic eflyAutoMix',callerProc=>\&AutoStartMix,client=>$c lient});

    New line 887:
    if($sugarcube_activefilter eq '0'||$sugarcube_activefilter eq '(None)'){$log->debug("Genre Filter is not set\n");}else{$mypageurl=($mypageurl.'&filter='.$s ugarcube_activefilter);}}my$http=Slim::Networking: :SimpleAsyncHTTP->new(\&ScalarLoop,\&gotErrorViaHTTP,{caller=>'Spic eflyAutoMix',callerProc=>\&AutoStartMix,client=>$c lient,timeout=>60});

    original line 925:
    my$http=Slim::Networking::SimpleAsyncHTTP->new(\&ScalarLoop,\&gotErrorViaHTTP,{caller=>'Spic eflyAlarm',callerProc=>\&AlarmFired,client=>$clien t});

    New line 925:
    my$http=Slim::Networking::SimpleAsyncHTTP->new(\&ScalarLoop,\&gotErrorViaHTTP,{caller=>'Spic eflyAlarm',callerProc=>\&AlarmFired,client=>$clien t,timeout=>60});

    Old 166:
    my$http=Slim::Networking::SimpleAsyncHTTP->new(\&ScalarLoop,\&gotErrorViaHTTP,{caller=>'Spic eflyONE',callerProc=>\&sc_one_off,client=>$client} );

    New 166:
    my$http=Slim::Networking::SimpleAsyncHTTP->new(\&ScalarLoop,\&gotErrorViaHTTP,{caller=>'Spic eflyONE',callerProc=>\&sc_one_off,client=>$client, timeout=>60});





    Restart LMS and Sugarcube should be running.
    Last edited by frankd; 2017-02-11 at 13:56.

  2. #2
    Senior Member cparker's Avatar
    Join Date
    Oct 2005
    Location
    Hampshire, United Kingdom
    Posts
    583

    SugarCube 4.80 Test Release

    Hi Frankd,

    Very interesting work that you are doing with the Pi. I've added your proposed changes into a test release here;

    http://www.spicefly.com/media/scube4x/beta480.xml

    If you get a chance would be helpful if you could test this on your setup and let me know if it's working ok. I'll then add a GUI element to enable fine tuning of the timeout value, similar to the SQL timeouts.

    Cheers

    (Note: This contains new code to, Fade Volume on Track Transition however this isn't fully working on clients in a sync group, so shouldn't be considered fully stable)
    www.spicefly.com - ** Spicefly SugarCube ** - A hassle free acoustic journey through your music library using MusicIP. Plus the finest MusicIP installation guides, enhanced MIP Interface and SpyGlass MIP the Windows Automated MusicIP Headless Installer.

  3. #3
    Junior Member
    Join Date
    Jan 2012
    Posts
    15
    Quote Originally Posted by cparker View Post
    Hi Frankd,

    Very interesting work that you are doing with the Pi. I've added your proposed changes into a test release here;

    http://www.spicefly.com/media/scube4x/beta480.xml

    If you get a chance would be helpful if you could test this on your setup and let me know if it's working ok. I'll then add a GUI element to enable fine tuning of the timeout value, similar to the SQL timeouts.

    Cheers

    (Note: This contains new code to, Fade Volume on Track Transition however this isn't fully working on clients in a sync group, so shouldn't be considered fully stable)

    HI CParker,
    excellent, all is working on my setup so far - this was an incredibly fast response!
    Being able to run all important plugins and addons on Raspberry (musicIP was the last missing for me) makes LMS a lot more future proof in my eyes.

    In case you are looking for some ideas for improving the plugin:
    I typically do not use the web-interface for operating my music system, I use either the radio / touch interface or the Squeezecontroller app. Therefore a dropdown list for selecting MIP Genre, MIP Artist and Music IP Receipe similar to the already available MIP Filter would be great (under settings, spicefly sugarcube). Currently you can select Genre, Artist and Filter as Mixtype, however Genre and Artist are of limited value for me as I cannot select my desired genre or artist in this interface (unless I walk to my PC and adapt settings there). I would be happy to beta-test any future versions.

    Cheers,
    Frank


    BTW.: Filters, receipes and moods are also working on the Raspberry headless setup, will post more info later.
    Last edited by frankd; 2017-02-13 at 14:38.

  4. #4
    Member srasher's Avatar
    Join Date
    Jun 2006
    Location
    Bochum, Germany
    Posts
    77
    Frank,

    this is absolutely fantastic news! I was about to experiment with installing the x86 version of MusicIP with ExaGear, but your howto looks so well documented and promising that I will try to reproduce this on my Odroid U3, most probably on the upcoming weekend.

    Thanks a lot for describing your trial so detailed.

    Cheers,
    Seb
    "The only word I know is 'Grunt' - and I can't spell it" (R.I.P. D.A.)

  5. #5
    Member
    Join Date
    Jan 2008
    Location
    Netherlands
    Posts
    48
    Hi Frankd,

    Great work, i'm using a wandboard quad for LMS now for a couple of years and the only thing what was missing was MusciIP, well a sort of missing it was en is running on a qnap nas and redirected to the wandboard with xinetd this setup works reasonably well but this is even better.
    Only the boot script was not working on the wandboard the headers for the init daemon i had to change from,
    Code:
    # Required-Start: $remote_fs $syslog
    # Required-Stop: $remote_fs $syslog
    to
    Code:
    # Required-Start:    $local_fs $network
    # Required-Stop:     $local_fs
    to make it work.
    Filters are working also and now all i need is a way to make receipes and moods get recognized.
    In all a very good job, thank you for your work.

    Greetings,

    Henk

  6. #6
    Junior Member
    Join Date
    Jan 2012
    Posts
    15

    recipes and filters

    Hi all,
    recipes are working pretty straightforward:

    Copy recipes.xml (I use the one which came with the windows MusicIp installation) into the home-directory of MusicIP (not the installation directory), where also your default.m3lib resides. For the raspberry: If the musicip server is started by the Pi user, it will be at/home/usr/pi/.MusicMagic/
    Restart the MusicIP server and LMS server and you should be able to select the recipes in the Sugarcube plugin.

    Filters are best added and edited by opening default.m3lib with the Windows version of MuisicIP. You need to use version 1.8, not the 1.9 beta, as the 1.9 saves your database in a format which is not readable by the 1.8 versions. Best is to add / modify only the filters and do not change anything concerning your music files as your windows version might refer to a different path structure and thus screws up the references to your music files.

    Moods need some more adaptations, I will test more during the weekend and post afterwards the results.

    Cheers,
    Frank

  7. #7
    Member
    Join Date
    Jul 2010
    Location
    Paris, France
    Posts
    86

    Amazing ! ( and a few questions)

    Hi Frank,
    This is fantastic ! It's also what I was missing to completely move my LMS to my raspberry.
    I was also thinking about exagear, but since they don't give keys for testing purposes, I was a bit reluctant to buy it without knowing if it works or not.

    I have a few questions because I don't really understand how it works :
    - Is Max2play necessary ? I use only my raspberry as a server and not as a player
    - At what moment is Qemu used ? I see that the packages are installed but I don't see the "emulation" part

    BTW, I have around 20k tracks and a PI3, that should run fine.
    Thanks a lot
    Antonio
    Last edited by Antoniop; 2017-02-16 at 07:40.
    LMS 7.9.0 - 1436071638
    on Linux Mageia 5
    1 SB3, 1 radio, 1 touch
    Plugins : Trackstat, IR Blaster, Smartmix, MusicIP, ...

  8. #8
    Junior Member
    Join Date
    Jan 2012
    Posts
    15
    Quote Originally Posted by Antoniop View Post
    Hi Frank,
    This is fantastic ! It's also what I was missing to completely move my LMS to my raspberry.
    I was also thinking about exagear, but since they don't give keys for testing purposes, I was a bit reluctant to buy it without knowing if it works or not.

    I have a few questions because I don't really understand how it works :
    - Is Max2play necessary ? I use only my raspberry as a server and not as a player
    - At what moment is Qemu used ? I see that the packages are installed but I don't see the "emulation" part

    BTW, I have around 20k tracks and a PI3, that should run fine.
    Thanks a lot
    Antonio

    Hi Antonio,
    I was similarly concerned about using Exagear, in particular as it is not open source and thus the future might be unpredictable... That thought triggered my investigation for other options....
    .
    The trick why you do not see the reference to Quemu is the installation of the binfmt package. This package allows you to start binaries compiled for different architectures without explicitly starting an emulator, it will call the emlator of choice if required....

    For your other question: No you do not need Max2Play for running MusicIP under your raspberry setup. You might need to adapt some details to your personal setup / operating system, however the principles I described should be the same. I assume the setup which Henk describes is a completely different one (different hardware, different operating system, but he still made it work with few adaptions to the startup script). As long as you operate under a Debian derived operating system (e.g. Raspian) you should be fine...

    For everybody reading this thread:
    Success stories, failures or lessons learnt are appreciated in this thread as this should be a guidance for more setups, and it should help the community to prevent investing in unnecessary hardware and software.
    Best,
    Frank

  9. #9
    Member
    Join Date
    Jul 2010
    Location
    Paris, France
    Posts
    86
    Quote Originally Posted by frankd View Post
    Hi Antonio,
    I was similarly concerned about using Exagear, in particular as it is not open source and thus the future might be unpredictable... That thought triggered my investigation for other options....
    .
    The trick why you do not see the reference to Quemu is the installation of the binfmt package. This package allows you to start binaries compiled for different architectures without explicitly starting an emulator, it will call the emlator of choice if required....

    For your other question: No you do not need Max2Play for running MusicIP under your raspberry setup. You might need to adapt some details to your personal setup / operating system, however the principles I described should be the same. I assume the setup which Henk describes is a completely different one (different hardware, different operating system, but he still made it work with few adaptions to the startup script). As long as you operate under a Debian derived operating system (e.g. Raspian) you should be fine...

    For everybody reading this thread:
    Success stories, failures or lessons learnt are appreciated in this thread as this should be a guidance for more setups, and it should help the community to prevent investing in unnecessary hardware and software.
    Best,
    Frank
    Ok, thanks a lot. I will give you my feedback once I installed it.
    Congratulations for your work, it's very good.
    LMS 7.9.0 - 1436071638
    on Linux Mageia 5
    1 SB3, 1 radio, 1 touch
    Plugins : Trackstat, IR Blaster, Smartmix, MusicIP, ...

  10. #10
    Member
    Join Date
    Jul 2010
    Location
    Paris, France
    Posts
    86
    I did the steps for MusicIp installation only (not Spicefly at the moment) and it's apparently working well, I can have Musicip mixes, but I have a few problems with LMS, I don't know if it's related with MusicIP: it seems slower than before and the scanning crashes during the artist picture lookup. I restarted LMS and had the same. Then I stopped the mm server and ran a new scan. It finished normally.
    Are you having the same problem ? do you thing it's related with the MusicIp server ? I also have some problems with the dynamic playlist plugin http://forums.slimdevices.com/showth...aylists-on-RPi.
    Thanks a lot
    LMS 7.9.0 - 1436071638
    on Linux Mageia 5
    1 SB3, 1 radio, 1 touch
    Plugins : Trackstat, IR Blaster, Smartmix, MusicIP, ...

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •