01-15-2011,04:52 PM 
Originally Posted by
mundl
Currently the kernel (2.6.32.2) has a problem with repeated open() and ioctl() of the HVR 4000 card.
I seems that it is an timing issue (thanks to Devin J. Heitmueller - Kernel Labs for the advise) with the DVB-T frontend (normally /dev/dvb/adapter0/frontend1).
The fix is only needed once, during channel scan or the import of channels.conf.
This works nice for me, hopefully a kernel fix replaces it soon.
hotfix for MythTV DVB-T scan:
-uninstall mythtv original version
-download the mythtv-0.22 source
-cd mythtv-0.22
-patch -p1 -i patch_hvr_4000_dvbt.txt
-./configure; make; make install
-mythtv-setup
- scan for DVB-T channels on frontend1 or use a channels.conf file
- make uninstall
-reinstall original version
This will add a lot of ugly usleep into the code and slows down mythtv-setupl, but DVB-T scanning should work now.
After DVB-T channel-scanning you can remove this version and use the standard
version of the distribution again, as this fix is only needed during scanning or import.
The patch file:
diff -crB mythtv-0.22/libs/libmythtv/dvbchannel.cpp mythtv-0.22_hvr4000_patch/libs/libmythtv/dvbchannel.cpp
*** mythtv-0.22/libs/libmythtv/dvbchannel.cpp 2009-10-12 22:22:25.000000000 +0200
--- mythtv-0.22_hvr4000_patch/libs/libmythtv/dvbchannel.cpp 2010-01-06 14:04:17.000000000 +0100
***************
*** 141,146 ****
--- 141,148 ----
if (fd_frontend >= 0)
{
close(fd_frontend);
+ usleep(5000000);
+ fprintf(stderr, "waiting for frontend.................................\n");
fd_frontend = -1;
dvbcam->Stop();
***************
*** 190,197 ****
--- 192,203 ----
QString devname = CardUtil::GetDeviceName(DVB_DEV_FRONTEND, device);
QByteArray devn = devname.toAscii();
+ VERBOSE(VB_CHANNEL, LOC + "DVB channel :" + devname);
+
for (int tries = 1; ; ++tries)
{
+ usleep(5000000);
+ VERBOSE(VB_CHANNEL, LOC + "Slowing down open DVB channel :" + devname);
fd_frontend = open(devn.constData(), O_RDWR | O_NONBLOCK);
if (fd_frontend >= 0)
break;
***************
*** 207,212 ****
--- 213,219 ----
usleep(50000);
}
+ usleep(50000);
dvb_frontend_info info;
bzero(&info, sizeof(info));
if (ioctl(fd_frontend, FE_GET_INFO, &info) < 0)
***************
*** 215,220 ****
--- 222,229 ----
"Failed to get frontend information." + ENO);
close(fd_frontend);
+ usleep(5000000);
+ fprintf(stderr, "waiting for frontend.................................\n");
fd_frontend = -1;
return false;
}
Mundl, is this patch still valid for MythTV 0.23.1/0.24?
I have the same problem with scanning for channels on HVR4000, here in Norway. Broadcast h264/HE-ACC.
Since I am a noob on patching anything in linux
. It would be nice to get feedback, on if it would help at all.... Thanks
1 members found this post helpful.