Building a Linux-based HTPC Part 4

Continued from part 3.

Linux Customization

Here’s a guide for debugging sound card problems. There seems to be hope for the Realtek AlC889 hardware. And there’s this post. Here’s a note on PulseAudio.this part

Well, this part went very smoothly. Everything worked fine.

SilverStone Rebate – great news!

I just received my $20 rebate check from SilverStone. The process is a little more complicated than it was for similar rebates years ago. You need to “pre-register” which I did. But they were suppose to send me e-mail to get the form. Instead, I “registered” again, and a web page appeared and wanted to know the manufacturer, the invoice number, date of purchase, etc. This was similar to the memory rebate.

Well, since it took weeks for me to get all of the parts, I noticed when I filled out the rebate for the SilverStone case, that I had waited too long. It was 2 days past the date that the rebate form had to be postmarked. I said “what the heck” and I sent it in anyway.

Well – the rebate check came yesterday. And the check was hand signed. SilverStone – you are great!

I just got the Crucial rebate. Finally. 2 months later

How do I fix Bent Sata pins?

I was inserting a new disk drive, and the metal case holding the drives fell down, and the sata plug broke. The black plastic piece broke off, and the pins were bent.

After swearing loudly, I looked into solutions. This is how I fixed the problem.

I found this discussion of combing.

I straightened the pins, and kept the black plastic piece. I did a dry fit practice run of holding the black plastic to the pins. I used some business cards to create a gentle wedge that would hold the pins against the black plastic piece. I took my time.

When I was ready, I placed some superglue on the black plastic and used the wedge to hold the plastic against the metal pins. When that was drying, I put a long sata cable into the plug hole to make sure everything was sitting correctly.

Then I put some 5-minute clear epoxy where the sata cable pluged into the disk. I let this drive. The sata cable is now permanently fastened to the disk, but it will let me recover the data and use the disk for a while. I might be able to remove and insert it, and still keep the sata pins from breaking.

Mythtv issues

Because I installed munin, I notices my mysql innodb table was critical. I probably have too much in the database. I need to resolve this issue.

It turned out I had hardware issues as well. I tried to install a new OS. Mythtv still did not work. It ended up being a mess.

Dead Video – Beginning of the MythTV Woes

Selecting a new tuner

My old PVR-150 card died. Actually, I snapped off the coax cable connector while struggling to get the chassis in place.

I found out that the pvr-150 isn’t supported if you have more that 4GB. So it’s just as well I got a new tuner.

I bought a Haugppauge HVP-1250. And I had some problems. I also bought a Hauppauge PVR-950Q. I planned to return the one that did not work.

The lines that helped the most was This one which told me I had a HVP-1255 card, not a 1250 card. This is card=20, not card=3. Haugppage says the card in unsupported in Linux. Hmm.

Anyhow,  I created a file /etc/modprobe.conf and it had

options cx23885 card=20

options CORE_cx23885[0]_dvb adapter_nr=0

I had problems.

Getting frustrated, I ordered a different TV tuner from Amazon – the Hauppauge HVR-950Q.

First thing, according to the mythtv wiki, I created the file /etc/modprobe.d/xc5000.cf that contained

options xc5000 no_poweroff=1

I also see that w_scan was buggy. I used in information from KernelLabs to get the proper source of w_scan. I downloaded both versions. Neither worked. But perhaps the no_poweroff option didn’t get installed. I tried to rmmod, but the driver was busy. So I (sigh) rebooted (Linux gurus hate to reboot).  This time I had to use the new version. But it worked!

Finding the channels

w_scan doesn’t work. I get

I also installed w-scan mplayer dvbstream dvb-apps.
ERROR: Sorry - i couldn't get any working frequency/transponder

Trying this link.

But the status looks okay. This link looks promising. That didn’t work.

Let me document what I see.

% lspci -d 14f1:8880 -v
03:00.0 Multimedia video controller: Conexant Systems, Inc. Hauppauge Inc. HDPVR-1250 model 1196 (rev 04)
Subsystem: Hauppauge computer works Inc. Device 2259
Flags: bus master, fast devsel, latency 0, IRQ 17
Memory at f7a00000 (64-bit, non-prefetchable) [size=2M]
Capabilities: [40] Express Endpoint, MSI 00
Capabilities: [80] Power Management version 3
Capabilities: [90] Vital Product Data <?>
Capabilities: [a0] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 Enable-
Capabilities: [100] Advanced Error Reporting <?>
Capabilities: [200] Virtual Channel <?>
Kernel driver in use: cx23885
Kernel modules: cx23885

This does not look like this results. But it is similar.  My driver might be newer. dmesg | grep cx23885 says:

[    7.689374] cx23885 driver version 0.0.2 loaded
[    7.689409] cx23885 0000:03:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
[    7.689477] CORE cx23885[0]: subsystem: 0070:2259, board: Hauppauge WinTV-HVR1255 [card=20,insmod option]
[    7.836815] cx23885[0]: hauppauge eeprom: model=22111
[    7.836817] cx23885_dvb_register() allocating 1 frontend(s)
[    7.836819] cx23885[0]: cx23885 based dvb card
[    8.275454] DVB: registering new adapter (cx23885[0])
[    8.275705] cx23885_dev_checkrevision() Hardware revision = 0xd0
[    8.275712] cx23885[0]/0: found at 0000:03:00.0, rev: 4, irq: 17, latency: 0, mmio: 0xf7a00000
[    8.275719] cx23885 0000:03:00.0: setting latency timer to 64
[    8.275724] IRQ 17/cx23885[0]: IRQF_DISABLED is not guaranteed on shared IRQs

% dmesg | grep DVB
[    7.836809] tveeprom 5-0050: TV standards NTSC(M) ATSC/DVB Digital (eeprom 0x88)
[    8.275454] DVB: registering new adapter (cx23885[0])
[    8.275458] DVB: registering adapter 0 frontend 0 (Samsung S5H1411 QAM/8VSB Frontend)…

Looking at this link and this link suggest I need custom source code. Sigh.

Right now I am trying

dvbscan -out channels - -frontend /dev/dvb/adapter0/frontend0 /usr/share/dvb/atsc/us-Cable-Standard-center-frequencies-QAM256

and I’m still waiting for an output. It’s been 12 hours, and nothing yet. I saw this link about making sure you have the latest firmware. That didn’t help.

I grabbed the sources of w_scan. There were errors in the w_scan_start.sh file which I had to fix.

So following the steps on the w_scan site for English speakers, I typed

sudo mkdir /etc/vdr

w_scan -ft -c US >> /etc/vdr/channels.conf

While doing that, I was getting some errors

(time: 15:14) Info: PAT filter timeout
Info: VCT(terrestrial) filter timeout
tune to: 8VSB     f=183000 kHz
(time: 15:32) Info: PAT filter timeout

mkdir -p ~/.mplayer/
w_scan-X -cUS >~/.mplayer/channels.conf

Scanning for channels.

I was having problems getting channel scanning to work properly.

This link about adding digital cable channels was useful. I also found this link comparing dvbscan, scan, w_scan to be useful.

I did a dmesg|grep adapter

then once I got the proper numberof the adapter, I did

dvbscan -filter tv -adapter 1 /usr/share/dvb/atsc/us-NTSC-center-frequencies-8VSB

and got

Unable to query frontend status

I found a note from kernellabs and this message from Mark Lord

http://www.kernellabs.com/blog/?p=1388 – this is good

I also found out that the old PVR-150 card that I had would not work on my new computer because I have more than 4GB of RAM.

I am able to get tvtime to work (no sound yet). But mplayer shows green

I got errors when using “mplayer tv://”, i.e.

inputs: 0 = Television; 1=Composite; 2= S-VIdeo:

Current input: 1

rename_tuners.sh

I saw Mark Lord’s post here, where he mentioned rename_tuners.sh

This is a handy tool, because having names that change depending on what is plugged in crerates instability. Its much better to have a consistent name.

I downloaded it, but it did not work for me at first.

I tried rename_tuners.sh –test and it reported:

logger: rename_tuners.sh: # started
 logger: rename_tuners.sh: # waiting for pctv800i: to show up
 logger: rename_tuners.sh: # pctv800i v4l device not found
 logger: rename_tuners.sh: # pctv800i dvb device not found
 logger: rename_tuners.sh: # hvr950q v4l device not found
 logger: rename_tuners.sh: # hvr950q dvb device not found
 logger: rename_tuners.sh: # pvr250 v4l device not found
 logger: rename_tuners.sh: # waited 10 seconds for all required tuners to show up
 logger: rename_tuners.sh: # making new V4l links
 logger: rename_tuners.sh: # /bin/ln -sf dsp? /dev/pctv800i_dsp
 logger: rename_tuners.sh: # /bin/ln -sf mixer? /dev/pctv800i_mixer
 logger: rename_tuners.sh: # making new dvb links
 logger: rename_tuners.sh: # all done.

It only found two links. Note that the v4l and the dvb link is missing. Looking at the source code, I found that it was executing the command

readlink  /sys/class/dvb/dvb0.dvr0

which returned

../../devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.3/dvb/dvb0.dvr0

so I changed

tuners["hvr950q"]='dvb+v4l pci0000:00/0000:00:1a.7/usb1/1-3/1-3.4'

to

tuners["hvr950q"]='dvb+v4l pci0000:00/0000:00:1a.0/usb1/1-1/1-1.3'

Note that the script has the -list option:

./rename_tuners.sh --list

it provides the data you need. Now when I execute the script, I get:

logger: rename_tuners.sh: # started
 logger: rename_tuners.sh: # hvr950q v4l device ok
 logger: rename_tuners.sh: # hvr950q dvb device ok
 logger: rename_tuners.sh: # waited 0 seconds for all required tuners to show up
 logger: rename_tuners.sh: # making new V4l links
 logger: rename_tuners.sh: # /bin/ln -sf video0 /dev/hvr950q_video
 logger: rename_tuners.sh: # /bin/ln -sf vbi0 /dev/hvr950q_vbi
 logger: rename_tuners.sh: # /bin/ln -sf dsp? /dev/hvr950q_dsp
 logger: rename_tuners.sh: # /bin/ln -sf mixer? /dev/hvr950q_mixer
 logger: rename_tuners.sh: # making new dvb links
 logger: rename_tuners.sh: # /bin/ln -sf adapter0 /dev/dvb/adapter_hvr950q
 logger: rename_tuners.sh: # all done.

Much better. AFter running it with the –test option, I ran it as root to create the links.

Anyhow I was getting frustrated. I looked into other cards.

HVR-1600 Card

There is a conflict with the NVIDIA driver and thecx18 driver.

This link explains how to modify grub to allocate more virtual memory to prevent this problem.

Hauppauge HVR-2250 Card

However, one person said the HVR-2250 card is the one to get. It has two twin tuners, so I can record two channels at the same time.

It also has a MPEG-2 hardware, so it can receive analog without sweating.

I plugged it in, using the top coax connector (for TV – The bottom one is for FM Radio) and it didn’t work.

dmesg|grep saa

returned nothing, so the driver wasn’t working.

I used this page for the for the driver. That is, I did

wget http://www.steventoth.net/linux/hvr22xx/22xxdrv_27086.zip
wget http://www.steventoth.net/linux/hvr22xx/HVR-12x0-14x0-17x0_1_25_25271_WHQL.zip
wget http://www.steventoth.net/linux/hvr22xx/extract.sh
sh extract.sh
cp *fw /lib/firmware.2.6.38-6-server
apt-get install mercurial libncurses5-dev
hg clone http://kernellabs.com/hg/saa7164-stable/
cd saa7164-stable

And then I tried to make the new kernel as instructed. It failed. kfree was undefined.

Next I found a blog link that said the sources were merged into the linux-tv code base.
I followed the directions here

I followed the directions.  I build the modules, and installed them. I rebooted. I got the following error

[   17.894009] saa7164 driver loaded
[   17.894063] saa7164 0000:04:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
[   17.895004] CORE saa7164[0]: subsystem: 0070:8851, board: Hauppauge WinTV-HVR2250 [card=7,autodetected]
[   17.895008] saa7164[0]/0: found at 0000:04:00.0, rev: 129, irq: 17, latency: 0, mmio: 0xf7800000
[   17.895013] saa7164 0000:04:00.0: setting latency timer to 64
[   18.092111] saa7164_downloadfirmware() no first image
[   18.092130] saa7164_downloadfirmware() Waiting for firmware upload (NXP7164-2010-03-10.1.fw)
[   18.109432] saa7164_downloadfirmware() Upload failed. (file not found?)

While researching the problem, I found this link h and did

wget http://www.steventoth.net/linux/hvr22xx/firmwares/4019072/NXP7164-2010-03-10.1.fw
sudo cp NXP7164-2010-03-10.1.fw /lib/firmware/

rmmod saa7164
modprobe saa7164
 and now I get
2801.682471] saa7164 0000:04:00.0: PCI INT A disabled
[ 2809.705227] saa7164 driver loaded
[ 2809.705304] saa7164 0000:04:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
[ 2809.707882] CORE saa7164[0]: subsystem: 0070:8851, board: Hauppauge WinTV-HVR2250 [card=7,autodetected]
[ 2809.707890] saa7164[0]/0: found at 0000:04:00.0, rev: 129, irq: 17, latency: 0, mmio: 0xf7800000
[ 2809.707901] saa7164 0000:04:00.0: setting latency timer to 64
[ 2809.905702] saa7164_downloadfirmware() no first image
[ 2809.905713] saa7164_downloadfirmware() Waiting for firmware upload (NXP7164-2010-03-10.1.fw)
[ 2809.916824] saa7164_downloadfirmware() firmware read 4019072 bytes.
[ 2809.916830] saa7164_downloadfirmware() firmware loaded.
[ 2809.916847] saa7164_downloadfirmware() SecBootLoader.FileSize = 4019072
[ 2809.916855] saa7164_downloadfirmware() FirmwareSize = 0x1fd6
[ 2809.916859] saa7164_downloadfirmware() BSLSize = 0x0
[ 2809.916863] saa7164_downloadfirmware() Reserved = 0x0
[ 2809.916867] saa7164_downloadfirmware() Version = 0x1661c00
[ 2817.122736] saa7164_downloadimage() Image downloaded, booting...
[ 2817.232395] saa7164_downloadimage() Image booted successfully.
[ 2819.564972] saa7164_downloadimage() Image downloaded, booting...
[ 2821.100087] saa7164_downloadimage() Image booted successfully.
[ 2821.150397] saa7164[0]: Hauppauge eeprom: model=88061
[ 2821.883609] DVB: registering new adapter (saa7164)
[ 2825.524966] DVB: registering new adapter (saa7164)
[ 2825.525557] saa7164[0]: registered device video0 [mpeg]
[ 2825.755692] saa7164[0]: registered device video1 [mpeg]
[ 2825.966034] saa7164[0]: registered device vbi0 [vbi]
[ 2825.966104] saa7164[0]: registered device vbi1 [vbi]

Success!

Next - I ran mythtv-setup
I created four capture cards
The first two were card type ITTV (MPEG-2)
and named /dev/video0 and /dev/video1
The next two capture cards are DVB type and named /dev/dvb/adapter0/frontend0 and /dev/dvb/adapter1/frontend0

I connected them to SchedulesDirect.

There still is some tweaking to do, but analog is working!

Advertisements
This entry was posted in Linux and tagged , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s