Background TV Recordings

Jul 2, 2011 at 8:47 PM

Hi again, firstly thank you so much for providing this software.
Secondly, I have another query.

I have been trying to learn some of LCD Smartie's advanced features today,
And I have been working on having two screens set up,
One that is showing when I am inside the Media Center App,
And one that is displayed once Media Center is closed,
I plan to use the 'if / then' function in LCD Smartie
Plus function 20 of MCE.dll, with ehshell.exe to tell LCD Smartie when to switch between the two.
Or, maybe use the Active.dll plug in also. 

I haven't quite got this sorted yet, but I think I know how to set it up.

However, what I would really like to do is have LCD Smartie report when MCE starts a TV recording,
Maybe by displaying the channel number or name and the name of the tv programme it is recording.
I will probably include this somehow on both of the two screens I will configure with LCD Smartie, maybe in slightly different ways.

I am pretty sure that the data is available, as LCD Writer can do this,
And function 1 of MCE.dll does report that it is recording sometimes, but not in a manner that is obvious to me.
I have tried so many different methods of getting MCE.dll to report this but can't seem to find the exact right instructions.

So, Is it possible to produce a line or two on the LCD that shows what MCE is recording, and stays on there even when MCE is closed, and then switches to blank, or displays something different once the recording is finished?

Hope that makes sense.

Thanks very much

lisa 

Coordinator
Jul 2, 2011 at 11:45 PM

Hi Lisa,

            I've had a look at ways to achieve what you are looking to do:

to switch between screens depending on whether Media Center is active I would use actions defined like:

[Actions]
Action01Variable=$dll(mce_dll,20,ehshell.exe,True)
Action01Condition=2
Action01ConditionValue=True
Action01Action=GotoTheme(1)
Action02Variable=$dll(mce_dll,20,ehshell.exe,True)
Action02Condition=5
Action02ConditionValue=True
Action02Action=GotoTheme(2)

Note that i've used themes rather than screens for this. You would then set screens for themes 1 and 2 and enable them. Then for a screen in theme 1 to display recording info when a recording is in progress you could use something like:

$dll(if,1, $dll(mce_dll,4,Recording,)#Recording, Recording#$dll(mce_dll,1,,))
$dll(if,1, $dll(mce_dll,4,Recording,)#Recording, $dll(mce_dll,4,ChannelName,MediaName)#$dll(mce_dll,2,,))

The first line just says display "Recording" if the Media Center Recording tag is set to true otherwise display the results of function 1. The second line says if recording then display the Channel Name and program name otherwise display the results of function 2.

Note that i'm not sure about ChannelName and MediaName for recording (and I can't try it since my partner is watching a movie and I don't have a tuner on this laptop!).  Also, my understanding is that Media Center needs to be running for the recording to take place. If that's not the case we would need to know whch process does the recording and use that to decide what to display.

The decisions above could all be done by Actions or all by If's (I think the actions are simpler Personally) and you could use Active instead of function 20 if desired.

Hope this is of help.

Dave

Jul 3, 2011 at 11:12 AM

Thank you Dave, for a very fast and full response.

I would never have worked that out by myself. This is all quite new to me, so taking me awhile to figure things out fully.

I understand how to use that coding in LCD Smartie though, so you have given me plenty to work, thankyou.

The background recording process is a bit of a mystery.

My Media Center is set so that it wakes itself from S3 sleep, carries out a scheduled tv recording, then puts itself back into S3 sleep, with no user input and without the Media Center app being opened.
Likewise, I can manually start a recording then close the Media Center app, and the recording will continue.

I have tried various uses of the MCE.dll and the Active.dll to report back via LCD Smartie what processes are in place when these events are happening,
But can't quite yet work out what is exactly going on.

I still have my VFD running by LCD Writer alongside my 7" screen running by LCD Smartie.

LCD Writer does report back the Channel Number, Channel Name, and Program Name, when the Media Center is doing a background recording, so I know that it must be possible to get LCD Smartie to do the same.

Strangely when I was watching a film through Media Center yesterday, function 1 of MCE.dll was reporting 'Video: Vanishing on 7th Street' and then changed to 'Video: Penn and Teller Fool Us' when the scheduled recording started in the background.  I tested this a bit further later on, and sort of concluded that it was just reporting back the last Media Name that it picked up, it did not change back to 'Vanishing on 7th Street' once the tv recording had finished.

I'll carry on doing some research and testing, and let you know if I find a solution. In the meantime if you come up with anything, please let me know.

Thanks again for all your help.

lisa

Jul 3, 2011 at 11:33 AM

A-ha, just found this webpage, I think the service is called ehSched.

http://www.blackviper.com/wiki/Windows_Media_Center_Scheduler_Service

Coordinator
Jul 3, 2011 at 12:02 PM

Thanks Lisa,

unfortunately I think ehsched is a service and not a process so it will always be active.

BTW there are extraneous spaces in the $dll examples i posted earlier that stop them from working. they should be:

$dll(if,1,$dll(mce_dll,4,Recording,)#Recording,Recording#$dll(mce_dll,1,,))
$dll(if,1,$dll(mce_dll,4,Recording,)#Recording,$dll(mce_dll,4,ChannelName,MediaName)#$dll(mce_dll,2,,))

The first line seems to work okay and will display recording when a recording is in progress. However the second line values are only true at the start of the recording!

I'll need to make some code changes to grab the recording channel and media name when the recording starts, store these and detect the recording stop. I was able to see the status changes using the tracer program this morning but wont be able to make and test the code changes for a few days.

I also had a problem with the actions on my version of smartie not working as expected. I downloaded the new beta version and they seem okay now so beware.

Thanks for the excellent feedback,

Dave

Coordinator
Jul 5, 2011 at 6:56 PM

Hi Lisa,

         I've made a load of changes and the recording status seems to be working (Though i've done limited testing). This is in Change set 6553 v0.9.12.3

 As usual download it and copy the mce_dll.dll file to your LCDSmartie/Plugins folder. (You need to stop LCDSmartie before doing this).  I've updated the doc file to reflect the changes.

I'd greatly appreciate any testing and feedback you can do.

v0.9.12.3
- Modified functions 1 and 2 so that if a recording or disc burning is active this overrides the displayed values
  (Note this has had limited testing due to an issue with my TV tuner)
- Modified functions 1 and 2 so that if Media Center is inactive it displays "Windows 7 HTPC" and the time/date
- Modified function 4 so that if an I is added at the end of the tag name it returns the integer value. (allows you to create a bar
- Added function 19 to re-read the ini and log files         
- Fixed another bug in the threading which was causing multiple connections/threads
- Added Recording tags
- Function 20 can be used to determine is a process is active by exe file name (e.g. ehshell.exe)
 

Regards,

Dave

Jul 5, 2011 at 9:48 PM

Brilliant, thanks Dave, that was quick! I should be able to test this out over the next couple of days and I'll let you know how it goes.

Jul 6, 2011 at 12:07 AM

Hello Again,

I have just had a really quick look at the new release, and initial thoughts are that it is definitely picking up my tuner status well,

I do have 4 tuners actually, so not sure how it will cope with that, but there is rarely more than 1 or 2 in use at the same time,
So even if it just picks up any one that is recording that will be great.

Oh, I don't think function 12 is working, you mention it in the doc file, but I get 'dll not recognised' error.

However, the main thing I have been playing around with for the last hour or so, is that functions 1 and 2 close down once the Media Center App is closed.
So if a recording carries on after I have closed down Media Center, or begins when Media Center is closed, functions 1 or 2 will not report this.
Function 4 does report it, but does then not clear or change once the recording has ended.
Whatever it was displaying last just stays on the screen (with function 4 and the new recording info strings).

I guess that I am meant to be using the 'RecordingStatus' Integer to recognise a change to status 4 and report the recording info,
Then recognise a change to status 0 and change the display to something else.

With my limited working knowledge of LCD Smartie, this is quite a challenge for me!

I tried this in Actions (it failed):

If $dll(mce_dll,4,Recording Status,,) = 4 then GotoScreen(3)

So I gave this a shot (but it failed too):

If $dll(mce_dll,20,RecordingStatus,4) = True then GotoScreen(3)

I looked back to your instructions from Saturday, I haven't tried these yet, as I think they may no longer work now that you have changed the coding?

I plan to have three screens now (I haven't figured out themes yet)

Screen 1 : Media Center Active - displaying as much info as possible of what I am watching and recording

Screen 2: Media Center Closed - recordings going on in the background - reporting what its recording

Screen 3: Media Center Closed and no recordings going on - just a clock, maybe a news feed, system info etc..

Thanks to your previous help I have it switching between screens 1 and 2 successfully as Media Center closes and opens, I am wondering what happens if I introduce a third variable, will there be competing priorities?

Anyway, I'll keep testing and trying over the next few days, and let you know how it goes.

If you can help me out with any of the above in the meantime, that would be very much appreciated. Thanks again for all your help!

lisa 

 

 

 

Coordinator
Jul 6, 2011 at 10:54 AM

Thanks Lisa,

                   I've uploaded 6572/v0.9.12.4. Fixed function 12 (cut/paste schoolboy error doh!). Made recording indication higher priority than Media Center closed in functions 1 and 2.

In answer to your specific questions:

However, the main thing I have been playing around with for the last hour or so, is that functions 1 and 2 close down once the Media Center App is closed.
So if a recording carries on after I have closed down Media Center, or begins when Media Center is closed, functions 1 or 2 will not report this.
Should be okay now BUT Media Center must be run once before this plugin will report anything since it uses TCPIPController which is started by Media Center

Function 4 does report it, but does then not clear or change once the recording has ended.
Whatever it was displaying last just stays on the screen (with function 4 and the new recording info strings).

Should be okay now.

I guess that I am meant to be using the 'RecordingStatus' Integer to recognise a change to status 4 and report the recording info,
Then recognise a change to status 0 and change the display to something else.

Function 1 should do this now but you could also do it his way.

With my limited working knowledge of LCD Smartie, this is quite a challenge for me!

I tried this in Actions (it failed):

If $dll(mce_dll,4,Recording Status,,) = 4 then GotoScreen(3)

I had to upgrade to the new beta version of LCDSmartie to get actions to work. I also couldn't get the GotoScreen to work understandably (probably something to do with priorities) so I used GotoTheme which seemed to work. (You just set the theme number on the screens you want displayed). BTW you could also use

If $dll(mce_dll,4,Recording,,) = True then GotoTheme(3)

So I gave this a shot (but it failed too):

If $dll(mce_dll,20,RecordingStatus,4) = True then GotoScreen(3)

I dont understand this - function 20 checks if a Windows 7 process is active.

I looked back to your instructions from Saturday, I haven't tried these yet, as I think they may no longer work now that you have changed the coding?

The actions should still be valid but the Recording stuff is now built into Functions 1&2.

I plan to have three screens now (I haven't figured out themes yet)

Screen 1 : Media Center Active - displaying as much info as possible of what I am watching and recording

Screen 2: Media Center Closed - recordings going on in the background - reporting what its recording

Screen 3: Media Center Closed and no recordings going on - just a clock, maybe a news feed, system info etc..

Thanks to your previous help I have it switching between screens 1 and 2 successfully as Media Center closes and opens, I am wondering what happens if I introduce a third variable, will there be competing priorities?

This is hat I couldn't get to work with Gotoscreen but seemed okay with GotoTheme and the latest beta smartie version. I've also been unable to find any documentation on actions and don't understand quite what happens when you have lots of them.

I'm going to investigate getting access to the Media Center state info from my own code rather than through TCPipController since it's causing some of these issues.

Dave

Jul 7, 2011 at 2:13 PM

Thanks very much Dave.

As ever, I am very appreciative of your hard work and time, I am really enjoying using the software
It is looking lovely on the little 7" LCD display which acts as a second monitor, and displays all the LCD Smartie info, which I can read from the sofa using some magnifier software.

Anyways... I am still tweaking all the configurations and could still do with a little more help if you have the time.

Basically, I have settled on two screens as the LCD Smartie actions easily switch between the two now when they detect if ehshell.exe is active or not.

I did try themes, and couldn't figure it out, I am using the lastest LCD Smartie beta release.

Screen 1 - In MCE

$Time(ddd dd mmm hh:nn)
$dll(MCE_dll,12,,)
$dll(MCE_dll,1,,)
$dll(MCE_dll,2,,)

Screen 2 - MCE Closed

$Time(ddd dd mmm hh:nn)
$dll(MCE_dll,1,,)
$dll(MCE_dll,2,,)
$Rss(http://news.bbc.co.uk/rss/newsonline_uk_edition/uk/rss091.xml,b)

These work perfectly when MCE is actively recording, and displays everything I want.
But when MCE is not recording I get a lot of duplicate info.

I guess, this is because your functions, 1, 2 and 12 are designed for a 2 line display, but I am using a 4 line display.

So... really I need to create my own functions that suit a four line display, this is where I am stuck.

I started off by experimenting with function 4, and tried this:

Rec: Ch $dll(MCE_dll,4,RecordingTrackNumber,RecordingChannelName)

It works, but stays stuck once the recording has ended. It just continues to display whatever was last recorded until a new recording takes it over.

I then decided to try some if / then statements in the screen so I could get a line to display something different depending on whether it detected a current recording or no.
The only code I have to work with is the one that you have given me a few days ago, so I tried this:

 $dll(if,1,$dll(mce_dll,4,Recording,)#Recording,Recording#$dll(mce_dll,1,,))

But I get an error message saying that 'DLL: can not load plug in'

If I can just get one bit of code working on an if / then statement depending on detected recording, I could probably work out how to tweak it for my needs.

lisa

Coordinator
Jul 7, 2011 at 3:14 PM

Thanks Lisa,

So... really I need to create my own functions that suit a four line display, this is where I am stuck.

I'd be happy to look at creating a 4 line option in the code if you could define what you would want on each of the 4 lines for each of the states? (I can give you a list of the states and what is currently shown for 2 lines.

I started off by experimenting with function 4, and tried this:

Rec: Ch $dll(MCE_dll,4,RecordingTrackNumber,RecordingChannelName)

It works, but stays stuck once the recording has ended. It just continues to display whatever was last recorded until a new recording takes it over.

I then decided to try some if / then statements in the screen so I could get a line to display something different depending on whether it detected a current recording or no.
The only code I have to work with is the one that you have given me a few days ago, so I tried this:

$dll(if,1,$dll(mce_dll,4,Recording,)#Recording,Recording#$dll(mce_dll,1,,))

But I get an error message saying that 'DLL: can not load plug in'

If I can just get one bit of code working on an if / then statement depending on detected recording, I could probably work out how to tweak it for my needs.

This code looks fine and should work okay. It looks to me as if the file 'if.dll' is not in your plugins folder. I did a copy and paste from this text to my smartie setup and it seemed to work okay. You can get the dll at http://jongrieve.net/software/if_scroll_swap/

Jul 7, 2011 at 3:47 PM

Ah! Didn't realise I needed another plug in, thanks, will give it another try.

Jul 7, 2011 at 4:23 PM

Well, I got the code above to work fine, but trying to tweak it failed.

Any idea what is wrong with this.. I get Dll: too many parameters error:

$dll(if,1,$dll(mce_dll,4,Recording,)#Recording,$dll(mce_dll,2,,)#$Rss(http://news.bbc.co.uk/rss/newsonline_uk_edition/uk/rss091.xml,b))

Coordinator
Jul 7, 2011 at 4:56 PM

It works okay for me Lisa (although i'm at work so the rss feed comes back with a protocol error.) and I just copied and pasted it.

Try something simpler with the if first e.g. something like $dll(if,1,jim#jim,jim#nojim) should give jim

$dll(if,1,jim#nojim,jim#nojim) should give nojim

just to prove that the if dll is working okay.

Try copy and pasting it back in like i did???

Jul 7, 2011 at 5:36 PM

Very odd, Jim works and the original statement work, and I just got a different news feed to work. Ah well, at least I know it's not me.

Thanks. I'll keep trying!

Jul 7, 2011 at 7:44 PM

Hurrah! I have finally got it set up to my liking. In case you are interested, here are the final screens I settled on,
Also, I guess the coding info could help anyone else that may read this.

Thank you once again for a brilliant piece of software :-)

Actions...

Action01Variable=$dll(mce_dll,20,ehshell.exe,True)
Action01Condition=2
Action01ConditionValue=True
Action01Action=GotoScreen(1)
Action02Variable=$dll(mce_dll,20,ehshell.exe,True)
Action02Condition=5
Action02ConditionValue=True
Action02Action=GotoScreen(2)

Screen 1...

$Time(ddd dd mmm hh:nn)
$dll(MCE_dll,12,,)
$dll(MCE_dll,1,,)
$dll(if,1,$dll(mce_dll,4,RecordingStatus,)#4,$dll(mce_dll,2,,)#$Rss(http://news.bbc.co.uk/rss/newsonline_uk_edition/uk/rss091.xml,t,1) ) 

Screen 2...

$Time(ddd dd mmm hh:nn)
$dll(MCE_dll,1,,)
$dll(if,1,$dll(mce_dll,4,RecordingStatus,)#4,$dll(mce_dll,2,,)#$dll(textwriter,2,UpTime: $UpTims, 20))
$Rss(http://news.bbc.co.uk/rss/newsonline_uk_edition/uk/rss091.xml,b)