Media Remote: Difference between revisions

From Xenon Wiki
Jump to navigation Jump to search
No edit summary
imported>Tuxuser
 
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Cleanup}}
== General Information ==
== General Information ==
  File:Standard remote.jpg MISSING
 
[[File:Media-remote.jpg]]
 
Standard Media Remote•The standard remote (as opposed to the Universal Media Remote) was only released in limited quantities with Xbox 360 premium packages at launch.  
Standard Media Remote•The standard remote (as opposed to the Universal Media Remote) was only released in limited quantities with Xbox 360 premium packages at launch.  
*The difference between the Universal Media Remote and the Standard Remote appears to just be the button additions.  
*The difference between the Universal Media Remote and the Standard Remote appears to just be the button additions.  
Line 88: Line 91:
*{'17','record'};  
*{'17','record'};  


Proof of concept code by Icekiller


=== Proof of concept code by Icekiller ===
<pre>
/*
/*
* Example code of how to use the build in IR of the xbox 360
* Example code of how to use the build in IR of the xbox 360
* Code rewritten based on tmbinc's smc.c
* Code rewritten based on tmbinc's smc.c
* free to use under GPL
* free to use under GPL
*  
*  
* 20 januari 2008 by Icekiller
* 20 januari 2008 by Icekiller
*/
*/
 
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
Line 107: Line 113:


int smc_fd;
int smc_fd;
void wait ( int seconds )
void wait(int seconds)
{
{
  clock_t endwait;
    clock_t endwait;
  endwait = clock () + seconds * CLOCKS_PER_SEC;
    endwait = clock() + seconds * CLOCKS_PER_SEC;
  while (clock() < endwait) {}
    while (clock() < endwait) {
    }
}
}


int main(int argc, char **argv)
int main(int argc, char **argv)
{
{
  int first = 1;
    int first = 1;
/* try open SMC. if this doesn't work, bail out. */
    /* try open SMC. if this doesn't work, bail out. */
  smc_fd = open(SMC_FILENAME, O_RDWR);
    smc_fd = open(SMC_FILENAME, O_RDWR);
  if (smc_fd < 0)
    if (smc_fd < 0) {
  {
perror(SMC_FILENAME);
perror(SMC_FILENAME);
return 1;
return 1;
  }
    }


  while (1)
    while (1) {
  {
unsigned char msg[16];
unsigned char msg[16];
  int option_index = 0, c;
int option_index = 0, c;
  msg[0] = 0x16;
msg[0] = 0x16;
  /* prepare message */
/* prepare message */
memset(msg, 0, 16);
memset(msg, 0, 16);
if (c != 'w')
{
  msg[0] = 0x16;


  int i;
if (c != 'w') {
    msg[0] = 0x16;
 
    int i;


  if (write(smc_fd, msg, 16) != 16)
    if (write(smc_fd, msg, 16) != 16) {
  {
perror("write");
perror("write");
break;
break;
  }
    }
}
}
 
if ((c == 'w') || (msg[0] < 0x80))
if ((c == 'w') || (msg[0] < 0x80)) {
{
    int wait_for = msg[0];
  int wait_for = msg[0];
    while (1) {
  while (1)
msg[0] = 0x16;
  {
msg[0] = 0x16;
if (read(smc_fd, msg, 16) != 16)
if (read(smc_fd, msg, 16) != 16)
  perror("read");
    perror("read");


int valueread;
int valueread;
valueread=msg[3];
valueread = msg[3];


if(msg[0]!=0x16)
if (msg[0] != 0x16)
switch(valueread){
    switch (valueread) {
case 0x26:
    case 0x26:
printf("Button Y");
printf("Button Y");
break;
break;
case 0x25:
    case 0x25:
printf("Button B");
printf("Button B");
break;
break;
case 0x24:
    case 0x24:
printf("DVD menu");
printf("DVD menu");
break;
break;
case 0x23:
    case 0x23:
printf("Back");
printf("Back");
break;
break;
case 0x22:
    case 0x22:
printf("OK");
printf("OK");
break;
break;
case 0x21:
    case 0x21:
printf("Button left");
printf("Button left");
break;
break;
case 0x20:
    case 0x20:
printf("Button right");
printf("Button right");
break;
break;
case 0x19:
    case 0x19:
printf("Stop button");
printf("Stop button");
break;
break;
case 0x18:
    case 0x18:
printf("Pause button");
printf("Pause button");
break;
break;
case 0x17:
    case 0x17:
printf("Rec button");
printf("Rec button");
break;
break;
case 0x16:
    case 0x16:
printf(">");
printf(">");
break;
break;
case 0x15:
    case 0x15:
printf("<<");
printf("<<");
break;
break;
case 0x14:
    case 0x14:
printf(">>");
printf(">>");
break;
break;
case 0x13:
    case 0x13:
printf("Button X");
printf("Button X");
break;
break;
case 0x12:
    case 0x12:
printf("Button A");
printf("Button A");
break;
break;
case 0x11:
    case 0x11:
printf("Volume down");
printf("Volume down");
break;
break;
case 0x10:
    case 0x10:
printf("Volume up");
printf("Volume up");
break;
break;
case 0x09:
    case 0x09:
printf("Button 9");
printf("Button 9");
break;
break;
case 0x08:
    case 0x08:
printf("Button 8");
printf("Button 8");
break;
break;
case 0x07:
    case 0x07:
printf("Button 7");
printf("Button 7");
break;
break;
case 0x06:
    case 0x06:
printf("Button 6");
printf("Button 6");
break;
break;
case 0x05:
    case 0x05:
printf("Button 5");
printf("Button 5");
break;
break;
case 0x04:
    case 0x04:
printf("Button 4");
printf("Button 4");
break;
break;
case 0x03:
    case 0x03:
printf("Button 3");
printf("Button 3");
break;
break;
case 0x02:
    case 0x02:
printf("Button 2");
printf("Button 2");
break;
break;
case 0x01:
    case 0x01:
printf("Button 1");
printf("Button 1");
break;
break;
case 0x00:
    case 0x00:
printf("Button 0");
printf("Button 0");
break;
break;
case 0x1a:
    case 0x1a:
printf(">|");
printf(">|");
break;
break;
case 0x1b:
    case 0x1b:
printf("<");
printf("<");
break;
break;
case 0x1c:
    case 0x1c:
printf("Unknown");
printf("Unknown");
break;
break;
case 0x1d:
    case 0x1d:
printf("Unknown");
printf("Unknown");
break;
break;
case 0x1e:
    case 0x1e:
printf("Button up");
printf("Button up");
break;
break;
case 0x1f:
    case 0x1f:
printf("Button down");
printf("Button down");
break;
break;
case 0x0a:
    case 0x0a:
printf("Clear");
printf("Clear");
break;
break;
case 0x0b:
    case 0x0b:
printf("ENTER");
printf("ENTER");
break;
break;
case 0x0c:
    case 0x0c:
printf("Unknown");
printf("Unknown");
break;
break;
case 0x0d:
    case 0x0d:
printf("WMS");
printf("WMS");
break;
break;
case 0x0e:
    case 0x0e:
printf("Mute");
printf("Mute");
break;
break;
case 0x0f:
    case 0x0f:
printf("Info");
printf("Info");
break;
break;
case 0x4f:
    case 0x4f:
printf("Display");
printf("Display");
break;
break;
case 0x51:
    case 0x51:
printf("Title");
printf("Title");
break;
break;
case 0x64:
    case 0x64:
printf("Guide");
printf("Guide");
break;
break;
case 0x68:
    case 0x68:
printf("Button X");
printf("Button X");
break;
break;
case 0x66:
    case 0x66:
printf("Button A");
printf("Button A");
break;
break;
}
    }
printf("\n", valueread);
printf("\n", valueread);
if (msg[0] == wait_for)
if (msg[0] == wait_for)
  break;
    break;
  }
    }
}
}
wait(1);
wait(1);
  }
    }


}
}


</pre>
The remote control works as a lowbase of the xbox360, so the power on and off still work in Linux, also you can get all the IR codes into linux. So 'if' a Mediacenter is ever ported to Xbox 360 Linux, you could use the official remote. (IR codes and info retrieved by Icekiller, with SMC.C from tmbinc, small remote by kwkward)


The remote control works as a lowbase of the xbox360, so the power on and off still work in Linux, also you can get all the IR codes into linux. So 'if' a Mediacenter is ever ported to Xbox 360 Linux, you could use the official remote. (IR codes and info retrieved by Icekiller, with SMC.C from tmbinc, small remote by kwkward)
[[Category:Xbox360_Hardware]]

Latest revision as of 00:24, 7 January 2014

General Information

Media-remote.jpg

Standard Media Remote•The standard remote (as opposed to the Universal Media Remote) was only released in limited quantities with Xbox 360 premium packages at launch.

  • The difference between the Universal Media Remote and the Standard Remote appears to just be the button additions.
  • The remote uses the IR port located on the front of the Xbox 360.
  • Some Windows Media Center Edition computers recognize this remote as a normal Media Center remote.

Confirmed Facts

  • All Windows Media Center remotes are recognized by the Xbox 360.


Linux Facts

Big remote Big remote

  • IRCODE , Function
  • {'26','Button Y'},
  • {'25','Button B'},
  • {'24','DVD menu'},
  • {'23','BACK'},
  • {'22','OK'},
  • {'20','Button left'},
  • {'21','Button right'},
  • {'19','Stop button'},
  • {'18','Pause button'},
  • {'17','Rec button'},
  • {'16','Play button'},
  • {'15','Fast rewind <<'},
  • {'14','fast foward >>'},
  • {'11','Volume down'},
  • {'10','Volume up'},
  • {'09','Button 9 on ke*ypad part'},
  • {'08','Button 8 on ke*ypad part'},
  • {'07','Button 7 on ke*ypad part'},
  • {'06','Button 6 on ke*ypad part'},
  • {'05','Button 5 on ke*ypad part'},
  • {'04','Button 4 on keypad part'},
  • {'03','Button 3 on keypad part'},
  • {'02','Button 2 on keypad part'},
  • {'01','Button 1 on keypad part'},
  • {'00','Button 0 on keypad part'},
  • {'1a','Go to ending >|'},
  • {'1b','Go to beginning |<'},
  • {'1c','Unknown'},
  • {'1d','100 on remote'},
  • {'1e','Button up'},
  • {'1f','Button down'},
  • {'0a','Clear'},
  • {'0b','ENTER'},
  • {'0c','Unknown'},
  • {'0d','Windows Media Start'},
  • {'0e','Mute'},
  • {'0f','Info'},
  • {'4f','Display'},
  • {'51','Title'},
  • {'64','Big X button on top, use as alternative 'on'?'},
  • {'68','Button X'},
  • {'66','Button A '},
  • {'6c','Channel up'},
  • {'6d','Channel down'};

the small remote 'image insert here'

  • IRCODE , Function
  • {'64','guide'},
  • {'19','stop'},
  • {'18','pause'},
  • {'16','play'},
  • {'15','rewind'},
  • {'14','fast forward'},
  • {'1A','chapter next'},
  • {'1B','chapter prev'},
  • {'4F','display'},
  • {'51','title'},
  • {'24','dvd menu'},
  • {'23','back'},
  • {'0F','info'},
  • {'1E','up'},
  • {'1F','down'},
  • {'20','left'},
  • {'21','right'},
  • {'22','ok'},
  • {'12','A'},
  • {'25','B'},
  • {'13','X'},
  • {'26','Y'},
  • {'0D','windows'},
  • {'17','record'};


Proof of concept code by Icekiller

/*
 * Example code of how to use the build in IR of the xbox 360
 * Code rewritten based on tmbinc's smc.c
 * free to use under GPL
 * 
 * 20 januari 2008 by Icekiller
 */

#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <getopt.h>
#include <string.h>
#include <time.h>

#define SMC_FILENAME "/dev/smc"

int smc_fd;
void wait(int seconds)
{
    clock_t endwait;
    endwait = clock() + seconds * CLOCKS_PER_SEC;
    while (clock() < endwait) {
    }
}

int main(int argc, char **argv)
{
    int first = 1;
    /* try open SMC. if this doesn't work, bail out. */
    smc_fd = open(SMC_FILENAME, O_RDWR);
    if (smc_fd < 0) {
	perror(SMC_FILENAME);
	return 1;
    }

    while (1) {
	unsigned char msg[16];
	int option_index = 0, c;
	msg[0] = 0x16;
	/* prepare message */
	memset(msg, 0, 16);

	if (c != 'w') {
	    msg[0] = 0x16;

	    int i;

	    if (write(smc_fd, msg, 16) != 16) {
		perror("write");
		break;
	    }
	}

	if ((c == 'w') || (msg[0] < 0x80)) {
	    int wait_for = msg[0];
	    while (1) {
		msg[0] = 0x16;
		if (read(smc_fd, msg, 16) != 16)
		    perror("read");

		int valueread;
		valueread = msg[3];

		if (msg[0] != 0x16)
		    switch (valueread) {
		    case 0x26:
			printf("Button Y");
			break;
		    case 0x25:
			printf("Button B");
			break;
		    case 0x24:
			printf("DVD menu");
			break;
		    case 0x23:
			printf("Back");
			break;
		    case 0x22:
			printf("OK");
			break;
		    case 0x21:
			printf("Button left");
			break;
		    case 0x20:
			printf("Button right");
			break;
		    case 0x19:
			printf("Stop button");
			break;
		    case 0x18:
			printf("Pause button");
			break;
		    case 0x17:
			printf("Rec button");
			break;
		    case 0x16:
			printf(">");
			break;
		    case 0x15:
			printf("<<");
			break;
		    case 0x14:
			printf(">>");
			break;
		    case 0x13:
			printf("Button X");
			break;
		    case 0x12:
			printf("Button A");
			break;
		    case 0x11:
			printf("Volume down");
			break;
		    case 0x10:
			printf("Volume up");
			break;
		    case 0x09:
			printf("Button 9");
			break;
		    case 0x08:
			printf("Button 8");
			break;
		    case 0x07:
			printf("Button 7");
			break;
		    case 0x06:
			printf("Button 6");
			break;
		    case 0x05:
			printf("Button 5");
			break;
		    case 0x04:
			printf("Button 4");
			break;
		    case 0x03:
			printf("Button 3");
			break;
		    case 0x02:
			printf("Button 2");
			break;
		    case 0x01:
			printf("Button 1");
			break;
		    case 0x00:
			printf("Button 0");
			break;
		    case 0x1a:
			printf(">|");
			break;
		    case 0x1b:
			printf("<");
			break;
		    case 0x1c:
			printf("Unknown");
			break;
		    case 0x1d:
			printf("Unknown");
			break;
		    case 0x1e:
			printf("Button up");
			break;
		    case 0x1f:
			printf("Button down");
			break;
		    case 0x0a:
			printf("Clear");
			break;
		    case 0x0b:
			printf("ENTER");
			break;
		    case 0x0c:
			printf("Unknown");
			break;
		    case 0x0d:
			printf("WMS");
			break;
		    case 0x0e:
			printf("Mute");
			break;
		    case 0x0f:
			printf("Info");
			break;
		    case 0x4f:
			printf("Display");
			break;
		    case 0x51:
			printf("Title");
			break;
		    case 0x64:
			printf("Guide");
			break;
		    case 0x68:
			printf("Button X");
			break;
		    case 0x66:
			printf("Button A");
			break;
		    }
		printf("\n", valueread);
		if (msg[0] == wait_for)
		    break;
	    }
	}
	wait(1);
    }

}

The remote control works as a lowbase of the xbox360, so the power on and off still work in Linux, also you can get all the IR codes into linux. So 'if' a Mediacenter is ever ported to Xbox 360 Linux, you could use the official remote. (IR codes and info retrieved by Icekiller, with SMC.C from tmbinc, small remote by kwkward)