Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Solved: Symbolic link for Soundirok disappears
#1
I've enjoyed using moOde for two years plus. Even more after I started listening to high definition tracks. A big thank you to Tim and the team for this awesome software!

With moOde, I use an IOS remote control app for MPD called Soundirok, that I have understood requires three things: 

1) That Music Player Daemon plays the music. This is a breeze as moOde uses MPD to play music.
2) That the MPD server has a fixed IP address. Trivial, since moOde allows me to configure "static ip_address" in /etc/dhcpcd.conf.
3) That Soundirok can access cover art through a link to the root of the music library. Unfortunately, this broke a while ago.

I had followed advice from this thread. In particular inserting a line in the file /var/www/command/worker.php 
Code:
if (!file_exists('/var/www/soundirok')) {SysCmd('ln -s /var/lib/mpd/music /var/www/soundirok');}

under the comment "// Ensure certain files exist". The line creates a symbolic link to the music library that can be picked up by Soundirok. 
It seems to work fine, but after a while the link is removed. Presumably by a maintenance routine in moOde. After that point Soundirok can't read and display the beautiful album art that I meticulously put into folders. Sad 

I hope someone with more knowledge than me will please offer advice.
Reply
#2
Pity you can't get this to work, Soundirox is/was a great app. Not sure if it is supported any more, it's not had a update for a while and no reply to a question I sent them a while back.
Reply
#3
@Tenbagger

The problem is you are creating a symbolic link in moOde's main directory. If you look farther down to line 962 or so in worker.php, you'll see this block of maintenance code in which all such links are summarily deleted.

Code:
               // Prune temp or intermediate resources
               sysCmd('find /var/www -type l -delete');
               sysCmd('rm /var/local/www/imagesw/stations.zip > /dev/null 2>&1');

Rather than mucking with the logic here, I'd try what my first supervisor would call a "brute-force and ignorance" solution. Leave where it is the line of code you've already added and insert a new line at the end of this block to recreate the link during maintenance. It should be obvious why the if-test isn't needed here.

Code:
               // Prune temp or intermediate resources
               sysCmd('find /var/www -type l -delete');
               sysCmd('rm /var/local/www/imagesw/stations.zip > /dev/null 2>&1');
               sysCmd('ln -s /var/lib/mpd/music /var/www/soundirok');

I'm thinking a better solution than this hackery is the addition of a new server stanza to the nginx configuration file but I've used up my time for today so I'll leave that exercise to an interested student (something one of my professors would say).

Too bad Soundirok has no free-trial version for either iOS or Android. Otherwise I'd have tested my proposed solution with it already.

Too bad as well it hasn't been updated in 3 years if it is as good as some say.

Regards,
Kent
Reply
#4
Thank you for taking an interest, Kent.

Tried your solution with the extra line for symbolic link creation on the tail of the "// Prune temp" section. Unfortunately, the link still disappears. I'm thinking either some extra cleanup is going on elsewhere, or the find command above is asynchronous and slow?

BTW: I can attest to the quality of Soundirok – haven't really noticed the lack of updates. I'm using Soundirok on an old iPad in my living room, pluss on my iPhone with a portable moOde Walkman that I made.
Reply
#5
(05-19-2021, 07:29 PM)Tenbagger Wrote: Thank you for taking an interest, Kent.

Tried your solution with the extra line for symbolic link creation on the tail of the "// Prune temp" section. Unfortunately, the link still disappears. I'm thinking either some extra cleanup is going on elsewhere, or the find command above is asynchronous and slow?

BTW: I can attest to the quality of Soundirok – haven't really noticed the lack of updates. I'm using Soundirok on an old iPad in my living room, pluss on my iPhone with a portable moOde Walkman that I made.

I still don't have cycles available to do testing but I stole a couple of minutes after dinner to search the moOde globally.

Et voila!  The same search-and-destroy of symlinks appears in /var/www/inc/playerlib.php

Code:
function integrityCheck() {
       $warning = false;

       // Export device table
       sysCmd('sqlite3 ' . SQLDB_PATH . " \"SELECT * FROM cfg_audiodev WHERE drvoptions NOT IN ('slave', 'glb_mclk') AND chipoptions = ''\" > /tmp/cfg_audiodev.sql");
       // Broom www root
       sysCmd('find /var/www -type l -delete');
        ...

so you'll have to adjust there too.

Good luck.

Regards,
Kent
Reply
#6
Thank you, Kent! Soundirok now works perfectly. Your untiring efforts are very much appreciated! 

Small note: When making a donation just now; using credit card directly didn't work, had to use PayPal. Perhaps somebody should look into that.
Reply


Forum Jump: