INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: How to wake-up with a given playlist?  (Read 7165 times)

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
How to wake-up with a given playlist?
« on: February 10, 2016, 11:52:43 pm »

I'm on Windows 8.1.
I'd like to set up my PC so that it wakes up at a given time and plays a certain playlist on jriver.
How can I do that?

And if in addition I want to stream the playlist from my PC in my living-room to a dlna receiver in my bedroom, using wifi.
How could I do it?
Logged

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
Re: How to wake-up with a given playlist?
« Reply #1 on: February 11, 2016, 12:22:13 am »

The first thing to do is to wake-up the computer and ask it to run jriver:
http://www.howtogeek.com/204742/how-to-make-any-computer-boot-up-or-shut-down-on-a-schedule/

What's missing is the proper command so that JRiver plays a certain playlist.

And similarly, the commands to stream the content over dlna.
Logged

fooze

  • Junior Woodchuck
  • **
  • Posts: 72
  • TURN IT UP
Re: How to wake-up with a given playlist?
« Reply #2 on: February 11, 2016, 02:58:56 am »

This should help - https://wiki.jriver.com/index.php/The_Command_Line

I haven't done this, but it looks like if you invoke MC with "mc21.exe /Play TREEPATH=Playlists\yourplaylist" it should work.

Looks like you'll have to dig into zones to automate your other player. I have no idea how this works so maybe someone else can chime in?
Logged

justsomeguy

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 525
Re: How to wake-up with a given playlist?
« Reply #3 on: February 11, 2016, 11:50:48 pm »

http://yabb.jriver.com/interact/index.php?topic=65984.0

I wrote a small program that should do exactly that. I actually currently use it for the same purpose as you are asking about.

I just create a file called wakeup.cmd
In that file I put (include the quotes) "E:\Extended Desktop\MC\Wakeup\MCPlayClose.exe" "TREEPATH=Playlists\Wakeup 4" 1 standard
For you the path will obviously be different. Wakeup 4 is the playlist that loads. The 1 is the zone number your want to play to (you must use the zones number not the zone name). Standard just means to load MC in Standard View.
Now just setup a scheduled task in windows that runs your wakeup.cmd file at whatever time you want to be woken up.

There is a "MCPlayCloseConfig" file that if set correctly with your "Media Network" settings in MC, after playback stops it will close MC automatically. So after if you press stop or the playlist ends and isn't set to repeat, MC will close. This is because it was originally written for a different purpose but still works fine as a kind of alarm clock. If you do not set the "MCPlayCloseConfig" file with the correct "Media network" settings it will still launch MC and playback your playlist but after playback stops MC will just remain open. This may actually be preferred behavior for you.

Logged

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
Re: How to wake-up with a given playlist?
« Reply #4 on: February 12, 2016, 03:01:24 am »

I also just noticed JRiver has its built-in scheduler. It's fairly simple to use it.
You can specify all sorts of tasks, including regular alarms. And send a playlist to the zone of your choice.

I will see whether JRiver can wake-up the computer with such a task.
Answer: no it can't. So I will now try your program :)

It worked perfectly, thanks! I'm using the following command (just changed to zone 2):
"C:\Users\David\Programs\MC PlayClose\MCPlayClose.exe" "TREEPATH=Playlists\Reveil" 2 standard

I still need to figure out is the proper settings for Windows task scheduler...
It's not easy, but finally I found some settings that work, thanks to this post:
https://stackoverflow.com/questions/4437701/run-a-batch-file-with-windows-task-scheduler
Logged

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
Re: How to wake-up with a given playlist?
« Reply #5 on: February 12, 2016, 07:00:11 am »

In addition, at first, the task scheduler couldn't wake-up the computer from sleep.
Then I discovered it's because I had disabled the option in the Power options:
https://superuser.com/questions/958109/how-to-prevent-windows-10-waking-from-sleep-when-traveling-in-bag
Once I enabled that, computer woke up nicely.

The remaining problem is this:
My dlna receiver is the Roberts Stream 93i, an internet radio that can stream dlna content. So:
The radio (set on dlna) and MC media server must wake up at the same time. -- Doable on each.
Then, the radio must connect to MC server. -- Sadly, I don't see how to do that without human intervention on the radio.
And then, the playlist can be sent to the radio using the instruction above.
Logged

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
Re: How to wake-up with a given playlist?
« Reply #6 on: February 12, 2016, 04:12:30 pm »

I'm trying to wake-up the radio (acting as dlna receiver) and have it play a jriver playlist.
It doesn't work.
Here is the log from MCPlayClose:
Code: [Select]
Arguments:
TREEPATH=Playlists\Reveil
2
standard

12/02/2016 23:08:10 : Waiting for MC to open
12/02/2016 23:08:10 : MC opened
12/02/2016 23:08:10 : /PlayReplace TREEPATH=Playlists\Reveil|Zone=1&ZoneType=Index
12/02/2016 23:08:10 : Playback - PLAYING
12/02/2016 23:08:10 : Set zone to: 2
12/02/2016 23:08:10 : Turned repeat off
12/02/2016 23:08:11 : Waiting for MC server to load
12/02/2016 23:08:12 : Waiting for MC server to load
12/02/2016 23:08:12 : Connected to MC server
12/02/2016 23:08:12 : Token: wkF7k70u
12/02/2016 23:08:12 : http://127.0.0.1:52199/MCWS/v1/Playback/Info?Zone=1&ZoneType=Index&Token=wkF7k70u
12/02/2016 23:08:12 : <Item Name="ZoneID">0</Item>
12/02/2016 23:08:12 : <Item Name="State">0</Item>
12/02/2016 23:08:12 : xmlFieldNum: 1
12/02/2016 23:08:12 : Now monitoring playback state: Playing
12/02/2016 23:08:13 : Playback - STOPPED
12/02/2016 23:08:14 : MC closed
Does it suggest things to try?
Logged

justsomeguy

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 525
Re: How to wake-up with a given playlist?
« Reply #7 on: February 12, 2016, 04:44:23 pm »

Does it work if you play to a non dlna zone?
If you just try and play files in the dlna zone through MC normally without using MCPlayClose does it play on the radio?

The program doesn't know anything about the type of zone it is, it just send MC commands telling it to load the playlist in that zone. if the zone works with just MC then it should work like this as well.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: How to wake-up with a given playlist?
« Reply #8 on: February 12, 2016, 04:59:50 pm »

Getting things to auto shut down and auto wake seem to be problematic, almost no matter what the platform is.  Why not just leave them both on, so they will work reliably?

Brian.
Logged

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
Re: How to wake-up with a given playlist?
« Reply #9 on: February 12, 2016, 05:09:38 pm »

@Brian: I'll try that.
But possibly both computer and radio will fall asleep nonetheless!

@justsomeguy: as said above, it works.
Only, it doesn't succeed in waking up my (radio acting as) dlna receiver.
I was hoping the log suggested some things to try.

By the way, could you provide the code of your program?
And/or what are the underlying commands that one would send to JRiver directly?
Logged

justsomeguy

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 525
Re: How to wake-up with a given playlist?
« Reply #10 on: February 12, 2016, 09:16:37 pm »

I'm wondering if your problem is may be the zone number you are telling it to play to? From what I gather when dealing with dlna zones the zones numbers aren't necessarily consecutive.

Start MC and select the zone you are wanting to play to.
Put this in your web browser with MC still open: http://127.0.0.1:52199/MCWS/v1/Playback/Zones
You should see some xml come up. You are looking for this line near the top: <Item Name="CurrentZoneIndex">#</Item>. That will be your correct zone index for your dlna. It may not be what you expect.

Also along the lines of what fooze suggested just running the command below should basically accomplish what I think you are wanting. You can actually just put that in your windows scheduled task or test it by running it with win+r.
mc21.exe /Play TREEPATH=Playlists\Reveil|Zone=2
at the most basic level that's what my program is sending to MC. There are lots of other things it does with timing, switching views, monitoring playback state and shutting down MC. Most of which is really more than you probably need. Check that your zone index is correct though.



Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: How to wake-up with a given playlist?
« Reply #11 on: February 12, 2016, 09:59:00 pm »

Yes. If you don't need the feature of justsomeguy's application which shuts down MC when playback stops, then you could probably accomplish what you need with a simple command line call.

It was already linked once above, and justsomeguy gave you the exact command line to play an item above, but again:
https://wiki.jriver.com/index.php/The_Command_Line

Also worth throwing out there, I also made a little playback utility for MC that I needed for work, which might do something you need: MCPlayIfNotPlaying, which does just what it says on the tin.

You schedule it to run in Scheduled Tasks (typically), and give it a Playlist to play and it:
* Launches MC if it isn't already running.
* Checks to see if MC is already playing something (which it wouldn't be, obviously, if it had to launch it, but that's somewhat irrelevant).
* If Playback is currently active, it does nothing and exits.
* If Playback is stopped, then it plays the provided Playlist, and lets you give other options to specify zones, detach displays, and other handy stuff.

But, just like justsomeguy's app, if you don't need the "only play this if MC is stopped" feature, then there's really no reason to use it, and just use MC21.exe (or MCcl.exe instead so you don't have to re-edit your scripts when MC22 comes out).
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
Re: How to wake-up with a given playlist?
« Reply #12 on: February 13, 2016, 01:29:15 am »

You're right, the zone was incorrect, it's 1, not 2.
But strangely, MCPlayClose did play on the dlna receiver before with zone 2 as setting.

So the command line instruction is:
mc21.exe /Play "TREEPATH=Playlists\Reveil|Zone=1"
(Without the quotes, it doesn't work for me.)

The problem is that when my radio gets to sleep, it seems to disconnect from MC.
And there is no parameter on the radio to prevent it to sleep.
So I'll probably give up that.
Anyway, it's interesting to understand how all this works.
Logged

justsomeguy

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 525
Re: How to wake-up with a given playlist?
« Reply #13 on: February 13, 2016, 01:50:41 am »

Glad you got the zone issue figured out.
Seems very odd that a device like that has an automatic sleep timer without an option to disable it. Maybe see if they have a firmware update or contact the manufacturer.
Out of curiosity I found the manual for your device online and looks like there is a section on sleep timer. Maybe it can point you in the right direction. http://www.aeldownloads.com/robertsradio/userguides/Stream93i%20Issue.1.pdf

Good luck
Logged

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
Re: How to wake-up with a given playlist?
« Reply #14 on: February 13, 2016, 02:06:48 am »

Actually, MCPlayIfNotPlaying does the trick:
1) Ensure the radio is seen by JRiver, ie that it appears as a zone. Make sure JRiver doesn't play on it.
2) Put the radio to sleep (which it will do by itself after a while anyway).
3) Launch this command:
"C:\Users\David\MCPlayIfNotPlaying.exe" --playlist="Reveil" --zone=1

My earlier problems probably came from the fact I wasn't following steps 1 and 2 (consistently).
(Also, MCPlayClose wasn't exactly adequate to what I needed.)
When following steps 1 and 2, the direct command seems to work:
mc21.exe /Play "TREEPATH=Playlists\Reveil|Zone=1"

I will do a complete test (wake up computer and radio) later on.
Answer: FAIL.
So I think I will give up.

PS: Thanks, I had looked at the manual of the radio, but it doesn't provide any relevant option.
Logged
Pages: [1]   Go Up