home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Products
IR Server Suite (IRSS)
IRSS 1.4.2 Test Build 2391 - MCE Transceiver unable to control Sony devices
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="tallrussian" data-source="post: 363811" data-attributes="member: 87363"><p>I'm starting to think this may have something to do with the variations of IR protocols between Yamaha and Sony.</p><p></p><p>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. </p><p></p><p>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.</p><p></p><p>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.</p><p></p><p>Below is the code from the above-mentioned "MceIrRec" open source command that appears to be responsible for detecting a Sony protocol during learning:</p><p>[CODE]</p><p>static void MceIrDetectSONY(PIR_DETECTION pDetect, DWORD *Data, DWORD DataCount)</p><p>{</p><p> DWORD i;</p><p></p><p> if (!Data)</p><p> {</p><p> pDetect->DetectState = DETECT_HEADER_PULSE;</p><p> return;</p><p> }</p><p></p><p> for (i = 0 ; i < DataCount ; i++)</p><p> {</p><p> DWORD Duration = Data[i] & PULSE_MASK;</p><p> BOOL Pulse = ((Data[i] & PULSE_BIT) != 0);</p><p> BOOL Ignored = TRUE;</p><p> switch(pDetect->DetectState)</p><p> {</p><p> case DETECT_HEADER_PULSE:</p><p> if (Pulse && (Duration >= 2100) && (Duration <= 2700))</p><p> {</p><p> pDetect->DetectState = DETECT_HEADER_SPACE;</p><p> Ignored = FALSE;</p><p> DebugSONY("DETECT_HEADER_SPACE\n");</p><p> }</p><p> break;</p><p> case DETECT_HEADER_SPACE:</p><p> if (!Pulse && (Duration >= 500) && (Duration <= 700))</p><p> {</p><p> pDetect->DetectState = DETECT_DATA;</p><p> Ignored = FALSE;</p><p> pDetect->HalfBit = 0;</p><p> pDetect->Bit = 0;</p><p> pDetect->Code = 0;</p><p> DebugSONY("DETECT_DATA\n");</p><p> }</p><p> break;</p><p> case DETECT_DATA:</p><p> if ((pDetect->HalfBit % 2) == 0)</p><p> {</p><p> if (!Pulse) break;</p><p></p><p> if ((Duration >= 400) && (Duration <= 750))</p><p> {</p><p> Ignored = FALSE;</p><p> pDetect->HalfBit = 1;</p><p> pDetect->Bit++;</p><p> DebugSONY("DATA bit:%d code:%08X\n", pDetect->Bit, pDetect->Code);</p><p> }</p><p> else if ((Duration >= 1000) && (Duration <= 1300))</p><p> {</p><p> Ignored = FALSE;</p><p> pDetect->HalfBit = 1;</p><p> pDetect->Code |= 1 << pDetect->Bit++;</p><p> DebugSONY("DATA bit:%d code:%08X\n", pDetect->Bit, pDetect->Code);</p><p> }</p><p> else</p><p> {</p><p> DebugSONY("Pulse error %d on bit %d\n", Duration, pDetect->Bit);</p><p> }</p><p> break;</p><p> }</p><p> else</p><p> {</p><p> if (Pulse) break;</p><p></p><p> if ((Duration >= 400) && (Duration <= 750))</p><p> {</p><p> Ignored = FALSE;</p><p> pDetect->HalfBit = 0;</p><p> DebugSONY("DATA bit:%d code:%08X\n", pDetect->Bit, pDetect->Code);</p><p> }</p><p> else if ((Duration > 8000) &&</p><p> (pDetect->Bit == 8) || (pDetect->Bit == 12) || (pDetect->Bit == 15) || (pDetect->Bit == 20))</p><p> {</p><p> Ignored = FALSE;</p><p> pDetect->DetectState = DETECT_KEYCODE;</p><p> i--;</p><p> DebugSONY("DETECT_KEYCODE code:%08X\n", pDetect->Code);</p><p> }</p><p> else</p><p> {</p><p> DebugSONY("Space error %d on bit %d\n", Duration, pDetect->Bit);</p><p> }</p><p> }</p><p> break;</p><p> }</p><p> if (pDetect->DetectState == DETECT_KEYCODE)</p><p> {</p><p> BOOL IsValid = FALSE;</p><p> if (pDetect->LastCode != pDetect->Code)</p><p> {</p><p> IsValid = TRUE;</p><p> pDetect->LastCode = pDetect->Code;</p><p> pDetect->LastTime = GetTickCount();</p><p> pDetect->RepeatCount = 0;</p><p> }</p><p> else if (KbdFirstRepeat &&</p><p> (pDetect->LastTime + KbdFirstRepeat < GetTickCount()))</p><p> {</p><p> IsValid = TRUE;</p><p> pDetect->LastTime = GetTickCount() + KbdNextRepeats - KbdFirstRepeat;</p><p> pDetect->RepeatCount++;</p><p> }</p><p></p><p> pDetect->DetectState = DETECT_HEADER_PULSE;</p><p></p><p> if (IsValid)</p><p> {</p><p> pDetect->Code &= 0x0000FFFF;</p><p> Trace("GENERATE_SONY_KEYCODE code:%04X !!!\n", pDetect->Code);</p><p> PostMessage(hWndRegistered, WM_USER, ID_SONY_KEYCODE, (pDetect->RepeatCount << 16) | pDetect->Code);</p><p> }</p><p> }</p><p> if (Ignored && (pDetect->DetectState != DETECT_HEADER_PULSE))</p><p> {</p><p> pDetect->DetectState = DETECT_HEADER_PULSE;</p><p> DebugSONY("DETECT_HEADER_PULSE\n");</p><p> }</p><p> }</p><p>}</p><p>[/CODE]</p><p></p><p>And this is how it is called. Does IR Server Suite have something like this?:</p><p></p><p>[CODE]</p><p>void MceIrDecode(PUCHAR pIrData, DWORD IrCount)</p><p>{</p><p> DWORD BulkIdx = 0;</p><p></p><p> int KeyCode;</p><p></p><p> if (!pIrData)</p><p> {</p><p> LastSpace = PULSE_MASK;</p><p> Data[1] = LastSpace;</p><p> Data[2] = 0;</p><p> DataCount = 2;</p><p> }</p><p></p><p> if ((DataCount - sizeof(Data)/sizeof(DWORD)) == 0)</p><p> return;</p><p></p><p> while(BulkIdx < IrCount)</p><p> {</p><p> UCHAR Pulse = 0;</p><p></p><p> KeyCode = pIrData[BulkIdx++];</p><p> if (KeyCode & 0x80)</p><p> {</p><p> Pulse = 1;</p><p> KeyCode -= 0x80;</p><p> }</p><p> KeyCode *= 50;</p><p></p><p> if (Pulse)</p><p> {</p><p> if (LastSpace)</p><p> {</p><p> Data[DataCount++] = LastSpace;</p><p> LastSpace = 0;</p><p> Data[DataCount] = 0;</p><p> }</p><p> Data[DataCount] += KeyCode;</p><p> Data[DataCount] |= PULSE_BIT;</p><p> }</p><p> else</p><p> {</p><p> if (Data[DataCount] && !LastSpace)</p><p> {</p><p> DataCount++;</p><p> }</p><p> LastSpace += KeyCode;</p><p> }</p><p> }</p><p> MceIrDetectSONY (&RemoteSony, Data, DataCount);</p><p> MceIrDetectNEC (&RemoteNEC, Data, DataCount);</p><p> MceIrDetectRC5 (&RemoteRC5, Data, DataCount);</p><p> MceIrDetectRC6 (&RemoteRC6, Data, DataCount);</p><p> MceIrDetectREC80(&RemoteREC80,Data, DataCount);</p><p> Data[0] = Data[DataCount];</p><p> DataCount = 0;</p><p>}</p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="tallrussian, post: 363811, member: 87363"] 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"); } } } [/CODE] 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; } [/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Products
IR Server Suite (IRSS)
IRSS 1.4.2 Test Build 2391 - MCE Transceiver unable to control Sony devices
Contact us
RSS
Top
Bottom