Automatically playing/restarting on boot

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

Re: Automatically playing/restarting on boot

Postby timflan » 12 Jun 2017, 16:28

Frank:
I've tried both rebooting and disconnecting power. After it boots, I'm right where I left off, READY TO PLAY whatever was playing before. But it's in stopped mode, waiting for a click to play.
timflan
 
Posts: 4
Joined: 09 Jun 2017, 19:09

Re: Automatically playing/restarting on boot

Postby hondagx35 » 13 Jun 2017, 16:58

Hi all,

I did some tests with the auto play feature:
- works with network mounts
- works with radio streams
- works with locally stored files

- does not work with files stored on USB storage

I will try to find a solution for this.

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

Re: Automatically playing/restarting on boot

Postby timflan » 14 Jun 2017, 19:19

FYI I'm trying to autostart radio streams.
timflan
 
Posts: 4
Joined: 09 Jun 2017, 19:09

Re: Automatically playing/restarting on boot

Postby hondagx35 » 14 Jun 2017, 21:12

Hi timflan,

so something seems to be different on your system.

What output device do you use? USB DAC, I2S DAC or built-in like HDMI?

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

Re: Automatically playing/restarting on boot

Postby timflan » 14 Jun 2017, 21:54

It's very confusing. Was using the RPi analog out for simplicity; assuming fewer moving parts were better. So now I've got my Behringer UCA202 connected, and guess what?
It still doesn't autostart, whether I reboot, power-down and then physically reconnect the power, or physically remove power, wait, and re-connect.
I've now tried disabling Spotify, disabling the HDMI and 3.5mm outputs, and disabling lots of other seemingly unrelated options under Settings and MPD. No luck! :-(
timflan
 
Posts: 4
Joined: 09 Jun 2017, 19:09

Re: Automatically playing/restarting on boot

Postby petfr » 31 Oct 2017, 17:36

Hello
This is my first post in this forum. I have a Rasberry pi 3 model b in combination with a Iqaudio amp + (pi-digiamp +) and a 7 inch touchscreen and runeaudio 0.4-beta. Thanks to the hints everything runs smoothly except for the autostart function. The system is in my workshop. usually an Internet radio stream should be played automatically. In addition, I have created on my pc a release of my music folder so I can hear other music. After deactivating the autoupdate of the music database, this worked fine after several reboots and shutdowns. I was really happy about that I had an onetouch-system to start my "radio" with a push of a single button. After that I shut down my PC and with it my network folder. After restarting the autoplay did not work anymore. The player is in position stop and i have to press again separately on play to hear my internet radio station. Oviously autoplay collides with the update of the music database or the search for temporarily unreachable network folders. Is there a solution for this problem?

Greetings from germany

peter
petfr
 
Posts: 5
Joined: 31 Oct 2017, 16:52

Re: Automatically playing/restarting on boot

Postby janui » 10 Nov 2017, 21:58

Hi there,
Try adding the line 'ExecStartPre=/usr/bin/sleep 5' in '/usr/lib/systemd/system/ashuffle.service'. After modifying, it should look like this:
Code: Select all
...
[Service]
ExecStartPre=/usr/bin/sleep 5
ExecStart=/usr/local/bin/ashuffle
...
Increasing the sleep 5 up to sleep 10 may be necessary, but no longer for a PI B2 or B3. Ashuffle will only start after MPD has started, but I have a feeling that ashuffle needs to wait until MPD has got its act together.
I also had some problems with ashuffle and systemctl, no idea what the cause or real solution is, but the following series of commands seems to fix it:
Code: Select all
systemctl daemon-reload
systemctl enable ashuffle
systemctl start ashuffle
systemctl stop ashuffle
systemctl disable ashuffle
systemctl start ashuffle
janui
User avatar
janui
 
Posts: 699
Joined: 20 Dec 2014, 12:55
Location: Ollanda

Re: Automatically playing/restarting on boot

Postby petfr » 12 Nov 2017, 12:25

@janui

Thank you for your answer
I have tried your suggestion. Unfortunately, nothing has changed. If i start runeaudio and my network folder is not reachable the autoplay will not work. Activating the network folder within a short period of time (~ 30 sec) will result in a successful autoplay. If I wait longer to turn on the network folder, the automatic playback does not start. If my network folder is reachable, everything works fine. Of course, this is not a solution, because the folder is located on my windows pc and I have this
should be in operation to enable automatic playback.

peter
petfr
 
Posts: 5
Joined: 31 Oct 2017, 16:52

Re: Automatically playing/restarting on boot

Postby hondagx35 » 12 Nov 2017, 23:18

Hi Peter,

the "problem" is here:
Code: Select all
    if ($all_mounted === 0) {
        runelog('wrk_SY: try to mount all shares!');
        $all_mounted = wrk_sourcemount($redis, 'mountall');
        if ($all_mounted === 1) {
            runelog('wrk_SY: all shares mounted successfully!');
            // start play if enabled
            if ($redis->get('mpd_autoplay') === '1') {
                sysCmd('/usr/bin/mpc play');
            }
        } else {
            $retries_mounting++;
            runelog('wrk_SY: error mounting shares, try it again! Count: '.$retries_mounting);
            if ($retries_mounting > 20) {
                $all_mounted = 1;
                runelog('wrk_SY: mounting: tried it 20 times (10 seconds) => capitulating!');
                ui_notify_async('ERROR','Failed to mount network shares');
            }
            usleep(500000);
        }
    }

https://github.com/hondagx35/RuneUI/blob/0.4b/command/rune_SY_wrk#L931
The autoplay feature only works if all mounts are up and running.
At the time a wrote this piece of code I didn't think about webstreams.
For me autoplay only makes sense then all mounts are available because you need files to play.

You can try to modify the file "/var/www/command/rune_SY_wrk" like this:
Code: Select all
    // start play if enabled
    if ($redis->get('mpd_autoplay') === '1') {
        sysCmd('/usr/bin/mpc play');
    }
    if ($all_mounted === 0) {
        runelog('wrk_SY: try to mount all shares!');
        $all_mounted = wrk_sourcemount($redis, 'mountall');
        if ($all_mounted === 1) {
            runelog('wrk_SY: all shares mounted successfully!');
        } else {
            $retries_mounting++;
            runelog('wrk_SY: error mounting shares, try it again! Count: '.$retries_mounting);
            if ($retries_mounting > 20) {
                $all_mounted = 1;
                runelog('wrk_SY: mounting: tried it 20 times (10 seconds) => capitulating!');
                ui_notify_async('ERROR','Failed to mount network shares');
            }
            usleep(500000);
        }
    }


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

Re: Automatically playing/restarting on boot

Postby petfr » 13 Nov 2017, 12:20

@Frank

Thanks alot
This is the solution. The automatic start of my webstream now works even if the network drive is not connected. The only thing I have to do in addition is a manual remount of my network folder, if I want to hear music from it. I can live very well with that.

Peter
petfr
 
Posts: 5
Joined: 31 Oct 2017, 16:52

support RuneAudio Donate with PayPal

PreviousNext

Return to General discussion

Who is online

Users browsing this forum: No registered users and 2 guests