LinuxMCE Forums

General => Users => Topic started by: wombiroller on February 09, 2009, 03:55:13 am

Title: Denon AVR 2307 - house to sleep mode while media is playing
Post by: wombiroller on February 09, 2009, 03:55:13 am
Hey All,

Got myself a Denon AVR 2307 yesterday and was very impressed with the plug and play nature!!! (USB to RS232 cable)  ;D ;D

I did notice some odd behaviour though - hoping someone may be able to assist.

Prob1
I added the  Off command to the AVR under the Stop Media command in "House to Sleep" scenario.

This works (turns the AVR off) but it only _stays_ off if I run the scenario when no media is playing prior to running the scenario...

If I have audio or video playing and run the scenario - the media and amp get turned off, but then about 10sec later the amp comes back on again (not the media)....I tried adding a delay of ten seconds between the stop media and off command - but other than delaying the amp from switching off - it didn't fix the problem (it still comes back on).

When no media is playing - the AVR 2307 stays off when the house to sleep scenario is run.

Prob2
When I select new media, it starts to play immediately - but after a second or so - audio cuts out as Linuxmce seems to reset the Denons outputs. Then starts playing again. This doesn't happen if I change songs in a playlist - but if I load a new playlist or new media it happens every time...

Both problems are pretty minor but annoying no-the-less. Any ideas?

Cheers,
Adriel.




Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: posde on February 09, 2009, 08:16:19 am
[..]
Prob2
When I select new media, it starts to play immediately - but after a second or so - audio cuts out as Linuxmce seems to reset the Denons outputs. Then starts playing again. This doesn't happen if I change songs in a playlist - but if I load a new playlist or new media it happens every time...

As a heads up. I have seen the same problem with a different amp (Meridian Audio System). My assumption is, it has nothing to do with the amp, but with the sound card.

What sound card do you use?

Code: [Select]
root@moon67:~# lspci -v -s 00:1b.0
00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 02)
Subsystem: ASUSTeK Computer Inc. Unknown device 829f
Flags: bus master, fast devsel, latency 0, IRQ 22
Memory at fbff8000 (64-bit, non-prefetchable) [size=16K]
Capabilities: [50] Power Management version 2
Capabilities: [60] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 Enable-
Capabilities: [70] Express Unknown type IRQ 0

        *-multimedia
             description: Audio device
             product: 82801I (ICH9 Family) HD Audio Controller
             vendor: Intel Corporation
             physical id: 1b
             bus info: pci@0000:00:1b.0
             version: 02
             width: 64 bits
             clock: 33MHz
             capabilities: pm msi pciexpress bus_master cap_list
             configuration: driver=HDA Intel latency=0 module=snd_hda_intel


It is an Asus P5K.

Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: wombiroller on February 09, 2009, 12:04:31 pm
Hey Posde...

Well spotted...it is a Asus PK5Pro MOBO... lspci  shows exact same info (copy paste from telnet):

Code: [Select]
00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller                            (rev 02)
        Subsystem: ASUSTeK Computer Inc. Unknown device 829f
        Flags: bus master, fast devsel, latency 0, IRQ 22
        Memory at fbff8000 (64-bit, non-prefetchable) [size=16K]
        Capabilities: [50] Power Management version 2
        Capabilities: [60] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0                            Enable-
        Capabilities: [70] Express Unknown type IRQ 0

I take it I'll just have to live with it?



Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: posde on February 09, 2009, 01:11:52 pm
I am not sure that one has to live with it.

Two options
* Wait for 0810 an hope it will solve the problem
* Buy a PCI soundcard and use that.

Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: tschak909 on February 09, 2009, 06:37:48 pm
Actually, the problem is in the device template itself, I'm assuming you're using the AVC-A1SRA template?

I had to do some Denon work for Totallymaxed, and we spotted this in the original template. I subsequently made a device template specifically for the 2308.

Basically, there is a mute command in the power command that gets executed after 2 seconds, it just needs to be removed. (look in the Ruby Codes for the template.)

-Thom
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: posde on February 09, 2009, 07:08:13 pm
Thom,

it would be nice, if this fixes the problem for wombiroller.

I suspect, it won't. As I see the same problem with the Meridian Soundprocessor, where I wrote the device template myself. It is a problem of the driver for the sound chip on the mainboard it seems.

@wombiroller: Check the device template, and see if Thom's suggestion help you. Would be the cheapest fix ;)
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: tschak909 on February 09, 2009, 07:49:49 pm
Hm sorry, I am remembering more.. I made a function called switchInput(input) in Private Method Listing

Code: [Select]
def switchInput(newinput)

   if newinput = @currentInput
   else
      @currentInput = input
      conn_.Send(newinput)
   end

end

now replace the different input commands with: switchInput("DVD")  etc.
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: wombiroller on February 09, 2009, 11:24:07 pm
Thanks Gents - i'll try when I get home tonight :-)
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: wombiroller on February 10, 2009, 11:41:13 am
I stupidly f'd up a device template in the ruby code and can't find how to put the original one back in....
Wizard => Generic Serial Devices => AVC-A1SRA (RS232) => Ruby Codes => internal => #355 Process Initialize

If someone has the original code handy it'd be appreciated :)
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: posde on February 10, 2009, 12:25:39 pm
[..]
If someone has the original code handy it'd be appreciated :)

I regularly fuck up some existing templates. What I do is, I go into the web admin, Advanced / sqlCVS / Diff, and check all DCE and IR. lmce goes out, checks the sqlCVS version of my templates, and on the following screen, I select the tables I want to revert to their original information.

The first 4-5 times, I did not select the right tables and totally screwed my installation. Nowadays this works fairly well ;)
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: wombiroller on February 10, 2009, 12:56:01 pm
I regularly fuck up some existing templates. What I do is, I go into the web admin, Advanced / sqlCVS / Diff, and check all DCE and IR. LinuxMCE goes out, checks the sqlCVS version of my templates, and on the following screen, I select the tables I want to revert to their original information.

The first 4-5 times, I did not select the right tables and totally screwed my installation. Nowadays this works fairly well ;)

Saviour! Great advice posde - worked a treat and I even remembered not to kill my gyro changes!  ;D
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: wombiroller on February 10, 2009, 01:22:28 pm
Thom, Posde - thanks again for your help... I can confirm, after core reset - this minor but annoying issue (#2) is now resolved  :D

For the record - this is what I have now:
#373 Private Method Listing
Code: [Select]
def TestPrivate()
print "In TestPrivate\n"
end

def switchInput(newinput)

   if newinput = @currentInput
   else
      @currentInput = input
      conn_.Send(newinput)
   end

end

#355 Process Initialize
Code: [Select]
#31-May-06 14:13 init Denon AVC

initok=false


# It doesn't respond to anything but power on when it's off.  Before turning it on and off
# See if it responds to something it normally would while it's on

for iRetry in 0...4
    print "Initializing unit\n"
conn_.Send("MVUP\rMVDOWN\r")
    buf = conn_.Recv(200, 1000)
    if( !buf.nil? && !buf.index("MV" ).nil? )
        print "Initialized ok\n"
initok=true
break
else
print "Didn't respond to mv up/down\n"
end
end

if initok==false
for iRetry in 0...4
print "Initializing unit\n"
conn_.Send("PWON\r")
sleep(3);
conn_.Send("PWSTANDBY\r");
buf = conn_.Recv(200, 4000)
if( !buf.nil? && (!buf.index("ON" ).nil? || !buf.index("STAND" ).nil? || !buf.index("OFF"

).nil?) )
print "Initialized ok from off state\n"
initok=true
break
else
print "Failed to initialize\n"
end
print "Failed to initialize.  Wait 1 secs and try again\n"
sleep(1)
end
end

if initok==false
DisableDevice( device_.devid_, true )
print "The device wouldn't respond. Disabling it.\n"
return
end

print "Initialized ok, doing log\n"

$logFile = File.new("/var/log/pluto/DenonAVC.log", "w")
$SoundLevel = 0

#buffer for reading from serial
$line=String.new
$lineIndex=0

$waitTime = 3000      #wait time in comunication

$eventCode = {
"MS"    =>    "Mode surround",
"PS"    =>    "Parameter settings",
"TF"    =>    "Tone frequency",
"TP"    =>     "Tuner present",
"TM"    =>     "Tuner band",
"PW"    =>     "Power",
"MV"    =>     "Master volume",
"CV"    =>     "Chanel volume",
"MU"    =>     "Mute",
"SI"    =>    "Select Input"
}

$inputSources = {
switchInput("VDP")             =>        176,
switchInput("VCR-3")          =>        284,
switchInput("VCR-2")            =>        283,
switchInput("VCR-1")           =>        282,
switchInput("V.AUX")           =>        285,
switchInput("TV" )               =>       161,
switchInput("TUNER")          =>       166,
switchInput("PHONO")           =>       163,
switchInput("MD/TAPE2")     =>       174,
switchInput("DVD")             =>       165,
switchInput("DBS/SAT")        =>       281,
switchInput("CD")             =>       162,
switchInput("CDR/TAPE1")     =>       420
}

Worth a note in the Wiki or will this be a moot point in 0810?

Cheers,
Wombiroller.
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: posde on February 10, 2009, 01:26:50 pm
Let's hope that the device template in sqlCVS is going to be updated ...
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: jondecker76 on February 10, 2009, 02:40:08 pm
file a bug report with the instructions in Trac to make sure it doesn't get lost and make sure it makes it into 0810
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: wombiroller on February 10, 2009, 11:40:36 pm
file a bug report with the instructions in Trac to make sure it doesn't get lost and make sure it makes it into 0810
http://svn.linuxmce.org/trac.cgi/ticket/111  :)
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: wombiroller on February 11, 2009, 10:34:37 am
Sorry guys - this doesn't appear to be a fix after all. Turns out the template stopped working (couldn't switch inputs at all). Once I fixed this and re-added the code... problem remains. Left a note on the ticket... Oh well.
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: alx9r on April 11, 2009, 01:04:52 am
I regularly fuck up some existing templates. What I do is, I go into the web admin, Advanced / sqlCVS / Diff, and check all DCE and IR. lmce goes out, checks the sqlCVS version of my templates, and on the following screen, I select the tables I want to revert to their original information.

The first 4-5 times, I did not select the right tables and totally screwed my installation. Nowadays this works fairly well ;)

Wow.  I'm surprised this actually works.  I have heard from devs that the sqlCVS portion of the admin page is known to not work right, so proceed with caution.

When I tried using the revert command I narrowed my revert to one checkbox (out of about 15) then clicked revert.  After the revert, I re-diffed.  To my surprise there were no differences -- the revert had ostensibly wiped out all my changes.  I checked some device templates that I had modified and thought I had sheltered from revert.  Sure enough the were reverted to their original form.

Beware of unexpected results with this trick.  Despite the shortcomings I have found this feature handy. 

Alex
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: alx9r on April 12, 2009, 06:58:00 am
Hey All,

Got myself a Denon AVR 2307 yesterday and was very impressed with the plug and play nature!!! (USB to RS232 cable)  ;D ;D

I did notice some odd behaviour though - hoping someone may be able to assist.

The AVC-A1SRA (RS232) device template has some shortcomings:

Delay after Power On Command
No commands can be sent to the receiver for 6 seconds after a power on command is sent to the device.  Power commands seem to be sent to the device by the router even if the receiver is already powered on.  The result is that commands seem to get delayed (or maybe lost) during this rather long wait period. 

The solution is as follows:
1.  Move the delay from the "Delays" portion of the template in to ruby code for the power on command and put an appropriate sleep there to allow the unit to power up before commands are sent to it.
2.  In the power on command, only sleep and send the power on string to the receiver when it is off.  That is, keep track of the power state and ignore extraneous power on commands.

As a side note, I'm pretty sure that this same problem plagues the Marantz SR Series template.

Audio is Interrupted Whenever an Inputs String is Sent to the Receiver
Whenever a string is sent to the receiver that selects an input, the audio is interrupted.  This happens even if the input is not changed.  Input commands are sent to the device by the router even if the input is not changing.  The result is a gap in audio whenever media playback is started.

The solution is as follows:
In the ruby code, keep track of which input is currently selected.  Only send an input selection string to the receiver when the input changes.  That way a gap in audio is only heard when the input actually changes.


I have a new Denon AVR/AVC series device template that incorporates those changes if anyone is interested.

Regards,

Alex
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: tschak909 on April 12, 2009, 08:21:50 am
I should have mentioned something, but...

I did this work for totallymaxed back in February, doing these exact fixes. They are a part of 0810.

-Thom
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: totallymaxed on April 12, 2009, 11:34:51 am
Actually, the problem is in the device template itself, I'm assuming you're using the AVC-A1SRA template?

I had to do some Denon work for Totallymaxed, and we spotted this in the original template. I subsequently made a device template specifically for the 2308.

Basically, there is a mute command in the power command that gets executed after 2 seconds, it just needs to be removed. (look in the Ruby Codes for the template.)

-Thom

Thats right. You have that 2308 template in the 0810 branch Thom don't you? If not let me know and we'll upload it.

Sorry...didn't read Thoms follow-up post ;-)

Andrew
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: alx9r on April 12, 2009, 03:31:19 pm
I did this work for totallymaxed back in February, doing these exact fixes. They are a part of 0810.

Great!
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: alx9r on April 22, 2009, 03:16:00 am
I've been asked to post my Denon AVR Series Template.  Here's how to use it.

Manually replicate the AVC-A1SRA (RS232) device template, with the following exceptions:
   * In the 'Edit IR Codes' window set 'Delays' for 'Power', 'Mode', and 'Other' to zero.
   * Fill in the ruby rectangles according to the file that I've attached.

Hope this helps someone. 

The template addresses the following issues with the AVC-A1SRA (RS232) template:
   1. Sets a reasonable volume level when power is shut off.  This avoids loud initial volume after starting up.  The ideal way to accomplish this is by using 'Respond to Events'.  However, the router sends the volume set command before the power on command, so if the receiver is off when you start to play media, a set volume command sent in response to a Play Media event is ignored.
   2. Delay after Power On Command (see my previous post)
   3. Audio is Interrupted Whenever an Inputs String is Sent to the Receiver (see my previous post)

Thom has an independently developed improved template that will be included in 0810.  Hopefully it will address the same issues so the Denons will work great right out of the box.

Alex
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: dlewis on April 22, 2009, 02:54:10 pm
Could you please create a wiki on this?
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: alx9r on April 22, 2009, 06:01:12 pm
It is in my list of things to do, but it's a low priority because it will be obsolete as soon as 0810 is out.

Alex
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: UNi on April 23, 2009, 05:05:34 am

I don't have my Denon receiver connected yet but I wanted to set up the template to get it ready for the install.  When I go into "edit IR codes", it says "ERROR  Cannot retrieve IR codes", then I click retry and this appears: Device template # 0 was not found

Is this because it can't pull the IR codes off the Denon?

Just want to be sure nothing's broken here...

-UNi 
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: alx9r on April 23, 2009, 06:14:42 am
I don't have my Denon receiver connected yet but I wanted to set up the template to get it ready for the install. 

UNi,

There is a template called "AVC-A1SRA (RS232)" that shipped with 0710RC2 that works quite well (aside from the few minor issues I mentioned earlier in this thread) with Denon receivers.  There is also a script that automatically detects that a Denon receiver is connected to the serial port and selects the "AVC-A1SRA (RS232)" template.  What this means is that Denon receivers are pretty much plug and play.  That is, you shouldn't have to do anything more than plug your receiver in and follow the prompts in the setup wizard.

You should definitely try to get to the point where you can control your Denon the plug and play way before attempting to create a new, improved device template for use with it.

Hopefully that helps a bit.

Alex
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: UNi on May 18, 2009, 06:37:22 pm
I used your template and it seemed to fix the issue also that when I went to Power, and then Off, that my amplifier didn't try to turn itself right back on again...using 710.

Thanks!
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: alx9r on May 20, 2009, 01:20:38 am
I used your template and it seemed to fix the issue also that when I went to Power, and then Off, that my amplifier didn't try to turn itself right back on again...using 710.

Thanks!

You're welcome.  I'm glad it helped you.
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: PcCowboy on May 20, 2009, 07:15:08 am
ya i was thinking a compatible class 2 nano BT.

(Wow...strange. i sooo thought i posted this in my thread...sorry)
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: UNi on May 27, 2009, 06:01:41 pm
I've lost my ability to control the volume using my Gyration remote for my Denon AVR-2307CI, using this template.  It worked for a while.  Now I get these messages:


Error while calling method: Cannot call class method: cmd_282
error: undefined method `switchInput' for #, line: 95
backtrace:
   in: (eval): 95
   from (eval):95:in `cmd_282'
   from (eval):95

01   05/27/09 8:39:48.316      Receive string failed in HandleRequestSocket 18:ReceiveData failed Command_Impl1 Dev #50 <0xb607cb90>
01   05/27/09 8:44:28.944      Error while calling method: Cannot call class method: cmd_282
01   05/27/09 8:44:28.944      For obscure reasons could not handle the message <0xb57e1b90>
01   05/27/09 8:44:54.867      Error while calling method: Cannot call class method: cmd_282
01   05/27/09 8:44:54.867      For obscure reasons could not handle the message <0xb57e1b90>
01   05/27/09 8:45:01.034      For obscure reasons could not handle the message <0xb57e1b90>

How can I diagnose what might be wrong?  The receiver does play the sound...just cannot control the sound with my remote, when before I could.   CMD_282 equates to my Receiver Input that I told it to use.

Not sure if it's a Gyration issue or some other issue...

+++++ Update

I didn't have any values in the Volume Up / Volume Down Ruby Codes boxes #90 and #89 fields...I also seem to be missing the following from your Template.

#350
#313

Do you know why that would be?
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: alx9r on May 29, 2009, 09:19:17 pm
I didn't have any values in the Volume Up / Volume Down Ruby Codes boxes #90 and #89 fields...I also seem to be missing the following from your Template.

#350
#313

Do you know why that would be?


Hmm...I have found that the contents of some ruby rectangles in device templates can get deleted when editing seemingly unrelated parts of the device template.  I haven't had this happen, however, unless I was editing the template.

Alex
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: UNi on May 30, 2009, 05:58:38 pm
My sound volume is all jacked up now...is there a way to revert to the old template?  I see how to do it through sqlcvs, but I'm not sure which tables to revert, or should I wait until 810?

Thanks,
UNi



It's fixed now...I was able to roll it back.
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: posde on May 31, 2009, 03:51:14 pm
My sound volume is all jacked up now...is there a way to revert to the old template?  I see how to do it through sqlcvs, but I'm not sure which tables to revert, or should I wait until 810?

Thanks,
UNi



It's fixed now...I was able to roll it back.

web admin / Advanced / sqlCVS / Diff - Revert is very helpful indeed :)
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: wombiroller on February 24, 2010, 06:12:36 am
I've been asked to post my Denon AVR Series Template.  Here's how to use it.

Manually replicate the AVC-A1SRA (RS232) device template, with the following exceptions:
   * In the 'Edit IR Codes' window set 'Delays' for 'Power', 'Mode', and 'Other' to zero.
   * Fill in the ruby rectangles according to the file that I've attached.

Hope this helps someone. 

The template addresses the following issues with the AVC-A1SRA (RS232) template:
   1. Sets a reasonable volume level when power is shut off.  This avoids loud initial volume after starting up.  The ideal way to accomplish this is by using 'Respond to Events'.  However, the router sends the volume set command before the power on command, so if the receiver is off when you start to play media, a set volume command sent in response to a Play Media event is ignored.
   2. Delay after Power On Command (see my previous post)
   3. Audio is Interrupted Whenever an Inputs String is Sent to the Receiver (see my previous post)

Thom has an independently developed improved template that will be included in 0810.  Hopefully it will address the same issues so the Denons will work great right out of the box.

Alex
Hi All,

Does anyone know if this (or something similar) made it into 0810? I still get the same audio cut out issues with the 0810 Beta...

Cheers,
WR.
Title: Re: Denon AVR 2307 - house to sleep mode while media is playing
Post by: alx9r on November 03, 2010, 04:27:12 pm
Does anyone know if this (or something similar) made it into 0810? I still get the same audio cut out issues with the 0810 Beta...

Cheers,
WR.

No.  On 0810 snapshot 23359 the only Denon listed under the "Amps..." device category is the "AVC-A1SRA (RS232)" template.  This template works, however, it still exhibits the audio cut-out problems I outlined in my post #17 here.  There doesn't seem to be any mechanism to shunt extraneous power and input selection commands which is what causes the audio to cut out. 

I am trying to get a properly fixed device template into production here:
http://forum.linuxmce.org/index.php?topic=10896.msg75284#msg75284

...but that is uncharted waters for me. 

Alex