[mythtv-users] ivtv problems

Craig Longman craigl at begeek.com
Sat Apr 26 18:15:35 UTC 2003


Huge thanks to Karl Bongers for this solution.  Below are two different listings, jvc_raw.c which will create a raw formatted lirc.conf entry for the DishNetwork IR Remote set to the default channel.  The second is the working lirc.conf I'm using on my system.  Depending on your motherboard timing you may need to tweak the timing values for PULSE_LEN, HEADER_SPACE, ONE_LEN, and ZERO_LEN.

------------- jvc_send.c --------------

/*--------------------------------------------------
 jvc_raw.c - Make special raw lircd.conf definitions.
 Author: Karl Bongers
 ---------------------------------------------------*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>

#include <linux/ioctl.h>
#include <asm/types.h>
#define LIRC_SET_SEND_CARRIER          _IOW('i', 0x00000013, __u32)
#define LIRC_SET_SEND_DUTY_CYCLE       _IOW('i', 0x00000015, __u32)

#define MODULATION_FREQ 57600
//#define MODULATION_FREQ 38000

/* 0 to 100, where 100=strongest? */
#define DUTY_CYCLE 50

/* 1 block takes up 16bits*2+2, or 34 samples.  lirc_serial
   has a 256 sample buffer, so we can send max 7 back to back
   signals. */
#define NUM_BACK_TO_BACK 6

#define POWER_BITS 0xf7ff; /* power button bits */
//#define PULSE_LEN 350
//#define HEADER_SPACE 6000
//#define ONE_LEN 2700
//#define ZERO_LEN 1700
#define PULSE_LEN 350
#define HEADER_SPACE 6050
#define ONE_LEN 2600
#define ZERO_LEN 1600

static unsigned int data[1024];
int fd;
int duty_cycle, freq;
int num_times_to_send = 1;

typedef struct {
  char str[40];
  unsigned int code;
} Lookup;

Lookup lookup[] = {
  {"tv/video",      0x000000000000A3FF},
  {"power",         0x000000000000F7FF},
  {"menu",          0x000000000000D3FF},
  {"page_up",       0x000000000000C3EF},
  {"page_down",     0x000000000000E3EF},
  {"guide",         0x000000000000AFFF},
  {"pointer_up",    0x00000000000097FF},
  {"pointer_left",  0x0000000000008FFF},
  {"pointer_right", 0x0000000000009FFF},
  {"pointer_down",  0x00000000000087FF},
  {"select",        0x000000000000BFFF},
  {"recall",        0x00000000000093FF},
  {"info",          0x000000000000FFFF},
  {"view",          0x000000000000A7FF},
  {"cancel",        0x000000000000B7FF},
  {"sys_info",      0x0000000000006FFF},
  {"record",        0x00000000000083FF},
  {"1",             0x000000000000EFFF},
  {"2",             0x000000000000EBFF},
  {"3",             0x000000000000E7FF},
  {"4",             0x000000000000DFFF},
  {"5",             0x000000000000DBFF},
  {"6",             0x000000000000D7FF},
  {"7",             0x000000000000CFFF},
  {"8",             0x000000000000CBFF},
  {"9",             0x000000000000C7FF},
  {"0",             0x000000000000BBFF},
  {"*",             0x0000000000006BFF},
  {"#",             0x00000000000067FF},
  {"", 0} };
 
int main(int argn, char *argv[])
{
  int i,j,k,li;
  unsigned int v;

printf("begin remote\n \
\n \
  name   JVC_RAW\n \
  flags CONST_LENGTH|RAW_CODES\n \
  eps            30\n \
  aeps          100\n \
\n \
  ptrail          0\n \
  repeat     0     0\n \
  gap    100000\n \
\n \
      begin raw_codes\n");



  li = 0;
  while (lookup[li].str[0] != 0) {
    /* fill up our buffer with signal data to send driver */
    j = 0;
    for (k=0; k<NUM_BACK_TO_BACK; k++)
    {
      data[j++] = PULSE_LEN;
      data[j++] = HEADER_SPACE;
  
      v = lookup[li].code;
  
      for (i=0; i<16; i++) {
        data[j++] = PULSE_LEN;
        if (v & 0x8000)
             data[j++] = ONE_LEN;
        else data[j++] = ZERO_LEN;
        v <<= 1;
      }
    }
    --j;

    printf("\n  name    %s", lookup[li].str);
    for (k=0; k<j; k++)
    {
      if ((k % 6) == 0) printf("\n     ");
      printf("%5d  ", data[k]);
    }

    ++li;
  }
  printf("\n \
      end raw_codes\n \
\n \
end remote\n");

  return(EXIT_SUCCESS);
}

---------------- jvc_raw > lircd.conf ----------------

begin remote
 
   name   JVC_RAW
   flags CONST_LENGTH|RAW_CODES
   eps            30
   aeps          100
 
   ptrail          0
   repeat     0     0
   gap    100000
 
       begin raw_codes

  name    select
       350   6050    350   2600    350   1600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   6050  
       350   2600    350   1600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   6050    350   2600  
       350   1600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   6050    350   2600    350   1600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   6050  
       350   2600    350   1600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   6050    350   2600  
       350   1600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350  
  name    1
       350   6050    350   2600    350   2600  
       350   2600    350   1600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   6050  
       350   2600    350   2600    350   2600  
       350   1600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   6050    350   2600  
       350   2600    350   2600    350   1600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   6050    350   2600    350   2600  
       350   2600    350   1600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   6050  
       350   2600    350   2600    350   2600  
       350   1600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   6050    350   2600  
       350   2600    350   2600    350   1600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350  
  name    2
       350   6050    350   2600    350   2600  
       350   2600    350   1600    350   2600  
       350   1600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   6050  
       350   2600    350   2600    350   2600  
       350   1600    350   2600    350   1600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   6050    350   2600  
       350   2600    350   2600    350   1600  
       350   2600    350   1600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   6050    350   2600    350   2600  
       350   2600    350   1600    350   2600  
       350   1600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   6050  
       350   2600    350   2600    350   2600  
       350   1600    350   2600    350   1600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   6050    350   2600  
       350   2600    350   2600    350   1600  
       350   2600    350   1600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350  
  name    3
       350   6050    350   2600    350   2600  
       350   2600    350   1600    350   1600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   6050  
       350   2600    350   2600    350   2600  
       350   1600    350   1600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   6050    350   2600  
       350   2600    350   2600    350   1600  
       350   1600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   6050    350   2600    350   2600  
       350   2600    350   1600    350   1600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   6050  
       350   2600    350   2600    350   2600  
       350   1600    350   1600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   6050    350   2600  
       350   2600    350   2600    350   1600  
       350   1600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350  
  name    4
       350   6050    350   2600    350   2600  
       350   1600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   6050  
       350   2600    350   2600    350   1600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   6050    350   2600  
       350   2600    350   1600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   6050    350   2600    350   2600  
       350   1600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   6050  
       350   2600    350   2600    350   1600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   6050    350   2600  
       350   2600    350   1600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350  
  name    5
       350   6050    350   2600    350   2600  
       350   1600    350   2600    350   2600  
       350   1600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   6050  
       350   2600    350   2600    350   1600  
       350   2600    350   2600    350   1600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   6050    350   2600  
       350   2600    350   1600    350   2600  
       350   2600    350   1600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   6050    350   2600    350   2600  
       350   1600    350   2600    350   2600  
       350   1600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   6050  
       350   2600    350   2600    350   1600  
       350   2600    350   2600    350   1600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   6050    350   2600  
       350   2600    350   1600    350   2600  
       350   2600    350   1600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350  
  name    6
       350   6050    350   2600    350   2600  
       350   1600    350   2600    350   1600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   6050  
       350   2600    350   2600    350   1600  
       350   2600    350   1600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   6050    350   2600  
       350   2600    350   1600    350   2600  
       350   1600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   6050    350   2600    350   2600  
       350   1600    350   2600    350   1600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   6050  
       350   2600    350   2600    350   1600  
       350   2600    350   1600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   6050    350   2600  
       350   2600    350   1600    350   2600  
       350   1600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350  
  name    7
       350   6050    350   2600    350   2600  
       350   1600    350   1600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   6050  
       350   2600    350   2600    350   1600  
       350   1600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   6050    350   2600  
       350   2600    350   1600    350   1600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   6050    350   2600    350   2600  
       350   1600    350   1600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   6050  
       350   2600    350   2600    350   1600  
       350   1600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   6050    350   2600  
       350   2600    350   1600    350   1600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350  
  name    8
       350   6050    350   2600    350   2600  
       350   1600    350   1600    350   2600  
       350   1600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   6050  
       350   2600    350   2600    350   1600  
       350   1600    350   2600    350   1600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   6050    350   2600  
       350   2600    350   1600    350   1600  
       350   2600    350   1600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   6050    350   2600    350   2600  
       350   1600    350   1600    350   2600  
       350   1600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   6050  
       350   2600    350   2600    350   1600  
       350   1600    350   2600    350   1600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   6050    350   2600  
       350   2600    350   1600    350   1600  
       350   2600    350   1600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350  
  name    9
       350   6050    350   2600    350   2600  
       350   1600    350   1600    350   1600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   6050  
       350   2600    350   2600    350   1600  
       350   1600    350   1600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   6050    350   2600  
       350   2600    350   1600    350   1600  
       350   1600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   6050    350   2600    350   2600  
       350   1600    350   1600    350   1600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   6050  
       350   2600    350   2600    350   1600  
       350   1600    350   1600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   6050    350   2600  
       350   2600    350   1600    350   1600  
       350   1600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350  
  name    0
       350   6050    350   2600    350   1600  
       350   2600    350   2600    350   2600  
       350   1600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   6050  
       350   2600    350   1600    350   2600  
       350   2600    350   2600    350   1600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   6050    350   2600  
       350   1600    350   2600    350   2600  
       350   2600    350   1600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   6050    350   2600    350   1600  
       350   2600    350   2600    350   2600  
       350   1600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   6050  
       350   2600    350   1600    350   2600  
       350   2600    350   2600    350   1600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   6050    350   2600  
       350   1600    350   2600    350   2600  
       350   2600    350   1600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350   2600  
       350   2600    350   2600    350  
       end raw_codes
 
 end remote



More information about the mythtv-users mailing list