State file wont stay disabled?

General discussion about RuneAudio. Do not post any support or feature requests here.

State file wont stay disabled?

Postby irishwill2008 » 14 Sep 2016, 14:38

In settings i try disable the state file.. When i reboot the pi or turn it off and back on (Same thing) all my other settings stay set perfectly but if i set it to disabled before reboot and then reboot it changes back to enabled? I want to disable this option, how come it wont stay off?

Any help is appreciated.
Thanks.
Last edited by irishwill2008 on 16 Sep 2016, 10:15, edited 2 times in total.
irishwill2008
 
Posts: 157
Joined: 26 Jul 2016, 14:49
Location: Ireland

Re: State file wont stay disabled?

Postby hondagx35 » 14 Sep 2016, 15:29

Hi irishwill2008,

I want to disable this option, how come it wont stay off?

It's a bug, sorry.

find this in /srv/http/app/libs/runeaudio.php:
Code: Select all
            // --- state file ---
            if ($mpdcfg['state_file'] === 'no') {
                $redis->hDel('mpdconf', 'state_file');
            } else {
                $output .= "state_file\t\"/var/lib/mpd/mpdstate\"\n";
                $redis->hSet('mpdconf', 'state_file', '/var/lib/mpd/mpdstate');
            }

and change it to:
Code: Select all
            // --- state file ---
            if (!isset($mpdcfg['state_file'])) {
                $redis->hDel('mpdconf', 'state_file');
            } else {
                $output .= "state_file\t\"/var/lib/mpd/mpdstate\"\n";
                $redis->hSet('mpdconf', 'state_file', '/var/lib/mpd/mpdstate');
            }


Frank
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: State file wont stay disabled?

Postby irishwill2008 » 15 Sep 2016, 18:25

Will give this a try thanks!
irishwill2008
 
Posts: 157
Joined: 26 Jul 2016, 14:49
Location: Ireland

Re: State file wont stay disabled?

Postby irishwill2008 » 16 Sep 2016, 10:09

Worked Perfectly!
Thanks again.
irishwill2008
 
Posts: 157
Joined: 26 Jul 2016, 14:49
Location: Ireland

Re: State file wont stay disabled?

Postby irishwill2008 » 16 Sep 2016, 10:18

Update,
When i rebooted the pi.. It turned on and went settings and yeah the state file is disabled (after me going in and setting it from enabled to disabled before reboot) but as soon as i tried to add songs to my queue it added one and it wouldnt add the next, so i refreshed page and would not load! I tried going into ssh and typing: mpc load will (my playlist that always use to work) and command just sits there wont complete nor does mpc play. It then comes back with the error: mpd error: Timeout?
Any help appreciated thanks.
irishwill2008
 
Posts: 157
Joined: 26 Jul 2016, 14:49
Location: Ireland

Re: State file wont stay disabled?

Postby irishwill2008 » 16 Sep 2016, 11:37

What i did this time is put my backup on where the system was working and i didnt touch no settings (switch file is enabled in this backup) i left everything and then i changed the state file code, i went into settings and tried switching it to disabled.. as soon as i hit save it goes back to enabled? Anyway i left a playlist in the queue and left it playing and rebooted, when it turned back on it didnt play (GREAT! What i want) but the playlist was left in the queue still though? Which i dont mind to be honest, just once it DOESNT play on boot up. When i check settings again, it has the state file enabled still? Is this meant to happen or?
Let me know thanks!

P.s, i think its working now but not sure since it says enabled :o My player now works again anyway! What i did last time was i set it to disabled, saved and then i changed the code and rebooted and it didnt like it some reason.. caused the mpd to crash as i checked the status and had terminating and trying restart or whatever.

UPDATE: I left a song playing, pulled the plug out of pi and back on and its still playing the song :( State file is still working :/ Let me know what i can do thanks!
irishwill2008
 
Posts: 157
Joined: 26 Jul 2016, 14:49
Location: Ireland

Re: State file wont stay disabled?

Postby irishwill2008 » 16 Sep 2016, 12:00

I switched the code to the following below since the enabled wouldnt go disabled and now it crashes.. So confusing :x

if (!isset($mpdcfg['state_file'])) {
$output .= "state_file\t\"/var/lib/mpd/mpdstate\"\n";
$redis->hSet('mpdconf', 'state_file', '/var/lib/mpd/mpdstate');
} else {
$redis->hDel('mpdconf', 'state_file');
}
irishwill2008
 
Posts: 157
Joined: 26 Jul 2016, 14:49
Location: Ireland

Re: State file wont stay disabled?

Postby irishwill2008 » 16 Sep 2016, 12:10

It seems that whenever it hits :
$redis->hDel('mpdconf', 'state_file'); to disable the state file it causes my player to crash and not play songs and eventually causing me to not being able to connect to the server. I have to then plug pi out, back in and then it can work again but as soon as i try play a song it crashes.. Very strange, but if i change the code to work with:

$output .= "state_file\t\"/var/lib/mpd/mpdstate\"\n";
$redis->hSet('mpdconf', 'state_file', '/var/lib/mpd/mpdstate');

Then i can play songs etc without issue?

I dont want the setting state file to exist anymore as it is causing such a mess.. Can you point me in the direction to perhaps, completely remove this state file option? Thanks.
irishwill2008
 
Posts: 157
Joined: 26 Jul 2016, 14:49
Location: Ireland

Re: State file wont stay disabled?

Postby irishwill2008 » 16 Sep 2016, 12:24

Checking mpd.conf

state_file "/var/lib/mpd/mpdstate" is listed?
Is this meant to be there or?
irishwill2008
 
Posts: 157
Joined: 26 Jul 2016, 14:49
Location: Ireland

Re: State file wont stay disabled?

Postby hondagx35 » 16 Sep 2016, 14:08

Hi irishwill2008,

You can try this:
Code: Select all
            // --- state file ---
            if (!isset($mpdcfg['state_file']) || $mpdcfg['state_file'] === 'no') {
                $redis->hDel('mpdconf', 'state_file');
            } else {
                $output .= "state_file\t\"/var/lib/mpd/mpdstate\"\n";
                $redis->hSet('mpdconf', 'state_file', '/var/lib/mpd/mpdstate');
            }


I dont want the setting state file to exist anymore as it is causing such a mess.

What is your problem with the state file?
For me the state_file works like it should.

You never should cut power, as this sooner or later will corrupt your filesystem.

Frank
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

support RuneAudio Donate with PayPal

Next

Return to General discussion

Who is online

Users browsing this forum: No registered users and 1 guest