Quantcast

Marantz RC5 22 bits (Extend Data Word), possible with lircd.conf semantic ?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Marantz RC5 22 bits (Extend Data Word), possible with lircd.conf semantic ?

lirc_ml_sf

    Hi,

    I've got a Marantz remote control RC003PM. This a kind of multi-standard remote as it sends classical 14 bits RC5 for the TUNER function but uses at least two other standards for other functions. The main of these two others is a RC5 modified to be longer up to 22 bits in length (17 bits of data). It seems this is called Marantz Extend Data Word (see chronogram below).

    My question is : How to introduce two space bits (below in cyan) inside an RC5 (that never returns to zero by definition) ? I tested but found no options of lircd.conf to do so (pre, post, pre_data, post_data). Is there a solution ?

    Thanks all !

David.



Protocol description :


AUX function, buttons chronograms :



The remote :



------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Marantz RC5 22 bits (Extend Data Word), possible with lircd.conf semantic ?

Mona
lirc_ml_sf wrote
The main of these two others is a RC5 modified to be longer up to 22 bits in
length (17 bits of data). It seems this is called Marantz Extend Data
Word (see chronogram below).

My question is : How to introduce two space bits (below in cyan)
inside an RC5 (that never returns to zero by definition) ?

bffebjjh.png (28K) http://lirc.10951.n7.nabble.com/attachment/9784/0/bffebjjh.png
Your Marantz Extend Data Word and chronogram is actually the RC5x protocol. I have the same problem with a Marantz SR8000 AV receiver (RC2000 MkII or RC-18SR remote). I almost got it to work using "pre" and "pre_data". For example, Marantz code 16 12 01 (discrete power on) would encode as 1101 0000 (2 bit space) 0011 0000 0001.

begin remote
  name        RC5x
  bits           20
  flags         RC5|CONST_LENGTH
  eps           30
  aeps         100
  one          890   890
  zero          890   890
  gap          125000
  toggle_mask  0x20000   # toggle_bit 3
  frequency      36000

  pre_data_bits  8
  pre_data        0xD0       # System = 16, limited to commands 0-63
  pre                0    3560 # No pre pulse, pre space of 2 bit times (890*4)

  begin codes
    power_on     0x301 # 16 12 01
    power_off     0x302 # 16 12 02
  end codes
end remote

Unfortunately, lircd won't send the pre pulse/space unless BOTH values are non-zero. It would be an easy code fix that shouldn't break anything else. From lircd 0.9.0 (transmit.c):

  290  if (remote->pre_p > 0 && remote->pre_s > 0) {
  291     send_pulse(remote->pre_p);
  292     send_space(remote->pre_s);
  293  }

Change this to:

 if (remote->pre_p > 0) {
    send_pulse(remote->pre_p);
 }

 if (remote->pre_s > 0)  {
    send_space(remote->pre_s);
 }

LIRC coders: I would suggest similar changes to the send_post, send_header, and send_foot functions. It would increase flexibility without breaking existing lircd.conf files. Or skip all the zero checks and have the send_pulse and send_space functions immediately exit if called with data == 0 (although this might have other side effects, mostly with invalid lircd.conf files and the check_send_buffer function).

For now I'm using the raw_codes option. The RC5x commands I've needed are discrete commands, so not having the toggle bit hasn't been a problem. Raw codes for the commands above can be seen here.

Adrian
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Marantz RC5 22 bits (Extend Data Word), possible with lircd.conf semantic ?

lirc_ml_sf

    Hi Mona,

    Thanks a lot for your solid and indeep explanations : Very helpfull. That would be a cool thing that LIRC devs would fix pulse/space limitations. However that would even be better that a such common coding could be handled natively, with a RC5x flag for example ! Why (seems) LIRC so backward ?

    My personal conculsion : After taking so much time working around lircd limitations finally I'm gonna drop lircd and just keep lirc_dev / lirc_serial modules which them are usefull. Coding RC5 myself took me much lesser time than configuring lircd... and thus printing out decoded values was easy, somthing that lircd can't even do (must use the poor irrecord).

Le 04/02/2013 18:52, Mona a écrit :
lirc_ml_sf wrote
The main of these two others is a RC5 modified to be longer up to 22 bits
in 
length (17 bits of data). It seems this is called Marantz Extend Data 
Word (see chronogram below).

My question is : How to introduce two space bits (below in cyan) 
inside an RC5 (that never returns to zero by definition) ?

bffebjjh.png (28K)
http://lirc.10951.n7.nabble.com/attachment/9784/0/bffebjjh.png
Your Marantz Extend Data Word and chronogram is actually the RC5x protocol.
I have the same problem with a Marantz SR8000 AV receiver (RC2000 MkII or
RC-18SR remote). I almost got it to work using "pre" and "pre_data". For
example, Marantz code 16 12 01 (discrete power on) would encode as 1101 0000
(2 bit space) 0011 0000 0001.

begin remote
  name        RC5x
  bits           20
  flags         RC5|CONST_LENGTH
  eps           30
  aeps         100
  one          890   890
  zero          890   890
  gap          125000
  toggle_mask  0x20000   # toggle_bit 3
  frequency      36000

  pre_data_bits  8
  pre_data        0xD0       # System = 16, limited to commands 0-63
  pre                0    3560 # No pre pulse, pre space of 2 bit times
(890*4)

  begin codes
    power_on     0x301 # 16 12 01
    power_off     0x302 # 16 12 02
  end codes
end remote

Unfortunately, lircd won't send the pre pulse/space unless BOTH values are
non-zero. It would be an easy code fix that shouldn't break anything else.
>From lircd 0.9.0 (transmit.c):

  290  if (remote->pre_p > 0 && remote->pre_s > 0) {
  291     send_pulse(remote->pre_p);
  292     send_space(remote->pre_s);
  293  }

Change this to:

 if (remote->pre_p > 0) {
    send_pulse(remote->pre_p);
 }

 if (remote->pre_s > 0)  {
    send_space(remote->pre_s);
 }

LIRC coders: I would suggest similar changes to the send_post, send_header,
and send_foot functions. It would increase flexibility without breaking
existing lircd.conf files. Or skip all the zero checks and have the
send_pulse and send_space functions immediately exit if called with data ==
0 (although this might have other side effects, mostly with invalid
lircd.conf files and the check_send_buffer function).

For now I'm using the raw_codes option. The RC5x commands I've needed are
discrete commands, so not having the toggle bit hasn't been a problem. Raw
codes for the commands above can be seen  here
<http://lirc.10951.n7.nabble.com/trouble-with-rc5x-td5701.html>  .

Adrian




--
View this message in context: http://lirc.10951.n7.nabble.com/Marantz-RC5-22-bits-Extend-Data-Word-possible-with-lircd-conf-semantic-tp9784p9788.html
Sent from the LIRC mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
mba
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Marantz RC5 22 bits (Extend Data Word), possible with lircd.conf semantic ?

mba
Hi,

I am struggling with the exact same problem with a SR5003. And I am a bit discouraged by your findings.

Most of the buttons I need I just recorded as raw, but some of the buttons are not available on my Marantz remote. I would therefore like to manually create the missing buttons in raw format but I am having a hard time deciphering the encoding.

Eg. I have recorded:
          name PowerOn
              810     938    1727    1813    1706     917
              831     938     853     895     810    4479
              810     938     853    1791     810     938
             1706     917     810     938     853     895
              831     938     853     895     831     938
              853    1791     853

I would like to create a Power toggle button. Looking in the Marantz RC codes xml file I can see that

PowerOn is 16 12 01 (System Command Extension)

and

Power is 16 12 (System Command)

Is there any way to create the raw code section according to the system/command I listed.

Best regards
Martin
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Marantz RC5 22 bits (Extend Data Word), possible with lircd.conf semantic ?

Bengt Martensson-2
On 02/12/13 18:09, mba wrote:
> Hi,
>
> I am struggling with the exact same problem with a SR5003. And I am a bit
> discouraged by your findings.
>

...

>
> Is there any way to create the raw code section according to the
> system/command I listed.
>
> Best regards
> Martin

Hi Martin,

you can use IrMaster (and/or its commando line version, IrpMaster), see
http://www.harctoolbox.org/IrMaster.html. It can generate these signals
(and many more) and export them in different formats, including
lirc.conf format.


Bengt


------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Marantz RC5 22 bits (Extend Data Word), possible with lircd.conf semantic ?

Mona
In reply to this post by mba
On Tue, 12 Feb 2013 09:09:57 -0800, mba <[hidden email]> wrote:

> Power is 16 12 (System Command)
>
> Is there any way to create the raw code section according to the
> system/command I listed.
>

The two number (System Command) codes are standard RC5 protocol and don't  
need to be specified in raw format. Below is a lircd.conf I recently  
submitted for Marantz equipment. It contains 2 remotes: Marantz_RC2000 for  
standard RC5 codes (System Command), and Marantz_RC200x that uses raw  
codes for RC5x commands (System Command Data).

If you want to make raw codes anyway, read on.

For RC5 (your 2 number System Command), the format is:

Start, Inverted MSB of Command, Toggle, 5 bits of System, Lower 6 bits of  
Command

Code 16 12:
16 = 10000b (5 bit System)
12 = 0001100b (7 bit Command)

Start is a 1, inverted MSB of Command is 1, toggle is typically written as  
a 0.

So 16 12 becomes 11010000001100. In the lircd.conf below, the start bit is  
handled by plead, leaving only 1010000001100, which is why the hex code  
for POWER_ON/OFF is shown as 0x140C and not 0x340C

To make raw codes, let's use "A" to mean an 890us pulse of IR, and "B" to  
mean an 890us space of no IR. For RC5, each bit is encoded as follows:
0: AB
1: BA

So the binary code for the power toggle command gets translated as follows:

1  1  0  1  0  0  0  0  0  0  1  1  0  0
BA BA AB BA AB AB AB AB AB AB BA BA AB AB

The numbers in the raw_codes section of lircd.conf are lengths for an IR  
pulse, IR space, IR pulse, IR space, etc... Raw codes ALWAYS begin and end  
with a pulse, so ignore the leading "B" (space) in the command and any  
trailing "B". Finally, convert each string of A's and B's into the  
appropriate length of IR pulse or space.

Ignoring the leading and trailing B:
A BA AB BA AB AB AB AB AB AB BA BA AB A

Grouping the A's and B's for clarity:
A B AA BB AA B A B A B A B A B A BB A B AA B A

Substituting the proper number of microseconds for each pulse/space:
A (890), B (890), AA (1780), BB (1780), AA (1780), B (890), ...

This then becomes:

    name power_toggle
       890 890 1780 1780 1780 890
       890 890 890 890 890 890
       890 890 890 1780 890 890
       1780 890 890

As you can see, each number is a multiple of 890. When using irrecord to  
generate raw codes there is some measurement error, so the numbers won't  
always be exact multiples. Compare your power ON to mine:

           name PowerOn
               810     938    1727    1813    1706     917
               831     938     853     895     810    4479
               810     938     853    1791     810     938
              1706     917     810     938     853     895
               831     938     853     895     831     938
               853    1791     853

# Command 16 12 01
        name POWER_ON
                890 890 1780 1780 1780 890
                890 890 890 890 890 4450
                890 890 890 1780 890 890
                1780 890 890 890 890 890
                890 890 890 890 890 890
                890 1780 890

Not too different. Looks like your remote (or IR receiver) has a slightly  
longer space than pulse. There's a fair tolerance in IR commands, so  
either one will work. My codes were tested on a Marantz SR8000 A/V  
Receiver.

HTH,

Adrian



# lircd.conf.RC2000
#
# These codes are for the Marantz RC2000 MkII and RC-18SR universal remote  
control.
# They should operate the following Marantz AV Receiver/Amp devices:
#
# SR9600, SR9300, SR9200, SR8500, SR8400, SR8300, SR8200, SR7500, SR7400,  
SR7300
# SR7300OSE, SR7200, SR6400, SR6300, SR6200, SR5600, SR5500, SR5400, SR5300
# SR5200, SR4600, SR4500, SR4400, SR4300, SR4200, SR4320, PM-11S1, PM7001,  
PM7200
#
# From  
http://us.marantz.com/DocumentMaster/US/Marantz_RC_codes_All_AVR_Amp.zip
#
# Command codes listed by Marantz consist of groups of decimal numbers.
# Commands with 2 numbers (ie: command 16 12) are RC5 codes.
# Commands with 3 numbers (ie: command 16 12 01) are RC5x codes.
#
# Note: RC5x is not supported by LIRC (as of 0.9.0), so these codes are in  
raw format.
#
# RC5x protocol: 3 pieces of data are sent - System(0-31), Command(0-127),  
Data(0-63)
#      Data sent is START, inverted MSB of Command, TOGGLE, System, PAUSE,  
Command, Data
#      
START,~C6,TOGGLE,S4,S3,S2,S1,S0,PAUSE,C5,C4,C3,C2,C1,C0,D5,D4,D3,D2,D1,D0
#
# EXAMPLE: For the Marantz code 16 12 01 (POWER ON)
#          System =  16 (10000b)
#          Command = 12 (0001100b)
#          Data =     1 (000001b)
#
#          START  is always 1
#          TOGGLE is always 0 (lircd toggles it automatically every  
keypress)
#          PAUSE  is a gap of 2 bit times where no IR pulses are sent, it  
is NOT two zeroes!
#
#          So the resulting data is  
1,1,0,1,0,0,0,0,PAUSE,0,0,1,1,0,0,0,0,0,0,0,1
#                                   ~C6 T S4.....S0       C5.......C0  
D5.......D0
#
#          This bit sequence is what is encoded in the raw format below  
(MSB first).
#

begin remote

   name  Marantz_RC2000
   bits           13
   flags RC5|CONST_LENGTH
   eps            30
   aeps          100

   one           890   890
   zero          890   890
   plead         890 # This is the start bit!
   gap          125000
   toggle_bit      2 # toggle_mask 0x800?
   frequency    36000

       begin codes

        POWER_ON/OFF 0x140C
        VOL+ 0x1410
        VOL- 0x1411
        MUTE 0x140D
        ATT 0x140D # (PM-11S1)
        OK/OSD_Menu 0x0412 # OSD menu ON & OK
        EXIT_MENU 0x0413 # Exit from OSD menu
        ENTER 0x0417 # (PM-11S1)
        CURSOR_Up 0x0410
        CURSOR_Down 0x0411
        CURSOR_Left 0x0415
        CURSOR_Right 0x0416

# These are the "System Select" keys. They change which
# mode the Marantz system and the remote are in.

        TUNER-1 0x147F # Tuner-1 or change BAND (>FM>AM>LW)
        LINE1 0x147F # (PM-11S1)
        CD 0x153F
        TAPE 0x14BF
        RECORDER2 0x14BF # (PM-11S1)
        CD-R 0x16BF
        RECORDER1 0x16BF # (PM-11S1)
        MD 0x15FF
        LD 0x133F
        TV 0x103F
        VCR1 0x117F
        VCR2 0x11BF
        DSS 0x123F
        PHONO 0x157F

        SURROUND_MODE 0x1425
        SOURCE_DIRECT 0x1422
        PURE_DIRECT 0x1422
        SLEEP 0x1426 # Activate sleep timer (10 min. step)
        OSD_Info 0x140F # OSD general information on/off
        DISPLAY 0x140F # Front display on/off

# SR4320
        SPEAKER_Sel 0x141D # Select Speaker (SPKR-A> SPKR-B> SPKR-A+B> SPKR-Off>)
        SPEAKER-A_ON/OFF 0x1423
        SPEAKER-B_ON/OFF 0x1427

# Tone controls
        BASS+ 0x1416
        BASS- 0x1417
        TREBLE+ 0x1418
        TREBLE- 0x1419
        BALANCE_RIGHT 0x141A
        BALANCE_LEFT 0x141B

        BAND 0x147F # Select FM and AM (Toggle)

# Commands for Tuner-1 mode
        Tuner-1_FM 0x146D
        Tuner-1_AM 0x146E
        Tuner-1_MEMO 0x1469 # Memory
        Tuner-1_PRESET_SCAN 0x146B # Start Preset Scan
        Tuner-1_PRESET_Up+ 0x1460 # Preset(Skip) up
        Tuner-1_PREST_Down- 0x1461 # Preset(Skip) down
        Tuner-1_FREQ_Up+ 0x145E # Frequency(Scan) up
        Tuner-1_FREQ_Down- 0x145F # Frequency(Scan) down
        Tuner-1_T-MODE 0x1465 # FM MODE (Auto Stereo / Mono)
        Tuner-1_FREQ-DIRECT 0x144B # Change to Direct Frequency input mode
        Tuner-1_0 0x1440
        Tuner-1_1 0x1441
        Tuner-1_2 0x1442
        Tuner-1_3 0x1443
        Tuner-1_4 0x1444
        Tuner-1_5 0x1445
        Tuner-1_6 0x1446
        Tuner-1_7 0x1447
        Tuner-1_8 0x1448
        Tuner-1_9 0x1449
        Tuner-1_CLEAR 0x147A

        PRESET_INFO 0x0452 # Display the preset station OSD
        DISPLAY_MODE 0x144F # Toggle display mode
        PTY 0x1478 # Select Program Type for RDS

       end codes

end remote

begin remote

   name  Marantz_RC2000x
   flags RAW_CODES|CONST_LENGTH
   eps            30
   aeps          100

   gap 125000

#  one           890 890
#  zero          890 890
#  plead         890

#  If the transmit PAUSE is 2 bits long, the toggle bit would be in this  
position
#  toggle_mask 0x080000

   frequency 36000

       begin raw_codes

# Command 16 12 01
        name POWER_ON
                890 890 1780 1780 1780 890
                890 890 890 890 890 4450
                890 890 890 1780 890 890
                1780 890 890 890 890 890
                890 890 890 890 890 890
                890 1780 890

# Command 16 12 02
        name POWER_OFF
                890 890 1780 1780 1780 890
                890 890 890 890 890 4450
                890 890 890 1780 890 890
                1780 890 890 890 890 890
                890 890 890 890 890 1780
                1780

# Command 16 00 10 - Select DVD mode (LINE2 - PM11S1)
        name DVD
                890 890 1780 1780 1780 890
                890 890 890 890 890 4450
                890 890 890 890 890 890
                890 890 890 890 890 890
                890 890 890 1780 1780 1780
                1780

# Command 16 00 06 - Select AUX1 mode
        Name AUX1
                890 890 1780 1780 1780 890
                890 890 890 890 890 4450
                890 890 890 890 890 890
                890 890 890 890 890 890
                890 890 890 890 890 1780
                890 890 1780

# To Do:
#
# 16 13 00 MUTE_ON
# 16 13 01 MUTE_OFF
# 16 00 13 INPUT_NEXT
# 16 00 14 INPUT_BACK
# 17 63 02 TUNER-2
# 16 00 07 AUX2
# 16 00 20 BALANCED
# 16 01 03 7.1(6.1)CH.Input_ON/OFF
# 16 01 12 7.1(6.1)CH.Input_ON
# 16 01 13 7.1(6.1)CH.Input_OFF
# 16 37 45 AUTO
# 16 37 30 STEREO
# 16 37 50 MULTI-CH_STEREO
# etc...

        end raw_codes
end remote

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
mba
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Marantz RC5 22 bits (Extend Data Word), possible with lircd.conf semantic ?

mba
Thanks a lot for the very detailed description of the format and thanks for the link to the program both proved invaluable when creating a hybrid configuration file.

As a side note, I made an android app called Amote (its on google play) which basically is a multi-remote for your android device, with it I can pick and place the buttons I want readily available. Therefore it does not matter that the configuration of the Marantz remote is in two different sections. Thats only evident when doing the configuration of the app, and not when using it.
Loading...