JP1 Remotes Forum Index JP1 Remotes


FAQFAQ SearchSearch 7 days of topics7 Days MemberlistMemberlist UsergroupsUsergroups RegisterRegister
ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in

Input Tracking for device without discretes

 
Post new topic   Reply to topic    JP1 Remotes Forum Index -> JP1 - General Forum
View previous topic :: View next topic  
Author Message
pH7_jp1



Joined: 14 Sep 2003
Posts: 461
Location: Sterling Heights, MI

PostPosted: Sun Mar 18, 2012 10:45 am    Post subject: Input Tracking for device without discretes Reply with quote

Problem

Many times in these forums the question is asked about how to track the current state of an input for a device that does not have discrete input codes. The most useful response is to find a workaround that will force the input into a know state. Usually something like CH+, CH- will force the input into the Antenna mode and then macros can take it from there for each desired input. The alternative that is suggested is to use nested TOADTOG and multiple bits, but the caveat is always (correctly) stated that the complexity of the nested TOADTOGs will make it very difficult to develop and maintain. In the past, when faced with this problem, I have always been able to find a useful workaround, until my sister-in-law purchased an LG 42LV4400, see my rant here. If LG had set out with the goal to foil anyone from choosing an input device via a macro they couldn't have done a "better" job. So I set out to solve this problem and came up with 2 solutions for saving the state of the TV input. While I wouldn't call either of them "simple", I don't think they are nearly as complex as nested TOADTOGs. Both solutions require an extender. Both examples can be found in This File.

Solution 1

Keep the state of the TV input using the state of a Key Set. In the file linked above, the example is InputTrackKeyset.ir. The key to this solution is that I used the state of the PIP Key Set to identify the currently selected input of the TV. If the most recent PIP Key Set assignment was P_CBL then the current TV input is HDMI1, P_DVD = HDMI2, P_TV = HDMI3, and P_VCR = AV. This means that all buttons in this Key Set will not be chosen by the current device. Since this TV didn't have PIP functions this wasn't a great loss for me. Any Key Set can be used, I just chose PIP for the reasons stated above. I have 8 different "activity" buttons (not device buttons) and you will notice that none of these macros contain a P_dev type command. The implementation of the input changes are in 12 DSMs. XSHIFT-PIP On/Off will change the input to HDMI1, XSHIFT-PIP Swap will change the input to HDMI2, XSHIFT-PIP Move to HDMI3, and XSHIFT-PIP Ch+ to AV. Four inputs requires 12 (4 x 3) DSMs. Five inputs would require 20 DSMs (5x4), and so on. The last step in each of these DSMs is to set the state of the Key Set. The invocation of these DSMs that can be found in the macros for CBL, DVD, TV, and VCR. Note that the last 2 commands in each of these macros are X_CANCEL and then the XSHIFT-PIP command to select the appropriate input. The X_CANCEL is required. Without this X_CANCEL the device of the XSHIFT-PIP <whichever> DSM would be either the device of the button pushed, or the last temporary device selection in the execution of of the macro. With the X_CANCEL, the choice of DSM will be controlled by the state of the PIP Key Set, as desired. The advantage of this solution is that it is pretty simple to implement and maintain. The downside is not having the use of one Key Set as it normally works. This is the solution that I ended up using.

Solution 2

Keep the state of the TV input in multiple TOADTOG bits. In the file linked above, the example is InputTrackTogBits.ir. This sounds like the complex solution that I criticized in the problem statement, but you will see it is just a variation of my Solution 1. At one point I was convinced that Solution 1 would not work, before I discovered the X_CANCEL trick used in Solution 1. I appropriated TOADTOG bits 4 & 5 to store the current state of the TV input. The same 12 DSMs are used to do the actual switching, but the PIP Key Set is not used to store the current TV input state. A TOADTOG on TV, XSHIFT-0 (and 2 subordinate TOADTOGs) will set the temporary device as specified by bits 4,5. Switching input is accomplished by invoking TV, XSHIFT-0 (setting the current device) followed by the appropriate XSHIFT-PIP command for the desired input (same as Solution 1). Each of the 12 macros that do the actual input change end with a pair of commands that set the correct values in bits 4,5 for the new input state. Even though for this exampe I left the 12 DSMs on the XSHIFT-PIP buttons, they can go anywhere regardless of Key Set and the PIP Key Set can be used in its normal fashion. This is slightly more complex than Solution 1, but has the advantage of not taking over the use of a Key Set.

General Comments

Testing is a bit of a hastle in both of these solutions since just seeing the correct input work once does not guarantee things are right - you must be sure to invoke all 12 DSMs to be sure things are OK. Both of these solutions limit the number of inputs that can be tracked to the number of devices supported by the remote. If you have more inputs to track on one device, or more than one device that needs its input tracked you have my sympathy.
Back to top
View user's profile Send private message
vickyg2003
Site Admin


Joined: 20 Mar 2004
Posts: 7053
Location: Florida

PostPosted: Sun Mar 18, 2012 11:07 am    Post subject: Reply with quote

Do you happen to have commented IR files with both solutions?

I personally like recurrsion, but that proved to be too difficult to explain in the forum.

Funny that your LG TV doesn't have discretes, I bought my LG specifically for all the discretes that it offered.
_________________
Remember to provide feedback to let us know how the problem was solved and share your upgrades.

Tip: When creating an upgrade, always include ALL functions from the oem remote, even if you never plan on assigning them to a button. Complete function lists makes an upgrade more helpful to others.
Back to top
View user's profile Send private message Visit poster's website
pH7_jp1



Joined: 14 Sep 2003
Posts: 461
Location: Sterling Heights, MI

PostPosted: Sun Mar 18, 2012 4:09 pm    Post subject: Reply with quote

Quote:
Do you happen to have commented IR files with both solutions?
Yes, that is the second link in the problem statement, above.

Quote:
Funny that your LG TV doesn't have discretes, I bought my LG specifically for all the discretes that it offered.
Yep. That is what I say in my rant, the first link in the problem statement. I felt like an idiot after recommending that TV to my sister-in-law and then finding it didn't have the expected discretes. If I was the purchaser, I would have returned the TV and got another. It is hard to explain why to someone else. Most of my family just first roll their eyes and then tend to fall asleep when I start talking about discretes and other fun stuff.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic       JP1 Remotes Forum Index -> JP1 - General Forum All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

Powered by phpBB © 2001, 2005 phpBB Group
Get Smart! the band's official homepage Rockabilly Central