02-05-2011, 02:03 PM
I'm going to start this thread here as the Denon 3805 driver comes with CQC. I have analyzed the behavior of my 3805 with regards to the stock driver and concluded that some changes need to be made to the driver in order for it to behave properly.
As was stated in this message by jrlewis 2+ years ago the 3805 driver goes through the unnecessary step of turning on zones 2 and 3 when the driver initializes to set their states so that they can be known. This is not at all required.
By issuing a Z1? (really zone 3, don't ask) or a Z2? the receiver will respond back with the state of each zone by sending the following: (based on my tuner's current states)
Z1? returns
Z1TUNER (selected input)
Z180 (volume level)
Z1OFF (power state)
Z2? returns
Z2TUNER (selected input)
Z246 (volume level)
Z2OFF (power state)
What is not clear to me is whether the driver can handle multiple responses from one command. On initial inspection it does not appear that it will recurse through the buffer until the end is reached, once it finds a valid response and associated text it exits. Dean, some help here would be most appreciated. Below is the WaitForEvent processing code:
I have verified that the receiver will respond correctly from a cold power off (unplugged it) from hyper terminal (prior to CQC driver being initiated) with the appropriate responses.
What I think needs to happen is:
Help here would be most appreciated!
Thanks,
-Ben
As was stated in this message by jrlewis 2+ years ago the 3805 driver goes through the unnecessary step of turning on zones 2 and 3 when the driver initializes to set their states so that they can be known. This is not at all required.
By issuing a Z1? (really zone 3, don't ask) or a Z2? the receiver will respond back with the state of each zone by sending the following: (based on my tuner's current states)
Z1? returns
Z1TUNER (selected input)
Z180 (volume level)
Z1OFF (power state)
Z2? returns
Z2TUNER (selected input)
Z246 (volume level)
Z2OFF (power state)
What is not clear to me is whether the driver can handle multiple responses from one command. On initial inspection it does not appear that it will recurse through the buffer until the end is reached, once it finds a valid response and associated text it exits. Dean, some help here would be most appreciated. Below is the WaitForEvent processing code:
Code:
// any incoming async events in the process. It returns True if the
// event was recieved (and puts the text into ToFill) or False if it
// timed out.
//
Method WaitForEvent([In] DenonEvs EvToGet
, [Out] String ToFill
, [In] Boolean ThrowIfTimeout
, [In] Card4 WaitFor) Returns Boolean
Begin
Locals=
Card4 EndTime(m_TimeInfo.GetCurMillis() + WaitFor);
Card4 CurTime;
Boolean RetVal(False);
DenonEvs EvCur;
EndLocals;
While(True)
// Wait the remaining time for an event.
CurTime := m_TimeInfo.GetCurMillis();
If (CurTime >= EndTime)
If (ThrowIfTimeout)
Throw(DenonErrs.TimeOut);
Else
Break;
EndIf;
EndIf;
EvCur := GetEvent(ToFill, ThrowIfTimeout, EndTime - CurTime);
//
// If we got nothing, then we are done since we waited for all
// of the available time. We cannot get here unless
// ThrowIfTimeout is false, so we never need to throw a
// timeout here.
//
If (EvCur = DenonEvs.None)
Break;
EndIf;
//
// Process the message if we recognize it. This will store the
// data in the appropriate fields. Note that he uses our
// incoming string as a temp, to be more efficient, so it
// can be changed when we get back here.
//
If (EvCur != DenonEvs.Unknown)
ProcessEvent(EvCur, ToFill);
EndIf;
//
// If it's what we wanted, or they don't care as long as we get
// something, then break out with success
//
If ((EvCur = EvToGet) || (EvToGet = DenonEvs.Unknown))
RetVal := True;
Break;
EndIf;
// Give a little more time to make up for processing this one
EndTime += 10;
EndWhile;
Return RetVal;
EndMethod;
I have verified that the receiver will respond correctly from a cold power off (unplugged it) from hyper terminal (prior to CQC driver being initiated) with the appropriate responses.
What I think needs to happen is:
- Eliminate the power the zones on to set their state arbitrarily at driver start
- Modify driver to handle 3 responses from one command to get zone states
- Modify driver initialization to also grab zone states
- Modify receiver state polling sequence by adding zone 2 and zone 3 status requests
Help here would be most appreciated!
Thanks,
-Ben