Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Previous section Next section Previous page Next page Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Page 3 of 5
Topic:
New Denon AVR Pronto Module developed
This thread has 67 replies. Displaying posts 31 through 45.
OP | Post 31 made on Tuesday April 27, 2010 at 14:18
Dominator
Long Time Member
Joined:
Posts:
August 2008
33
Hi All

Sorry for the delay in responding. Took some vacation time and just got back.

I developed this module for use at home. My AVR is in a dedicated cabinet so I can't see the Denon status display from my viewing area, basically I got frustrated navigating all the menus to see status info and changing simple options.  I have been using it daily for about 2  months and can't live without it now. Performance is great and basically I feel like I am in total control.

I have been in the computer software industry for 30 years so I know what it takes to bring a software solution to market. I am considering whether or not to comercialize it. So to make that decision I want to run a beta program. Based on the outcome and feedback I will then decide to market it or not.

The big thing for me is that folk see value and have a good experience using the solution. That's why the beta program will be important to making that decision.

looks like sWORDS, Harryup and patvaughn want to particpate so that's great.

Want to do it on a variety of equiment:
Harryup - 4308
patvaughn  -  4310
sWORDs - 4306

Note: Only 3 beta testers. Sorry.

So if you guys are still in that's great, needless to say you will get the module for free for being a Beta tester.

I just need about a week to move the code (including page scripts) into a protected library so guys be patient.

Thank You all for your generous comments

Hopefully this baby will make it to market.

Dominic

Last edited by Dominator on April 29, 2010 08:48.
Dominic
OP | Post 32 made on Tuesday April 27, 2010 at 14:20
Dominator
Long Time Member
Joined:
Posts:
August 2008
33
On April 22, 2010 at 05:24, sWORDs said...
Dominic, do you have a Denon DVD/CD/BD player aswell?
My latest working unprotected libraries and project are in your mailbox, please note that the next (currently working on) version will be different. The parsing will be moved to .Parse under the command object (where .GetStatus and .Status are), and I'm thinking of an OnChange item so users can put there own functions in. Also there is a lot more in the code then in the GUI.

Hilko

Hi Hilko

No sorry I don't have a Denon DVD/CD/BD player
I use a PS3.

See previous posting .......if you still want to beta test

Cheers

Last edited by Dominator on April 27, 2010 14:48.
Dominic
OP | Post 33 made on Tuesday April 27, 2010 at 14:25
Dominator
Long Time Member
Joined:
Posts:
August 2008
33
On April 24, 2010 at 18:43, Lyndel McGee said...
Dominic,

FYI, on my 4810-CI, I just tested with Gladiator on DVD in DTS ES and I get 331 when using DTS ES which is a 6.1 source. I ALSO get 331 on a 5.1 source so it looks like we have same bug on that model as well.

When there is no inputing being fed to receiver, I get 200.

Do you know if there is a way to get the receiver to report this status without having to query?

Hi Lyndel

Bummer .....looks like they use the same code base......without good version control!!!!!

Note that if you look up the status via online GUI it reports it correctly so the bugs are in their Serial/IP interface code.

When I don't have an input signal the command returns NON.......which is Denon's equivalent to null....not sure why you are getting 200

Cheers

Dominic
Dominic
OP | Post 34 made on Tuesday April 27, 2010 at 14:45
Dominator
Long Time Member
Joined:
Posts:
August 2008
33
On April 25, 2010 at 16:12, Lyndel McGee said...
I have been working these last few days to "scale-back" and make EscientPronto perform better such that I can utilize both TCP-based control of my Denon and EscientPronto in the same activity.

Several things have come to light that those developing modules, particularly a denon module, may find of use or want to debate/discuss.

1) More objects mean slower code operation

Whenever a callback is made to your code from the system (scheduleAfter, onSocketData, etc), the Javascript garbage collection is invoked and it does make performance a bit sluggish.

In short, the more objects you have, the more sluggish the performance. Note that functions are also objects.

After talking with Belgium, this is by design as garbage collection must be invoked. In the current "Spidermonkey", there is only a single-generation garbage collection where in the newer "TraceMonkey", there is multi-generation GC. So, if TraceMonkey were in use, things would be better but there would still be some slowdown.

2) Do you really need to monitor the most obscure messages from Denon ALL THE TIME?

All the bells and whistles are nice but...

While developing a Denon module, one has to consider all the information available from the Denon. In short, you get an event/response for lots of things that you may not be interested in. For each event/response, you must look at a minimum of 2-3 characters to see if you want to process it. This takes time and if you are interested in processing "everything", your message processor code can get very large and can be very slow. Regular expressions may help but issuing xxx.test() on 200 regular expressions to find a match on the 201st one is just plain slow. So, while we would like to process everything under the sun, it almost warrants developing several message parsers that can be invoked depending upon the things one might be interested in.

For example, having a processor for all the SS*** (System Setup) messages other than maybe SSDIM does not make sense in your normal operating code as user will not likely be in setup that much. The same goes for Surround Parameter messages (PS*). Normally, one would only be interested in maybe Surround Back settings and maybe a few more.

Just food for thought...

Comment One - More objects mean slower code operation
 
Makes sense, I haven't hit this tipping point ......performance is great.....I was surprised at what our prontos could do!!!!!

I delete my dynamic objects on page exit.

Questions for you. 

1) Are they just marked for deletion for later garbage collection?
2) On page exit, do the dynamic objects get destroyed anyway.....in which case I don't have to clean up saving a few cycles or is it more efficient the way I'm doing it

Comment 2 -  Do you really need to monitor the most obscure messages from Denon ALL THE TIME?

I personally process things that are of value......diminishing returns if you do more.

What I'm interested in are undocumented commands that will automate more daily tasks.

There are a lot of obscure things that you may want to do rarely.....my philosply is do them via the screen GUI (painful as it is)......no need to code for them.

And Gimme all the bells and whistles that I need for regular use..... :)

Bells & Whistles and good performance are not mutually exclusive.

Cheers

Dominic
Dominic
Post 35 made on Tuesday April 27, 2010 at 18:31
sWORDs
Long Time Member
Joined:
Posts:
November 2006
373
Dominic, as you've previously stated that you'd like to contribute I've send my unprotected sources to you so that you can see what I did and how I did it so you can improve your code (you and Philips are the only onces that have that sources). Could you atleast send some snippets back so I can see some differences and improve mine and can comment on your code? As requested with my code I'll keep yours private aswell.

Besides that, ofcours I'd like to beta test your protected version.

Lyndel, when Philips (Koen B) checked my sources they commented that it would improve performance when all sub functions would be moved out of onData and would sit on their own. Not sure if it helps you, but maybe it's usefull.
Other ways that I'm improving my modules is by testing loops with if then else and case. (Generally speaking case is faster, but when nesting case it often is faster to switch one to if else if) I also try to do as much as possible only once on page load, including GUI.widget.
And less lines of codes is generaly better, but sometimes it helps to not put everything in sub functions but copy them in.
Someways of coding also seem to be running a bit faster:
this.SendKey = {
key_return:function(){self.Command("Sendkey(1)");},
key_enter:function(){self.Command("Sendkey(2)");},
};
[...]

is faster then:
this.SendKey = {};
this.SendKey.key_return = function(){self.Command("Sendkey(1)");};
this.SendKey.key_enter = function(){self.Command("Sendkey(2)");};
[...]

Less libs also seems to help, also not using httplib makes a huge difference (when you only need basic communication). If I don't need return values I just do a socket.write without onData.
Things that I do not have to poll constantly, (like the time I can calculate it back to a starttime and do a datediff with a scheduleafter to update) I poll as less as possible and when I need to poll multiple items I use multiple sockets (but not with Denon, which doesn't support that). When not using HTTP try to poll multiple items before closing the socket, even with multiple remotes you will get a higher average commandrate. When using multiple remotes try to optimise your timers so that all remotes find their own hole in the minute, so they don't have to wait on each other.
Not using (or as little as possible) constructor functions (those that you call with new) speeds things up really well. I only use them on page load except for new Image and a few others which I can't do without.
Also do not use GUI.updateScreen or System.delay.

The optimalisations above made my XBMC module fly. It's extremely fast now, before these it was ok-ish. I really hope I'm able to finish it up soon so I can do the same kind of rewrite on my Denon Player and Receiver modules.

And if you think TCP/IP with Denon is trouble, try to do the same with RS232, after that you'll feel a lot better. :)

Last edited by sWORDs on April 27, 2010 19:03.
Post 36 made on Tuesday April 27, 2010 at 20:26
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
On April 27, 2010 at 18:31, sWORDs said...
Lyndel, when Philips (Koen B) checked my sources they commented that it would improve performance when all sub functions would be moved out of onData and would sit on their own. Not sure if it helps you, but maybe it's usefull.

Do you have a simple example of something they commented on so we are both on the same page?

I try to never use local functions (useful for closures) in an onData() call. I'm hoping you are not referring to calling other functions, just defining local ones.

However, I will double check some code I'm optimizing to see if I find something.


Other ways that I'm improving my modules is by testing loops with if then else and case. (Generally speaking case is faster, but when nesting case it often is faster to switch one to if else if) 

Can I get an example here please? I think I understand but a picture is worth 1000 words.

And less lines of codes is generaly better, but sometimes it helps to not put everything in sub functions but copy them in.
Someways of coding also seem to be running a bit faster:
this.SendKey = {
key_return:function(){self.Command("Sendkey(1)");},
key_enter:function(){self.Command("Sendkey(2)");},
};
[...]

is faster then:
this.SendKey = {};
this.SendKey.key_return = function(){self.Command("Sendkey(1)");};
this.SendKey.key_enter = function(){self.Command("Sendkey(2)");};
[...]

Obviously, that would be the case. I try to do this as well. Note that if you are putting functions into objects over and over again, it makes sense to define a class or a single function.


function SendKey(){}
SendKey.prototype.key_return = function(){self.Command("Sendkey(1)");};
SendKey.prototype.key_enter = function(){self.Command("Sendkey(2)");};

OR

// These 2 functions defined at one time either in Page or Activity script.
function key_return (){self.Command("Sendkey(1)");};
function key_enter(){self.Command("Sendkey(2)");};
this.SendKey = {key_return:key_return,key_enter:keyEnter};


Not using (or as little as possible) constructor functions (those that you call with new) speeds things up really well. I only use them on page load except for new Image and a few others which I can't do without.

Yes, that woudl be the case, Each time you call a function with 'new', it means an additional object which adds to Garbage Collection overhead.

Also do not use GUI.updateScreen or System.delay.

Both of these are a definite no-no for any event-driven programmer.
And if you think TCP/IP with Denon is trouble, try to do the same with RS232, after that you'll feel a lot better. :)

LMAO. That is why I switched to TCP/IP, especially since the 232 via RFX9600 is not true full-duplex. A write to Serial port clears whatever data is currently in receive buffer which makes you have to wait for full response prior to sending next command. Also note that Ports 3 & 4 on RFX9600 share the same UART so doing 2-way on either of those ports will be problematic based on the lack of full-duplex. (A send on port 4 could kill data in buffer that your code is waiting to receive on port 3).

Data corruption example using Denon Channel Volume Query:

CV?
You must hold off next command until you get response line for last channel. ie. Before sending MS?.
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 37 made on Tuesday April 27, 2010 at 20:32
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
On April 27, 2010 at 14:45, Dominator said...
Questions for you. 

1) Are they just marked for deletion for later garbage collection?

1. I have been told to set unused stuff to null or delete unused fields prior to returning back to system as this will aid in JS Garbage collection. I have not dug into the implementation of Spidermonkey to say for sure. However, more objects, as noted does slow this down. It is likely the latter and not the former that you should be worried about.

2) On page exit, do the dynamic objects get destroyed anyway.....in which case I don't have to clean up saving a few cycles or is it more efficient the way I'm doing it

2a. As good practice, you should always clean up your variables.

2b. Javascript scoping rules enforce that at page exit, any variables that were declared via the page script are wiped and a GC cycle will occur. This includes both the page object scope and dynamic widgets for the page as well as any functions added to them. (See 2a).
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 38 made on Wednesday April 28, 2010 at 05:25
sWORDs
Long Time Member
Joined:
Posts:
November 2006
373
On April 27, 2010 at 20:26, Lyndel McGee said...
Do you have a simple example of something they commented on so we are both on the same page?

self = this;
this.rs232port.OnData=Function(){
    self.test = Function(a){System.print(a);}
    self.test("blaat1");
    self.test("blaat2");
    [...]
};

vs

self = this;
this.test = Function(a){System.print(a);}
this.rs232port.OnData=Function(){
    self.test("blaat1");
    self.test("blaat2");
    [...]
};

On April 27, 2010 at 20:26, Lyndel McGee said...
Can I get an example here please? I think I understand but a picture is worth 1000 words.

switch(a){
    case 1:
        switch(b){
            case y:
                execute code block y
                break;
            case z:
                execute code block z
                break;
                default: code to be executed if n is different
           }
            break;
    case 2:
        execute code block 2
        break;
        default: code to be executed if n is different
    }
}

vs

switch(a){
   case 1:
       if (b==y){execute code block y}
       else if (b==z){execute code block z}
       break;
   case 2:
       execute code block 2
       break;
       default: code to be executed if n is different
}

On April 27, 2010 at 20:26, Lyndel McGee said...
LMAO. That is why I switched to TCP/IP, especially since the 232 via RFX9600 is | not true full-duplex. A write to Serial port clears whatever data is currently in | receive buffer which makes you have to wait for full response prior to sending | next command. Also note that Ports 3 & 4 on RFX9600 share the same UART so | doing 2-way on either of those ports will be problematic based on the lack of full-| duplex. (A send on port 4 could kill data in buffer that your code is waiting to | receive on port 3).

I can't wait for the CRX, this will probably be a nice solution, open and maintain open a socket to the Denon and let the remotes communicate with only the CRX. That must be fast and even better no perfermance drops when adding remotes. I've bought a cheap Crestron processor on eBay to play with until the CRX arrives.

If you keep my source to yourselve (ofcourse you can use parts in your own code, but don't give my source to anyone else) I can email you the not yet improved Player and Receiver unprotected modules and send the improved versions as soon as they are done.

Last edited by sWORDs on April 28, 2010 08:38.
Post 39 made on Wednesday April 28, 2010 at 06:22
buzz
Super Member
Joined:
Posts:
May 2003
4,379
On April 25, 2010 at 16:12, Lyndel McGee said...
While developing a Denon module, one has to consider all the information available from the Denon. In short, you get an event/response for lots of things that you may not be interested in. For each event/response, you must look at a minimum of 2-3 characters to see if you want to process it. This takes time and if you are interested in processing "everything", your message processor code can get very large and can be very slow. Regular expressions may help but issuing xxx.test() on 200 regular expressions to find a match on the 201st one is just plain slow. So, while we would like to process everything under the sun, it almost warrants developing several message parsers that can be invoked depending upon the things one might be interested in.

It would introduce more objects, but another approach would be to use an associative array and look-up rather than "process" the return strings. ...trading more objects for fewer statements.

Has anyone compared these two techniques against each other?
OP | Post 40 made on Wednesday April 28, 2010 at 08:01
Dominator
Long Time Member
Joined:
Posts:
August 2008
33
Hi sWORDs

Sorry for the misunderstanding. What I was agreeing to was to  maintain a file of undocumented Denon commands and maybe putting them up on the forum. Not exchanging code. I am sorry for the misunderstanding. I am willing to discuss techniques and methods at the conceptual level.

Will PM you to discuss further. 

Again Sorry

Dominic
Dominic
OP | Post 41 made on Wednesday April 28, 2010 at 08:21
Dominator
Long Time Member
Joined:
Posts:
August 2008
33
On April 28, 2010 at 06:22, buzz said...
It would introduce more objects, but another approach would be to use an associative array and look-up rather than "process" the return strings. ...trading more objects for fewer statements.

Has anyone compared these two techniques against each other?

Hi Buzz

I use this data driven approach in my design. I can't compare the two in this specific case but in general you use more memory in the data driven approach but execute faster... based on other project experience. The classic tradeoff.

I also believe that initial load of libraries and other code takes longer at activity startup.....but execution should be faster overall. I have no data to back this up in this specific case. 
 
Hey maybe based on the spidermonkey (see referrence above) in the system it actually slows down the data-driven approach!!!!

Cheers

Dominic 

 
Dominic
Post 42 made on Wednesday April 28, 2010 at 08:25
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
On April 28, 2010 at 05:25, sWORDs said...
self = this;
this.rs232port.OnData=Function(){
    self.test = Function(a){System.print(a);}
    self.test("blaat1");
    self.test("blaat2");
    [...]
};

vs

self = this;
this.test = Function(a){System.print(a);}
this.rs232port.OnData=Function(){
    self.test("blaat1");
    self.test("blaat2");
    [...]
};

I immediately see the problem with first approach. You are creating a function each time OnData is called. The second approach only calls the function that already exists.
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 43 made on Wednesday April 28, 2010 at 09:12
Mikesthlm
Long Time Member
Joined:
Posts:
May 2007
26
On April 27, 2010 at 14:25, Dominator said...
Hi Lyndel

Bummer .....looks like they use the same code base......without good version control!!!!!

Note that if you look up the status via online GUI it reports it correctly so the bugs are in their Serial/IP interface code.

When I don't have an input signal the command returns NON.......which is Denon's equivalent to null....not sure why you are getting 200

Cheers

Dominic

Couldn't his be something with the firmware bug at the reciever. I Read this bug/fixes thread at...
[Link: denon-firmware-tracking.wetpaint.com]

3. Web controller Setup Menu, Information, Audio Input Signal displays incorrect format 3/3/.1 when should be 3/2/.1 as displayed in GUI interface.


There was an firmware update for the 4308 and 3808 that came out a couple of days ago

Last edited by Mikesthlm on April 28, 2010 09:24.
OP | Post 44 made on Wednesday April 28, 2010 at 09:50
Dominator
Long Time Member
Joined:
Posts:
August 2008
33
Hi Mikesthlm


Yes it is defintely with the receiver.

I'll check to see now to see if there is an update for my model.

Thanks for the update.

Cheers

Dominic
Dominic
OP | Post 45 made on Wednesday April 28, 2010 at 10:36
Dominator
Long Time Member
Joined:
Posts:
August 2008
33
Hi there is a firmware upgrade. Thanks Mikesthlm

First one in a long time.

i can confirm it didn't fix the Audio Input Signal displays incorrect format 3/3/.1 problem on my model.

The Japanese web site says:

AV Surround Amplifier AVC-A1HD
"(1) Improved the behavior of certain Blu-ray Disc."

The 4310 got a few more fixes

(1) The specific behavior during playback BD software was improved.
(2) HDMI connection for improved operation.
(3) Improved connection behavior and internet radio show.
(4) various other operating improvements.

All vague........

Cheers

Dominic

Dominic
Find in this thread:
Page 3 of 5


Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.

Hosting Services by ipHouse