User:Vprada

From MythTV Official Wiki
Jump to: navigation, search

My MythBOX Project

My intention with this page is just tell my journey building my MythBox.

I have been using MythTv for a few months now, and I decide (let's be Honest, I finally convince my Wife) to create a complete Media Center using MythTV. Any comments are more than welcome.

Hardware

Here's a List of the Hardware I'm planning to use

I was planning to use a smaller case, but my TV Card requires a full height PCI Slot, thus I finish up picking this one. On the other hand, this Case has a 350W power supply (the other one have a 250W one)
Searching MB I Found this one that look to me as a good fit for MythTV. It has TV Outputs (DVI/Component), Firewire port and can handle a Dual Core AMD. The embedded video card is a NVIDIA GeForce 6150. I got a good deal on this one, I found a Open Box for 50 bucks!

Important.png Note: This motherboard is very picky with the Memory, and will only accept memory from some vendors. (Kingston, Samsung, Corsair)

  • Processor : AMD Athlon 64 X2 3600+ Windsor 2.0GHz Socket AM2
  • TV Capture Card: KWorld ATSC-110, Twinhan 102G
I was looking for a cheap Card and I found this one for $65 with a mail-in rebate of $15. Let's see how well it works
I also add a DVB-S card to my configuration (I can get many Spanish channels via Satellite)
This is not a Huge Drive, but i will use it as starting point. I will use LVM for the MythTV Storage folder,thus i should be able to add an additional HD if I need
  • LCD Display: Nothing yet
In the future I have plans to add a LCD display, but right now that represent another $100.

Vprada 19:56, 28 March 2007 (UTC)

Assambling Everything

Just a few problems assambling everything. Everything was pretty tight inside the case and actually the DVD Writer almost cover the CPU. On the other hand the DVD tray wont open because it is wider than the plate that is installed in the case. I Will have to fix that.

The Motherboard came with TV-Out bracket and even though I installed, may be I will remove it cause I'm using a DVI-2-HDMI cable to connect the PC to the TV. I will get a SPDIF bracket instead (i have to buy It at ASUS website) to have the sound pass through my home theater...

Vprada

Software

Distribution : openSUSE 10.2

I have been using SUSE since many years ago, thus I did prefer to stick with openSUSE rather than try those distributions that came mythTV ready...Using openSUSE will require some additional software though. For filesystem I'm using Reiser for the root and XFS to the /store folder (the myth from SVN has the option to select several storage folders)

Addtional Software
a52dec
ffmpeg
gpac
lame
libdvdcss
mpeg2dec
x264
xmltv
xvidcore

I download mythTV from SVN Revision 13208

Kernel Modification

I am using the Kworld ATSC-110 Capture card. This capture card worked right away with the OpenSuse Kernel using modules saa7134,saa7134-dvb and saa7134-alsa. The piece missed on this puzzle was the Remote Control. To activate the remote control i have to patch the kernel (2.6.18.8) to make it work. I found a patch at the dvb mailing list and I did apply it. On OpenSuSe I have to manuualy apply some part of the path to make it work. For those who need it, I'm pasting the patch i made here:

--- ir-kbd-i2c.c.orig	2007-04-08 21:16:09.000000000 -0500
+++ ir-kbd-i2c.c	2007-04-08 21:44:12.000000000 -0500
@@ -61,6 +61,8 @@
 
 /* ----------------------------------------------------------------------- */
 
+static int kworldatsc110 = 0; /* Both KNC1 and the Kworld ATSC110 cards use the same i2c address */
+
 static int get_key_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
 {
 	unsigned char buf[3];
@@ -134,14 +136,17 @@
 
 	/* it seems that 0xFE indicates that a button is still hold
 	   down, while 0xff indicates that no button is hold
-	   down. 0xfe sequences are sometimes interrupted by 0xFF */
+	   down. 0xfe and 0x80 sequences are sometimes interrupted by 0xFF */
 
 	dprintk(2,"key %02x\n", b);
 
 	if (b == 0xff)
 		return 0;
 
-	if (b == 0xfe)
+        /* KNC1 card            = 0xfe */
+        /* Kworld ATSC110 card  = 0x80 */
+
+	if ((b == 0xfe)||(b & 0x80))
 		/* keep old data */
 		return 1;
 
@@ -339,10 +344,15 @@
 		}
 		break;
 	case 0x30:
-		name        = "KNC One";
 		ir->get_key = get_key_knc1;
 		ir_type     = IR_TYPE_OTHER;
-		ir_codes    = ir_codes_empty;
+		if (kworldatsc110 == 1) {
+			name        = "Kworld ATSC110";
+			ir_codes    = ir_codes_kworld_atsc110;
+		} else {
+			name        = "KNC One";
+			ir_codes    = ir_codes_empty;
+		}  
 		break;
 	case 0x7a:
 	case 0x47:
@@ -430,7 +440,7 @@
 	*/
 
 	static const int probe_bttv[] = { 0x1a, 0x18, 0x4b, 0x64, 0x30, -1};
-	static const int probe_saa7134[] = { 0x7a, 0x47, 0x30, -1 };
+	static const int probe_saa7134[] = { 0x7a, 0x47, 0x30, 0x71, -1 };
 	static const int probe_em28XX[] = { 0x30, 0x47, -1 };
 	const int *probe = NULL;
 	struct i2c_client c;
@@ -459,6 +469,30 @@
 	for (i = 0; -1 != probe[i]; i++) {
 		c.addr = probe[i];
 		rc = i2c_master_recv(&c,&buf,0);
+
+		/* Special case for Kworld ATSC110 remote */
+		if (c.adapter->id == I2C_HW_SAA7134 && probe[i] == 0x30)
+		{
+			struct i2c_client c2;
+			
+			memset (&c2, 0, sizeof(c2));
+			c2.adapter = c.adapter;
+				
+			for (c2.addr=127; c2.addr > 0; c2.addr--) {
+				if (0 == i2c_master_recv(&c2,&buf,0)) {
+					dprintk(1,"Found another device, at addr 0x%02x\n", c2.addr);
+					break;
+				}
+			}
+
+			/* Now do the probe. The controller does not respond
+			   to 0-byte reads, so we use a 1-byte read instead. */
+			rc = i2c_master_recv(&c,&buf,1);
+			rc--;
+			kworldatsc110 = 1;
+		} else {
+			rc = i2c_master_recv(&c,&buf,0);
+		}
 		dprintk(1,"probe 0x%02x @ %s: %s\n",
 			probe[i], adap->name,
 			(0 == rc) ? "yes" : "no");
--- saa7134-i2c.c.orig	2007-04-08 21:16:09.000000000 -0500
+++ saa7134-i2c.c	2007-04-08 21:55:35.000000000 -0500
@@ -340,6 +340,8 @@
 
 	switch (client->addr) {
 		case 0x7a:
+		case 0x71:
+		case 0x30:
 		case 0x47:
 		{
 			struct IR_i2c *ir = i2c_get_clientdata(client);
--- ir-keymaps.c.orig	2007-04-08 21:16:09.000000000 -0500
+++ ir-keymaps.c	2007-04-08 21:53:30.000000000 -0500
@@ -1473,3 +1473,57 @@
 };
 
 EXPORT_SYMBOL_GPL(ir_codes_npgtech);
+
+IR_KEYTAB_TYPE ir_codes_kworld_atsc110[IR_KEYTAB_SIZE] = {
+        [ 0x0 ] = KEY_1,
+        [ 0x1 ] = KEY_2,
+        [ 0x2 ] = KEY_3,
+        [ 0x3 ] = KEY_4,
+        [ 0x4 ] = KEY_5,
+        [ 0x5 ] = KEY_6,
+        [ 0x6 ] = KEY_7,
+        [ 0x7 ] = KEY_8,
+        [ 0x8 ] = KEY_9,
+        [ 0xa ] = KEY_0,
+        [ 0x9 ] = KEY_ESC,              /* UP ARROW */
+        [ 0xc ] = KEY_POWER,            /* POWER */
+        [ 0x0a ] = KEY_MUTE,            /* MUTE */
+        [ 0x0b ] = KEY_SEARCH,         /* SEARCH */
+        [ 0x0d ] = KEY_EPG,             /* GUIDE */
+        [ 0x1b ] = KEY_RECORD,          /* RECORD */
+        [ 0x16 ] = KEY_PAUSE,           /* PAUSE */
+        [ 0x1a ] = KEY_STOP,            /* STOP */
+        [ 0x1d ] = KEY_VOLUMEDOWN,      /* VOLUME- */
+        [ 0x1c ] = KEY_VOLUMEUP,        /* VOLUME+ */
+        [ 0x1f ] = KEY_CHANNELDOWN,     /* CHANNEL/PAGE- */
+        [ 0x1e ] = KEY_CHANNELUP,       /* CHANNEL/PAGE+ */
+        [ 0x10 ] = KEY_UP,              /* KEY_SCROLLUP */
+        [ 0x12 ] = KEY_LEFT,            /* KEY_BACK */
+        [ 0xe  ] = KEY_ENTER,           /* KEY_ENTER */
+        [ 0x13 ] = KEY_RIGHT,           /* KEY_FORWARD */
+        [ 0x11 ] = KEY_DOWN,            /* KEY_SCROLLDOWN */
+        [ 0x14 ] = KEY_MUTE,            /* MUTE */
+        [ 0x15 ] = KEY_AUDIO,           /* STEREO */
+        [ 0x16 ] = KEY_VIDEO,           /* SOURCE */
+        [ 0x17 ] = KEY_ZOOM,            /* ZOOM */
+        [ 0x18 ] = KEY_PRINT,           /* SHUTDOWN */
+        [ 0X19 ] = KEY_T,               /* TIMESHIFT */
+        [ 0x44 ] = KEY_PLAYPAUSE,       /* PAUSE/PLAY */
+        [ 0x45 ] = KEY_STOP,            /* STOP */
+        [ 0x40 ] = KEY_REWIND,          /* REWIND */
+        [ 0x41 ] = KEY_FORWARD,         /* FASTFORWARD */
+        [ 0x42 ] = KEY_PREVIOUSSONG,    /* PREVIOUS */
+        [ 0x43 ] = KEY_NEXTSONG,        /* NEXT */
+
+        // buttons a-h
+        [ 0x48 ] = KEY_A, 
+        [ 0x49 ] = KEY_B,
+        [ 0x4a ] = KEY_C,
+        [ 0x4b ] = KEY_D,
+        [ 0x4c ] = KEY_E,
+        [ 0x4d ] = KEY_F,
+        [ 0x4e ] = KEY_G,
+        [ 0x4f ] = KEY_H
+};
+
+EXPORT_SYMBOL_GPL(ir_codes_kworld_atsc110);

Sound Problems

I add to my configuration a DVB-S (Satellite) card to my setup and the following problem arise. When I changed a Channel the Sound Card volume mute off, but there wasn't a way to restore the volume with the mixer, the only thing that works was to reload the audio driver, but of course for a standalone media center with no keyboard this is not a solution. After a while, a found out that by disable the internal Myth Volume control (on mythfrontend->setup) i was able to change channels without losing the audio... I really don't know if this is a problem with my configuration or just a bug on the SVN...

FIXED: This mother board uses the module intel-hda as sound driver. When i was playing a record or watching LiveTV, there was an annoying high pitch sound on the background. Looking on the Internet, I found the module options needed to make the noise dissappear... Now the sound is working like a charm... here is the content of my /etc/modprobe.d/sound


alias snd-card-0 snd-hda-intel
alias sound-slot-0 snd-hda-intel
options snd-hda-intel position_fix=1 model=3stack