IRSS 1.4.2 Test Build 2391 - MCE Transceiver unable to control Sony devices (1 Viewer)

tallrussian

New Member
January 17, 2009
3
0
California, USA
Home Country
United States of America United States of America
Hi,

First I wanted to say, "Thank you" for the wonderful plug-in. It appears to be everything that I wanted for my control needs.

The only problem is, it appears to work just perfect with my Yamaha receiver, but my Sony TV ignores it completely. I have tried learning commands from my Sony remote and then blasting them, and I also have tried copying Pronto Sony hex codes directly into IRSS .IR files (which appear to be in the same format). All without any luck. I also did a number of searches on this forum before posting, but have not found any answers yet.

Interestingly, if I uninstall IRSS and use the bare microsoft driver with the "mcirrec" and "mcirplay" commands that I got from the following site (where both exe and source code are available), then everything works fine and I can control both the Sony TV and the Yamaha received from those command line commands (but not from IRSS, obviously).

This is the tool that has "McIrRec" and "McIrPlay" commands that work:
http://burningzeroad.free.fr/MceIrApi.rar
http://burningzeroad.free.fr/MceIrSrc.rar

Did anyone else bump into this problem before? Does IRSS use some kind of hard-coded carrier frequency for infrared that does not match what Sony is using? What does this other tool do differently that allows it to learn both Sony and Yahama commands successfully, while IRSS only works with Yamaha (at least - in my setup).

Any thoughs, ideas or pointers for what to try would be greatly appreciated.
Thank you!
 

tallrussian

New Member
January 17, 2009
3
0
California, USA
Home Country
United States of America United States of America
I'm starting to think this may have something to do with the variations of IR protocols between Yamaha and Sony.

1) Apparently, Sony is using "Sony Infrared Remote Control" protocol, also known as "SIRC", which is different from many (all?) other IR protocols. (Knowing Sony, this comes to no surprise). It appears to be basically a variant of PWM modulation over 40KHz carrier frequency, as far as I can tell, with 12- 15- and/or 20-bit command variants.

2) The source code of the above-mentioned "MceIrRec" open source utility that appears to work includes the following piece of code that appears to be responsible for detecting Sony protocol so that the command could be learned successfully. This could be why MceIrRec and MceIrPlay work with my TV and can control it properly, while IR Server Suite does not.

3) I'm trying to browse through the IR Server Suite source code to see if it has something similar, but IR Server Suite is a much more complex beast, so it's going to take me some time... Some help from Aaron or someone else who knows the insides of the IR Server Suite source would be appreciated.

Below is the code from the above-mentioned "MceIrRec" open source command that appears to be responsible for detecting a Sony protocol during learning:
Code:
static void     MceIrDetectSONY(PIR_DETECTION pDetect, DWORD *Data, DWORD DataCount)
{
        DWORD i;

        if (!Data)
        {
                pDetect->DetectState = DETECT_HEADER_PULSE;
                return;
        }

        for (i = 0 ; i < DataCount ; i++)
        {
                DWORD Duration = Data[i] & PULSE_MASK;
                BOOL Pulse = ((Data[i] & PULSE_BIT) != 0);
                BOOL Ignored = TRUE;
                switch(pDetect->DetectState)
                {
                case DETECT_HEADER_PULSE:
                        if (Pulse && (Duration >= 2100) && (Duration <= 2700))
                        {
                                pDetect->DetectState = DETECT_HEADER_SPACE;
                                Ignored = FALSE;
                                DebugSONY("DETECT_HEADER_SPACE\n");
                        }
                        break;
                case DETECT_HEADER_SPACE:
                        if (!Pulse && (Duration >= 500) && (Duration <= 700))
                        {
                                pDetect->DetectState = DETECT_DATA;
                                Ignored = FALSE;
                                pDetect->HalfBit = 0;
                                pDetect->Bit = 0;
                                pDetect->Code = 0;
                                DebugSONY("DETECT_DATA\n");
                        }
                        break;
                case DETECT_DATA:
                        if ((pDetect->HalfBit % 2) == 0)
                        {
                                if (!Pulse) break;

                                if ((Duration >= 400) && (Duration <= 750))
                                {
                                        Ignored = FALSE;
                                        pDetect->HalfBit = 1;
                                        pDetect->Bit++;
                                        DebugSONY("DATA bit:%d code:%08X\n", pDetect->Bit, pDetect->Code);
                                }
                                else if ((Duration >= 1000) && (Duration <= 1300))
                                {
                                        Ignored = FALSE;
                                        pDetect->HalfBit = 1;
                                        pDetect->Code |= 1 << pDetect->Bit++;
                                        DebugSONY("DATA bit:%d code:%08X\n", pDetect->Bit, pDetect->Code);
                                }
                                else
                                {
                                        DebugSONY("Pulse error %d on bit %d\n", Duration, pDetect->Bit);
                                }
                                break;
                        }
                        else
                        {
                                if (Pulse) break;

                                if ((Duration >= 400) && (Duration <= 750))
                                {
                                        Ignored = FALSE;
                                        pDetect->HalfBit = 0;
                                        DebugSONY("DATA bit:%d code:%08X\n", pDetect->Bit, pDetect->Code);
                                }
                                else if ((Duration > 8000) &&
                                                 (pDetect->Bit == 8) || (pDetect->Bit == 12) || (pDetect->Bit == 15) || (pDetect->Bit == 20))
                                {
                                        Ignored = FALSE;
                                        pDetect->DetectState = DETECT_KEYCODE;
                                        i--;
                                        DebugSONY("DETECT_KEYCODE code:%08X\n", pDetect->Code);
                                }
                                else
                                {
                                        DebugSONY("Space error %d on bit %d\n", Duration, pDetect->Bit);
                                }
                        }
                        break;
                }
                if (pDetect->DetectState == DETECT_KEYCODE)
                {
                        BOOL IsValid = FALSE;
                        if (pDetect->LastCode != pDetect->Code)
                        {
                                IsValid = TRUE;
                                pDetect->LastCode = pDetect->Code;
                                pDetect->LastTime = GetTickCount();
                                pDetect->RepeatCount = 0;
                        }
                        else if (KbdFirstRepeat &&
                                (pDetect->LastTime + KbdFirstRepeat < GetTickCount()))
                        {
                                IsValid = TRUE;
                                pDetect->LastTime = GetTickCount() + KbdNextRepeats - KbdFirstRepeat;
                                pDetect->RepeatCount++;
                        }

                        pDetect->DetectState = DETECT_HEADER_PULSE;

                        if (IsValid)
                        {
                                pDetect->Code &= 0x0000FFFF;
                                Trace("GENERATE_SONY_KEYCODE code:%04X !!!\n", pDetect->Code);
                                PostMessage(hWndRegistered, WM_USER, ID_SONY_KEYCODE, (pDetect->RepeatCount << 16) | pDetect->Code);
                        }
                }
                if (Ignored && (pDetect->DetectState != DETECT_HEADER_PULSE))
                {
                        pDetect->DetectState = DETECT_HEADER_PULSE;
                        DebugSONY("DETECT_HEADER_PULSE\n");
                }
        }
}

And this is how it is called. Does IR Server Suite have something like this?:

Code:
void MceIrDecode(PUCHAR pIrData, DWORD IrCount)
{
        DWORD                   BulkIdx = 0;

        int KeyCode;

        if (!pIrData)
        {
                LastSpace = PULSE_MASK;
                Data[1] = LastSpace;
                Data[2] = 0;
                DataCount = 2;
        }

        if ((DataCount - sizeof(Data)/sizeof(DWORD)) == 0)
                return;

        while(BulkIdx < IrCount)
        {
                UCHAR Pulse = 0;

                KeyCode = pIrData[BulkIdx++];
                if (KeyCode & 0x80)
                {
                        Pulse = 1;
                        KeyCode -= 0x80;
                }
                KeyCode *= 50;

                if (Pulse)
                {
                        if (LastSpace)
                        {
                                Data[DataCount++] = LastSpace;
                                LastSpace = 0;
                                Data[DataCount] = 0;
                        }
                        Data[DataCount] += KeyCode;
                        Data[DataCount] |= PULSE_BIT;
                }
                else
                {
                        if (Data[DataCount] && !LastSpace)
                        {
                                DataCount++;
                        }
                        LastSpace += KeyCode;
                }
        }
        MceIrDetectSONY (&RemoteSony, Data, DataCount);
        MceIrDetectNEC  (&RemoteNEC,  Data, DataCount);
        MceIrDetectRC5  (&RemoteRC5,  Data, DataCount);
        MceIrDetectRC6  (&RemoteRC6,  Data, DataCount);
        MceIrDetectREC80(&RemoteREC80,Data, DataCount);
        Data[0] = Data[DataCount];
        DataCount = 0;
}
 

tallrussian

New Member
January 17, 2009
3
0
California, USA
Home Country
United States of America United States of America
Workaround found!

There is definitely a bug in IRSS blaster code, most likely in the MCE Transceiver. When blasting using Sony SIRC protocol, the blasts look very short and faint, and my Sony TV just does not register them, no matter how close I move the transmitter to the TV infrared sensor.

However, if I stop the IRSS Input Service (using 'net stop "Input Service"', for example), then I can use the above-mentioned "MceIrPlay" command, which appears to send all files properly, and my Sony TV likes that.

I tried to download some well-known Sony discrete codes in Pronto format from "Remote Central". Copied and pasted into a file, and then gave that file to "MceIrPlay" (which sent it successfully), and then to the IRSS IR File Tool. The blast generated by IRSS looked a lot shorter and fainter, and my TV did not register it at all.

Anyway, for now I have developed the following workaround for myself. Basically, I use IRSS for MCE remote control key mapping, for macro functionality and for event mapping (i.e. to turn everything on when the PC wakes up), but I do not use it for IR blasting. Instead, I created a number of separate macros like the following in order to work around the problematic blasting with MCE Transceiver in IRSS. My macros work basically by disabling the IRSS input service, and then calling the external MceIrPlay command to transmit IR codes, thus bypassing the IRSS internal MCE transceiver.

Stopping and starting the service adds an extra 3-4 seconds for the macro to execute, but I can live with that for now. The important thing is that this works! My macro "All_On" looks as follows, for example:

Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<macro>
  <item command="Run: C:\WINDOWS\system32\net.exe|C:\WINDOWS\system32|stop &quot;Input Service&quot;|Normal|True|False|True|False" />
  <item command="Run: C:\Program Files\MCE IR\MceIrPlay.exe|C:\Program Files\MCE IR\codes|-b 2 -i Sony_TV_Power_On.IR|Normal|True|False|True|False" />
  <item command="Run: C:\Program Files\MCE IR\MceIrPlay.exe|C:\Program Files\MCE IR\codes|-b 1 -i Yamaha_Power_On.IRK|Normal|True|False|True|False" />
  <item command="Pause: 500" />
  <item command="Run: C:\Program Files\MCE IR\MceIrPlay.exe|C:\Program Files\MCE IR\codes|-b 1 -i Yamaha_Input_DVD.IRK|Normal|True|False|True|False" />
  <item command="Run: C:\Program Files\MCE IR\MceIrPlay.exe|C:\Program Files\MCE IR\codes|-b 1 -i Yamaha_Mode_Theater_2.IRK|Normal|True|False|True|False" />
  <item command="Pause: 1000" />
  <item command="Run: C:\Program Files\MCE IR\MceIrPlay.exe|C:\Program Files\MCE IR\codes|-b 2 -i Sony_TV_Input_7.IR|Normal|True|False|True|False" />
  <item command="Run: C:\WINDOWS\system32\net.exe|C:\WINDOWS\system32|start &quot;Input Service&quot;|Normal|True|False|True|False" />
</macro>

I'm hoping that eventually we will get to the bottom of why the native MCE Transceiver in IRSS does not blast well using some IR protocols.
 

MiamiBeach

MP Donator
  • Premium Supporter
  • August 18, 2008
    46
    11
    Miami Beach, FL
    Home Country
    United States of America United States of America
    ...

    The only problem is, it appears to work just perfect with my Yamaha receiver, but my Sony TV ignores it completely.
    tallrussian,

    Did you have to do anything special to get IR Server working with your Yamaha receiver? It learns and blasts IR commands fine with my Philips LCD TV, but it is very erratic with my Yamaha Receiver (RX-V663). It looks like it learns the commands fine, but only about 1 in every 10 or 20 tests actually works. All I am trying to do is create macros to turn the receiver on/off.

    Any help would be appreciated.
     

    Users who are viewing this thread

    Top Bottom