| | #121 (permalink) | ||||||||
| Portal Member Join Date: Dec 2007 Location: Berlin Age: 44
Posts: 80
Thanks: 2
Thanked 2 Times in 2 Posts
Country: | Quote:
![]() Quote:
So look at this hyper terminal screenshot and believe in the old man: These 0x7Es are irrelevant (7 of 9 would like that! Well - I like 7 of 9...)Quote:
Quote:
I tell you, the 0x7E just tells you, that someone is sitting on the button! Well - this is gonna become a fight even worse than between cotholics and protestants... We somehow need our Martin Luther of the 0x7E... ![]() Quote: ![]() Quote:
![]() Greets Axel ============================================== Quote: ============================================== Quote:
__________________ Jazz oder nie! Last edited by Herr R aus B; 2008-01-03 at 00:10. Reason: Automerged Doublepost | ||||||||
| | |
| | #122 (permalink) | ||
| Portal Developer Join Date: May 2007
Posts: 498
Thanks: 1
Thanked 83 Times in 39 Posts
Country: | Quote:
NO!!! As proof, I direct your attention to the configuration screen of the next version... 8-} No... I don't like complicated... However, I do want to make sure that it is done correctly... I don't want to go from missing button presses to generating spurious duplicate button presses. I think we may have lost (or missed) something in the setup... The Temperature reading command seems to be returning 0x3F consistently now.... maybe the way that the remote buttons are handled by the display is controlled by a command that has been overlooked (or removed)... I'm trying to work my way through the previous logs to see if anything was missed. I may have been free to... but I wasn't able to... 8-} Take your time.... your only missing two or three versions of the driver 8-} Although it did seem like we were using that method while trying to get the "wake by remote" functioning! Quote:
I compile the drivers against the 0.2.3 release sourcecode, so that there is maximum compatability... so any fixes that have been done since then to any of the process plugins, do not appear in the driver... If you find that it has been fixed since the MediaPortal 0.2.3 release, let me know and I will update my sources for it. Regards, CybrMage | ||
| | |
| | #123 (permalink) | |||
| Portal Member Join Date: Dec 2007 Location: Berlin Age: 44
Posts: 80
Thanks: 2
Thanked 2 Times in 2 Posts
Country: | Quote:
But I am not quite sure. All I can say is, that regarding the remote code handling the 010208d worked better than the 010208e which I just tested. The only small reason to discuss anything was the rather high repeat frequency... Now the repeat behaviour is kinda messed up, that means being in the main menu (the one that scrolls cyclically) the folowing happens:
Maybe you might wanna give my minimal remote code handling strategy at least a little try? ;D Quote:
__________________ Jazz oder nie! | |||
| | |
| | #124 (permalink) |
| Portal Member Join Date: Dec 2007 Location: Berlin Age: 44
Posts: 80
Thanks: 2
Thanked 2 Times in 2 Posts
Country: | It's 2am here now - I am gonna send myself to standby now. Hopefully with the proper command sequence so that I will wake up again tomorrow. Will be available a little bit later tomorrow! Good luck so far! ![]()
__________________ Jazz oder nie! |
| | |
| | #125 (permalink) |
| Portal Member Join Date: May 2007
Posts: 116
Thanks: 4
Thanked 23 Times in 14 Posts
Country: | For temp handling: Code: def readTemp(fd):
# request the current temp
write(fd, 0)
write(fd, 0xAF)
time.sleep(0.000040)
res = select([fd], [], [])
if len(res[0]):
temp1 = -1
temp2 = -1
while temp2 == -1:
str = os.read(fd, 2)
if len(str) == 1:
if temp1 == -1:
temp1 = ord(str[0])
else:
temp2 = ord(str[0])
elif len(str) == 2:
temp1 = ord(str[0])
temp2 = ord(str[1])
else:
sys.stdout.write("Unexpected data during remp read: ")
for c in str:
sys.stdout.write( "0x%02x " % ord(c) )
sys.stdout.write("\n")
break
if temp2 != -1:
if 1: # farenheit
temp1 = (temp1 - 150) * 9 / 5 + 32
temp2 = (temp2 - 150) * 9 / 5 + 32
else: # celcius
temp1 = temp1 - 150
temp2 = temp2 - 150
return (temp1, temp2)
return None
and for repeating key here: http://www.nabble.com/New-driver-for...html#a14468936 |
| | |
| | #126 (permalink) |
| Portal Developer Join Date: May 2007
Posts: 498
Thanks: 1
Thanked 83 Times in 39 Posts
Country: | -Manfred-: I appreciate the pointers.... But, I have seen them before, and they are not helpful in this situation.... (they are Linux drivers, and use a totally different IO model)... Here is a new version.... I added and option to disable remote button repeat mode completely (I told you I do not like the 0x7E!! 8-} ), and I added an option to adjust the repeat key delay. The delay setting basically ignores a repeat request for the specified periof of time after the last button press. Regards, CybrMage Last edited by cybrmage; 2008-01-03 at 14:01. Reason: DRIVER REMOVED DUE TO NEW VERSION |
| | |
| | #127 (permalink) |
| Portal Developer Join Date: May 2007
Posts: 498
Thanks: 1
Thanked 83 Times in 39 Posts
Country: | Another new version... I've added an option to manage the M.Play Home Center software. When enabled (in configuration), the driver will stop the MHC program when the display is initialized (if it is running), and when the display is shut down MHC will be restarted (if it was running when the display was initialized). Regards, CybrMage Last edited by cybrmage; 2008-01-03 at 19:43. Reason: DRIVER REMOVED DUE TO NEW VERSION |
| | |
| | #128 (permalink) |
| Portal Member Join Date: Dec 2007 Location: Berlin Age: 44
Posts: 80
Thanks: 2
Thanked 2 Times in 2 Posts
Country: | And here are the results from the German jury... Hm... You might not understand that joke, coz it's european... Anyway - I tested like hell and had a big grin in my face. Now it's time to also add some tool tips to the config dialogue containing bad remote bashing words, especially describing your very personal relation to 0x7E occurences ![]() I first tested just repeating on different repeat frequencies using just the UP button. Here is what I watched:
Then I also tested fan control a little bit. Unfortunately fan control seems to be dead - is that deliberately disabled at this time? I tested two scenarios:
My interpretation especially of the remote behaviour would be that you should return to reading single byte bursts (well, bursts...) and maybe you are somehow taking over yourself regarding speed - especially using a repeat frequency below 300ms. Just a guess. As this coding just looking at logs must be a real pain I have in mind that I try to set up a little program here to maybe code a base algorithm for all this reading and writing. I dunno, how the serial port arbitration is done in MP. I would do it using a number of threads:
I think the biggest problem is that state machine, as you are coding blindly. I remember that I once set up a state machine within a CTI client simulating a telephone with all its function and getting asynch signals from a CTI server. That state machine had about 15 flags controlled by some 25 boolean equations - it was a nightmare So coding this all without being able to immediately see the results of your algorithms must be a nightmare, too...If I make it to do some coding here, it surely would be either in Java or more likely in C++ as I don't have any clue about C# that you obviously are using. Maybe Java would be better, as it seems to be rather similar to C# from what I saw. But I dunno whether I'll be able to address the COM port using Java on a XP64 machine... Never tried that. Would that be of any help for you, or would that rather insult your coder's honour? ;-) Hopefully you are not of klingon decent then... ![]() I am proposing that, because you are fighting this now since almost one week and as I am sitting in front of that bloody device I should support you as much as possible... Greetings Axel PS: What about a neat little splash screen showing the MP logo and keeping the user informed about the driver? There could also be a banner telling the declined user all the names of all the ppl who worked on that driver Maybe it shouldn't exceed 10 minutes playing time, but could also contain a clear and almost political statement by you regarding the world economy and peace under circumstances where there are too many 0x7Es which should be controlled similar to all these chinese birth control laws and... WELL! ![]()
__________________ Jazz oder nie! Last edited by Herr R aus B; 2008-01-04 at 22:17. |
| | |
| | #129 (permalink) | ||
| Portal Member Join Date: Dec 2007 Location: Berlin Age: 44
Posts: 80
Thanks: 2
Thanked 2 Times in 2 Posts
Country: | Quote:
![]() =================================== Seems to work as in kicks off MHC, but doesn't restart it after MP shutdown. Should it? Quote:
Me again - I just have been looking at the first of the URLs, Manfred posted. And I find these little functions interesting, as there are some, we obviously never took into account - these are the gotoXY function, that also sends a 0xA7 that we couldn't determine its meaning so far and the initFans function. The other functions match pretty good our results... Unfortunately we still can't be sure whther this 0xA4 0x7E we discussed here really is setting the display to internal standby mode or to display the internal time. If 0xA4 0x7D really means "init fans" than 0xA4 0x7E might be "init display" meaning setting the display to its internal standby screen... Maybe these delays they are using in there functions might be of any interest... Finally this cler function explains the 0xA0... Code: def write(fd, v):
os.write(fd, chr(v))
def writeChr(fd, c):
os.write(fd, c)
def writeLn(fd, ln):
for i in range(0, min(len(ln), 20)):
writeChr(fd, ln[i])
time.sleep(0.000040)
def clear(fd):
write(fd, 0xA0)
time.sleep(0.000040)
def gotoXY(fd, x, y):
write(fd, 0)
write(fd, 0xA1+y)
write(fd, x)
write(fd, 0xA7)
time.sleep(0.000040)
def initFans(fd):
write(fd, 0)
write(fd, 0xA4)
write(fd, 0x7D)
def setFans(fd, fan1, fan2):
write(fd, 0)
write(fd, 0xAC)
write(fd, fan1)
write(fd, fan2)
time.sleep(0.000040)
def setChars(fd, chars):
write(fd, 0)
write(fd, 0xAD)
for char in chars:
for row in char:
write(fd, row)
time.sleep(0.000040) Code: 00 . A1 ¡ 00 A7 .§ 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 00 . AF ¯ 00 . A2 ¢ 00 A7 .§ 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
__________________ Jazz oder nie! Last edited by Herr R aus B; 2008-01-03 at 16:42. Reason: Automerged Doublepost | ||
| | |
| | #130 (permalink) | |||||
| Portal Developer Join Date: May 2007
Posts: 498
Thanks: 1
Thanked 83 Times in 39 Posts
Country: | Is that anything like "views from the banana republic"?? 8-} [quote=Herr R aus B;220366]Now it's time to also add some tool tips{/QUOTE] I've been considering making a change to the config screen... "Disable remote" becomes "enable remote" with the default value being "disabled"... Then when the remote is enabled: 1) present a "Are you sure?" dialog 2) If the user selects "Yes", present an "Are you really sure?" dialog. 3) If the user selects "Yes", present an "Are you really, really sure?" dialog. . . . 42) If the user selects "Yes", present an "Well... OK... It's not advisable.... but..." messagebox. 43) present an "Enabling the remote can cause undesirable side effects... Are you really sure?" dialog. 44) If the user selects "Yes", continue at step 1. Is that OK??? maybe I should just stick with what we've got!? 8-} Quote:
What happens if you press a single button then wait... does the event get firesd ok?? What about repeatedly pressing a button quickly 4 (or 5, or however many) times?? do all the events get fired, or do some get "missed"?? No... The fan control is NOT diliberately disabled... It's just that the device now seems to only return 0x3F to the request for temperature information... I haven't been able to look at your fan logs yet... (the message board won't seem to send me the file.. it gets half way and stops... likely a transient problem... will try again after I finish my replies) So... that means that the fan control is the ULTIMATE option for the HTPC crowd... Doesn't everyone want an absolutely silent HTPC????? Consider it an added bonus from the programmer 8-}!! (JK!!) Unfortunately, the doing a polled serial routine is rather difficult... Once the driver is configured and initialized, it goes to "slepp"... The driver is called by the base ExternalDisplay plugin every time that it needs to update the display (by calling the SetLine() function), which happens every 250 to 350ms... (actually, the SetLine() function is called twice every 250ms to 350ms, once for each line of the display...) In the small period of time available to us we have to send the display data to the screen, and then process a single byte of information... So what would happen is that the user will press a number of buttons per second to do their navigation... because we are only processing data every 250 - 350ms, the button will not cause actions right away, so the user will press the button again... which does not respond right away, the they press the button again... Since we can only process 6 to 8 bytes per second, that leads to ever increasing lag in remote response time. If we try to process all the keys that are in the data buffer, we will end up exceeding the reasonable amount of time that we have to process the data (approximately 100 to 150ms)... and that will result in a lag in the information that is displayed on the device.... The way we (and all other code in MediaPortal the uses the serial port) handle serial communications is to use the events that are available with the SerialPort class. The SerialPort class is the c# interface to the serial hardware, and provided data (RX and TX) buffering and events to indicate various changes to the state of the serial port. The driver adds it's data handling routine to the DataReceived event for the serial port we open. When data is received on the serial port, the system creates a new thread (independant of the driver thread) to handle run our WhenDataReceived event. This event is fired whenever the data in the read buffer exceeds a predefined threshold. This allows us to respond to a button press as soon as it is generated by the device rather than up to 1/3 of a second later. The problem is - the buffer will contain as many bytes of data as was received from the display... If we decide not to read any of these bytes in our handling routine, then as soon as another byte of data is received, the event is fired again, and another copy of the WhenDataReceived() function is started to process the NEW data... To prevent this, I have added code that prevents this second instance of the WhenDataReceived thread from running until the first one has completed... (this was 4 or 5 versions back...) The WhenDataReceived() function will individually process each byte of data available to it.... But it appears that when you press a single button on the remote (and then wait several second), The device generates a byte to represent the button and then a 0x&E (damn them!)... It you press a series of buttons in quick succession, the device with generate individual bytes for each of the buttons pressed AND a 0x7E at the end... The latest version of the WhenDataReceived() does the following: 1) read the data from the read buffer into a storage buffer 2) scann the storage buffer to eliminate bytes that are not remote button codes or temperature values (and removes the 0x7E if the "disable repeat" option is selected) 3) process each remaining byte with the following criteria a) if the byte is a temperature value, record it to the appropriate temperature variable (using a simple state machine to track the the read temperature command is sent and how many temperature reading have been received) b) if the byte is a button code and is NOT 0x7e: remember the value in a single byte cache... If the cache already contains a value, then fire the event for the cached button and discard it before storing the current value c) If the byte is 0x7E: c1) If the button cache contains a valid button then fire the event for that button and invalidate the cache. c2) If the button cache is empty AND the delay period has not expired, ignore the 0x7E byte. c3) If the delay period has expired, then fire the last button event again. I would normally do that as well... but MediaPortal sometimes has a hard time shutting down when additional threads are used... even when thread safe flags and even brute force is used to terminate these threads, causeing MediaPortal to hang on exit... I would like to avoid using additional threads if at all possible. Quote:
Quote:
C# is a "managed code" environment... c++ and Java are not... Even though they have similar classes for serial communications and are functionally equivilent, they exhibit different behavior... Although it would be a good educational experience. I am of Scottish decent.... Klingons dcended from us 8-} Your support has been termendous!!! far better than the support that I have received for any of the other drivers I have written.... Thank you!! You mean in a similar fashion to the "enable remote" option?? 8-} Quote:
Quote:
Unfortunately, V Systems was lazy when they wrote the installer for MHC... The installer creates a registry entry that indicates that it was installed... but they do not record the installation path.... I expected the restart to be problematic.... So the driver already has logging to help with the restart problem... I'll make changes as soon as I manage to see the logs... Yes, the "clear display" was explained... The GotoXY function is due to the way their driver framework operates and the programmers style... It is a variation of the 0xA1 0x00 and 0xA2 0x00 functions we use... They use the 0xA7 command with a single character, preceeding it with the cursor positioning command... We use the 0xA& command with an entire line of data... (and the trailing 0x00 is the end of data marker) The InitFans command is a new definition for a code that we already use (and doesn't seem to work right now) The thread you pointed out with the post by Dero yieled some interesting results... It indicates that there is definately a command that controlls the "power mode" of the device (either "ACPI", where the device intercept the power button on the remote, or "Pass through" mode, where the button code is passed to the computer for processing). Unfortunately, their device is the MR700, and the commands do not correlate with the MR300... Regards, CybrMage PS: HOLY CR!!! I had to post this as 10 seperate posts... The board would not let me post it as one.... I guess VL Systems does not want info about their devices leaked so they are going to EXTREAME lengths 8-} Last edited by cybrmage; 2008-01-03 at 18:54. Reason: Automerged Doublepost | |||||
| | |
![]() |
| Bookmarks |
| Tags |
| hd135, mplay, vfd, vlsys, zalman |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Zalman VFD in PM | Takke | General Support | 3 | 2008-01-04 13:20 |
| Zalman HD160XT Gehäuse Diskusion | Muschi | Hardware | 10 | 2007-12-29 18:18 |
| Set-up Zalman HD160XT Remote | Giorgio_ap | Support | 4 | 2007-07-05 12:44 |
| Zalman HD160 advice | aarond | Hardware Selection Help | 13 | 2007-01-12 09:06 |
| Problems with Zalman HD160 | steviweavi | HTPC Projects | 6 | 2006-06-09 15:46 |