Page 1 of 1

socket_write error - MPD Crashed

PostPosted: 23 Apr 2018, 15:10
by irishwill2008
Hi guys,

Sometimes i get the odd time where MPD would crash and i would get
Code: Select all
rune_SY_wrk[357]: mpd error: Connection refused
rune_SY_wrk[357]: Warning: socket_write(): unable to write to socket [32]: Broken pipe in /srv/http/app/libs/runeaudio.php


And happens on the PL side (rune_PL_wrk).

Why cant it write the socket? What can i do to solve / fix this? Is there a manual override for this?

Thanks!

Re: MPD Crashed

PostPosted: 23 Apr 2018, 19:55
by janui
Hi irishwill2008,
I have also seen this. But in most cases is caused by MPD not being fully initialised. The PHP script rune_SY_wrk runs through its loop again and usually after 2/3 attempts, when MPD is fully initialised, the pipe is opened successfully. For rune_PL_wrk it’s the same story.
MPD is also shut down for several reasons (e.g. when you use Spotify), again during the start-up phase after a shut-down these 'Broken pipe' messages can occur.
janui

Re: MPD Crashed

PostPosted: 01 May 2018, 16:39
by irishwill2008
Hi janui,

Sometimes it crashes and stays like this until i run a backup. When this occurs, is there some way to set it back to default? Like a command or something where once ran.. Its back to basic and runs smooth again?

Thanks.

Re: MPD Crashed

PostPosted: 01 May 2018, 21:31
by janui
Hi irishwill2008,
Yes, you can reset Rune via SSH. After a reset you will lose quite a lot of your settings, but you will not need to reflash the SD-Card. So, log in via SSH and execute the following commands:
Code: Select all
redis-cli set playerid ""
redis-cli set hwplatformid ""
Then reboot. You will need to check your setting afterwards. Maybe an idea to make a note of your setting beforehand.

If you have Rern’s Addons installed the reset will break it. Its best to remove Rern’s Addons via the menu before resetting. If that is not possible, the following should reinstall the Addons menu after rebooting:
Code: Select all
rm -f ./install.sh
rm -f /usr/local/bin/uninstall_addo.sh
redis-cli del addons addo
wget -vN https://github.com/rern/RuneAudio_Addons/raw/master/install.sh
chmod +x -v ./install.sh
./install.sh

janui

Re: MPD Crashed

PostPosted: 02 May 2018, 09:07
by irishwill2008
Thanks janui! Next time it happens il give it a shot and see how it goes.

Cheers!

Re: socket_write error - MPD Crashed

PostPosted: 22 May 2018, 08:28
by Stefano
Thanks for the codes!