Opened 16 years ago

Closed 15 years ago

Last modified 15 years ago

#4752 closed enhancement (wontfix)

Add R5000 STB Support to MythTV

Reported by: alannisota@… Owned by: danielk
Priority: minor Milestone: unknown
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: yes

Description

The following patch and included firmware add R5000 STB support to MythTV: http://www.nextcomwireless.com/r5000/home.htm

Only Dish Network support with a ViP211 has been tested. I believe all other Dish Network STBs (with an R5000 modification) will work, as should BEV. DirecTV will R5000 boxes will definitely not work (though if someone has such a box, I'd be happy to work with you to get it working. I have a lot of the needed code written already). I have no idea what would happen with other Sat providers or Cable boxes with the R5000 mod.

Prerequisites: libusb 0.1.xx (Do NOT use the 0.9 or 1.0 alphas) kernel source for your kernel fxload lsusb (optional)

To use: apply the linux ehci module patch. and recompile/re-install your kernel modules

patch mythtv with the myth patch and recompile (only tested on SVN, should work with 0.21 when it is released)

plug R5000 into linux box and locate port: locate the relevant bus number:

cat /proc/bus/usb/devices
...
T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 26 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=ff(vend.) Sub=ff Prot=ff MxPS=64 #Cfgs=  1
P:  Vendor=04b4 ProdID=8613 Rev=a0.01
...
You are looking for Vendor=04b4 ProdID=8613
the important part here is Bus=01 and Dev#= 26.

using lsusb:

...
Bus 001 Device 026: ID 04b4:8613 Cypress Semiconductor Corp. CY7C68013 EZ-USB FX2 USB 2.0 Development Kit

now load the firmware:

fxload -t fx2 -D /proc/bus/usb/001/026 -I r5000.hex

(It will give an EOF error that you can ignore)

Go into myth-setup and select the R5000 device and configure a video source and input as usual. I had to enter the channels by hand (there may be a better way). make sure on the V4L screen to set the Frequecy equal to the channel number (this should hopefully be smoothed out in a future patch)

You should now be able to load up myth and record/watch live-tv as usual. If you want to use HD, you need my CoreAVC patches since ffmpeg can't support the variant of H264 AVC that DN uses yet. See: http://code.google.com/p/coreavc-for-linux/

Attachments (30)

r5000_r1.patch (92.2 KB) - added by anonymous 16 years ago.
MythTV patch rev1
r5000.hex (22.0 KB) - added by anonymous 16 years ago.
Firmware
ehci.patch (509 bytes) - added by anonymous 16 years ago.
ehci kernel module patch
r5000_r2.patch (89.6 KB) - added by alannisota@… 16 years ago.
Rev 2 of the Myth patch
r5000_r3.patch (96.4 KB) - added by alannisota@… 16 years ago.
Rev 3 of th Myth patch
r5000_r4.patch (100.8 KB) - added by alannisota@… 16 years ago.
Rev 4 of Myth patch
r5000_r5.patch (112.1 KB) - added by alannisota@… 16 years ago.
Rev 5 of Myth patch
r5000_r6.patch (113.0 KB) - added by alannisota@… 16 years ago.
Rev 6 of Myth patch
r5ktest.c (5.7 KB) - added by alannisota@… 16 years ago.
Test application
r5000_r7.patch (124.0 KB) - added by alannisota@… 16 years ago.
Rev 7 of myth patch
r5ktest.2.c (6.0 KB) - added by alannisota@… 16 years ago.
Updated test app (for Rev 7 of Myth patch)
r5000_r11.patch (138.6 KB) - added by anonymous 16 years ago.
Rev 11 of the MythTV patch
r5ktest.3.c (8.5 KB) - added by anonymous 16 years ago.
test app for use with Rev 11 of Myth patch
4752_r5k_r11_trunk18726.patch (137.4 KB) - added by David George <david@…> 16 years ago.
4752_r5k_r11_trunk18851.patch (143.5 KB) - added by David George <david@…> 16 years ago.
r5000_r14.patch (177.8 KB) - added by anonymous 15 years ago.
Version 14 for Stable branch
r5000_r14_trunk19162.patch (177.4 KB) - added by anonymous 15 years ago.
Version 14 for TRUNK
r5000_r15_trunk19162.patch (178.8 KB) - added by anonymous 15 years ago.
Version 15 for TRUNK
r5000_r15.patch (179.2 KB) - added by anonymous 15 years ago.
Version 15 for STABLE
r5000_r16.patch (179.8 KB) - added by anonymous 15 years ago.
Version 16 for STABLE
r5000_r16_trunk19162.patch (179.4 KB) - added by anonymous 15 years ago.
Version 16 for TRUNK
r5000_r17.patch (180.2 KB) - added by anonymous 15 years ago.
Version 17 for STABLE
r5000_r17_trunk19210.patch (179.8 KB) - added by anonymous 15 years ago.
Version 17 for TRUNK
h264_length.diff (7.6 KB) - added by anonymous 15 years ago.
Prevent double-length recordings on STABLE
r5000_r18.patch (184.8 KB) - added by anonymous 15 years ago.
Version 18 for STABLE
r5000_r18_trunk19501.patch (184.4 KB) - added by anonymous 15 years ago.
Version 18 for TRUNK
r5000_r19.patch (197.6 KB) - added by anonymous 15 years ago.
Version 19 for STABLE
r5000_r19_trunk19501.patch (197.2 KB) - added by anonymous 15 years ago.
Version 19 for TRUNK
r5000.512.hex (22.0 KB) - added by alannisota@… 15 years ago.
New firmware
4752_r5k_r19_trunk20440.patch (196.5 KB) - added by David George <david@…> 15 years ago.

Change History (95)

Changed 16 years ago by anonymous

Attachment: r5000_r1.patch added

MythTV patch rev1

Changed 16 years ago by anonymous

Attachment: r5000.hex added

Firmware

Changed 16 years ago by anonymous

Attachment: ehci.patch added

ehci kernel module patch

comment:1 Changed 16 years ago by alannisota@…

I forgot to mention: You will need to do a make clean and configure before building myth for R5000 support in myth to work properly

Changed 16 years ago by alannisota@…

Attachment: r5000_r2.patch added

Rev 2 of the Myth patch

comment:2 Changed 16 years ago by alannisota@…

Rev 2 adds support for identifying R5000 by serial number (when setting up the device, you'll get a list of connected R5000 devices to choose from). This allows multiple R5000s to be used in a single machine. Also cleans up some unused code.

Also a note about compatibility. The manufacturer informed me that the 6000 series boxes won't work with the current code, so it is limited to the ViP series Dish Network boxes until I get some test streams to implement the needed changes.

Changed 16 years ago by alannisota@…

Attachment: r5000_r3.patch added

Rev 3 of th Myth patch

comment:3 Changed 16 years ago by alannisota@…

Rev 3 adds preliminary support for DirecTV. Currently only HD DirecTV streams are supported (and only MPEG2, since no DirecTV enabled R5000 boxes support MPEG4 streams). Support for standard-def DirecTV streams should be added soon. The code is only lightly tested (it was tested with a stream dump, since I don't have access to an R5k enabled DirecTV box)

I've also cleaned up some more code

Make sure to rerun mythtv-setup and re-select your capture card, since new options have been added since Rev2.

Changed 16 years ago by alannisota@…

Attachment: r5000_r4.patch added

Rev 4 of Myth patch

comment:4 Changed 16 years ago by alannisota@…

Rev 4 adds support for SD directv streams, so DirecTV support should be complete (though very lightly tested). Adding support for Cable boxes is next I guess if I can get some sample streams.

Changed 16 years ago by alannisota@…

Attachment: r5000_r5.patch added

Rev 5 of Myth patch

comment:5 Changed 16 years ago by anonymous

Rev 5 adds support for Startchoice DSR boxes and the HDD external decoder (used by some C-Band and cable systems) This code is still very experimental of course.

comment:6 Changed 16 years ago by David George <david@…>

Just got a chance to test this with my R5000 enabled DirecTV receiver (Mitsu SR-HD5). Needed to 'yum install fxload libusb-devel' on Fedora 8 (no problem). Kernel 2.6.24.3 still needs the ehci patch (and it applies with a small offset).

Using trunk 16509 your patch applies with minimal fuzz and offsets, no rejects. Did a make clean and ./configure (required) and then make and make install. mythtv-setup can not add a new capture card or edit an existing card. The screen goes to the default background and the menu does not draw. I tried this with G.A.N.T. and Blue. All other screens in mythtv-setup work fine. Last thing displayed in the terminal window is Loading from: /usr/share/mythtv/themes/default/base.xml.

Changed 16 years ago by alannisota@…

Attachment: r5000_r6.patch added

Rev 6 of Myth patch

Changed 16 years ago by alannisota@…

Attachment: r5ktest.c added

Test application

comment:7 Changed 16 years ago by alannisota@…

Rev 6 fixes several issues with HDD and DSR STBs that have been uncovered with user testing. It doesn't really do much for any other boxes, but it is required to use the r5ktest.c application. The Test app will test that the R5000 is working properly in Linux. To compile, copy r5ktest.c into libs/libmythtv and from that directory do:

gcc -g -o r5ktest r5ktest.c r5000/*c -lusb

Use the --help switch for command line usage, but the following is the most common case:

./r5ktest -t directv -m READ_STREAM

This would read 10 seconds worth of data into raw.ts which should be playable with mplayer.

Before trying to use the r5000 with Mythtv, I recommend getting the test app to work. If you have problems with it please contact me offlist, and I'll give you instructions how to generate streams that I can use to debug. Please do not post results from r5ktest.c to this ticket, they won't be helpful.

comment:8 Changed 16 years ago by danielk

Owner: changed from Isaac Richards to danielk
Status: newassigned
Version: unknownhead

Changed 16 years ago by alannisota@…

Attachment: r5000_r7.patch added

Rev 7 of myth patch

Changed 16 years ago by alannisota@…

Attachment: r5ktest.2.c added

Updated test app (for Rev 7 of Myth patch)

comment:9 Changed 16 years ago by alannisota@…

Rev 7 fixes many issues for the DSR. HDD, and DirecTV boxes as found by user testing. These include proper initialization, IR commands, PAT/PMT issues, among others.

I don't think anyone besides me has gotten it working in Myth yet, but would appreciate comments on what might need to be fixed (other than bugs) to get it included in myth. It doesn't make any sense to include until others have actually gotten it working, but that time should come soon.

comment:10 Changed 16 years ago by David George <david@…>

Thanks for all the time you spent with me last week fine tuning the DirecTV parts. I was only able to get back to testing this today and I was able to set it up in MythTV and successfully recorded something. The only problem I have noticed so far is the power seems to be inverted. The STB was on when the following was logged:

2008-03-17 15:11:12.025 SetChannelByNumber(75)
2008-03-17 15:11:12.028 R5kDev: Requesting STB Power State
2008-03-17 15:11:12.130 R5kDev: Off

Later when a recording was scheduled:

2008-03-17 15:11:12.366 R5kDev: Off
2008-03-17 15:11:12.368 SM(-sernum-)::AddFlags: Seen(STB,) Match() Wait()
2008-03-17 15:11:12.370 R5kDev: Powering on
2008-03-17 15:11:15.976 R5kDev: Requesting STB Power State
2008-03-17 15:11:16.087 R5kDev: On

This actually turned the STB off. I manually powered it on so it would record something. Sorry for not tracking it down further.

comment:11 Changed 16 years ago by alannisota@…

Please try using r5ktest with '--cmd TOGGLE_POWER' I verified that it should be working properly with the data you provided me with, so this is quite strange.

comment:12 Changed 16 years ago by David George <david@…>

The r5ktest program doesn't check the current power state. It only toggles it, so it seemed to do what we wanted when we were testing (and when I tried it now). I added the following before and after the r5000_toggle_on_off in r5ktest:

    printf("Before: current power state is %s\n", r5000_get_power_state(usbdev) ? "On" : "Off");
    printf("After: current power state is %s\n", r5000_get_power_state(usbdev) ? "On" : "Off");

With the above debug it shows that the STB is off when it is actually on and vice-versa. I changed the double not (!!) in the r5000_get_power_state routine and it works correctly now, but I am not sure that is the proper fix.

comment:13 Changed 16 years ago by David George <david@…>

I should have said I changed the double not (!!) to a single not (!) in the return value of r5000_get_power_state.

comment:14 Changed 16 years ago by alannisota@…

can you please re-record pressing the power button in windows with sniffusb and ensure you keep track of the state before/after each press. Wait a second or so between presses as well. Your previous sniffusb logs clearly show that '0a 4d' is 'on' and '0a 4c' is 'off' and that's what the code currently does (I'm assuming you are using the latest patch in this ticket).

So either I initialized something incorrectly or something else is wrong here. Send me sniffusb results (and the state) via-email please.

comment:15 Changed 16 years ago by danielk

Alan, there are no copyright headers on the new files, are these all your code? If so can you apply the standard "GPL v2 or later" copyright header with your name...

I haven't actually looked at the code yet, I don't want to spend the time if these aren't something we can add due to licensing reasons anyway.

comment:16 Changed 16 years ago by alannisota@…

Yeah it is all mine, and I'll add the copyright headers. I have been working off-list to fix some users issues. I have a new patch which is significantly different that I'll upload once I figure out a weird race condition. No point in looking at the code unytil then.

Changed 16 years ago by anonymous

Attachment: r5000_r11.patch added

Rev 11 of the MythTV patch

Changed 16 years ago by anonymous

Attachment: r5ktest.3.c added

test app for use with Rev 11 of Myth patch

comment:17 Changed 16 years ago by alannisota@…

Rev 11 of the patch fixes many issues which were found while working with users off-list. It should be ready for inclusion (or at least review) Major changes:

  • much better support for HDD/DSR devices
  • fix power-state detection for DirecTV boxes
  • work properly when multiple r5k boxes are present
  • logging through mythtv

comment:18 Changed 16 years ago by mythtv-keith@…

I have been running in "production" mode with release-0-21-fixes and Alan's R5000 patch. The stability is on par with the ivtv cards it replaced. The files are smaller and the picture quality is improved. It brings myth support to an interesting set of interfaces. This a very nice piece of work and it would be great if it could be included in mainline mythtv.

comment:19 in reply to:  2 Changed 16 years ago by anonymous

Alan, has the issue with the 6000 series boxes mentioned below been addressed?

Replying to alannisota@gmail.com:

Rev 2 adds support for identifying R5000 by serial number (when setting up the device, you'll get a list of connected R5000 devices to choose from). This allows multiple R5000s to be used in a single machine. Also cleans up some unused code.

Also a note about compatibility. The manufacturer informed me that the 6000 series boxes won't work with the current code, so it is limited to the ViP series Dish Network boxes until I get some test streams to implement the needed changes.

comment:20 Changed 16 years ago by David George <david@…>

It looks like the EHCI patch is no longer required as of kernel 2.6.26.

Here is the relevant comment/code in drivers/usb/host/ehci-q.c:

                        /* The USB spec says that high speed bulk endpoints
                         * always use 512 byte maxpacket.  But some device
                         * vendors decided to ignore that, and MSFT is happy
                         * to help them do so.  So now people expect to use
                         * such nonconformant devices with Linux too; sigh.
                         */
                        info1 |= max_packet(maxp) << 16;

comment:21 Changed 16 years ago by anonymous

Alan, has the issue with the 6000 series boxes mentioned below been addressed?

There's no sense in spending time on the 6000 or 5000 series boxen, as they're sending out new cards now and these old receivers are not included. Will soon be disabled.

I think it's important to fix the code so it'll compile under Ubuntu 8.10. Simply will not compile there.

comment:22 Changed 16 years ago by alannisota@…

I've offered to work on supporting the 6000 series boxes if someone has one with an R5k mod and can provide test streams and help with debug. It shouldn't be too hard, though because the 6000 delivers PES rather than TS, synchronization will take longer. Apparently BEV is going to the 9242 which should already work, or the 6141 which is not yet supported by R5k, but when it is, will likely work with the existing code (my understanding is that the 6141== vip211k, which is nearly identical inside to the vip211)

If you are having issues compiling the code, it would be helpful to supply the errors. It compiles just fine on Ubuntu 8.04.

The only changes I've made vs patch r11 are the following to prevent a segfault:

Index: libs/libmythtv/r5000/libusb_augment.c
===================================================================
--- libs/libmythtv/r5000/libusb_augment.c.orig	2008-10-17 06:19:51.000000000 -0700
+++ libs/libmythtv/r5000/libusb_augment.c	2008-10-17 06:19:34.000000000 -0700
@@ -264,7 +264,7 @@
 int usb_urb_reap(usb_dev_handle *dev,     // Open usb device handle.
                  struct usbdevfs_urb *iso_urb,        // Pointer to URB.
                  int timeout) {           // Attempt timeout (usec).
-  void *context;
+  void *context = NULL;
   int ret;
   struct pollfd ufd[1];
 
@@ -297,7 +297,7 @@
   //fprintf(stderr, "error count: %d\n", iso_urb->error_count);
 
   //fprintf(stderr, "waiting done\n");
-  if(iso_urb != context) {
+  if(context != NULL && iso_urb != context) {
     fprintf(stderr, "Expected urb: %p but got %p\n", iso_urb, context);
     return -1;
   }
Index: libs/libmythtv/r5000/r5k_misc.c
===================================================================
--- libs/libmythtv/r5000/r5k_misc.c.orig	2008-10-17 06:19:51.000000000 -0700
+++ libs/libmythtv/r5000/r5k_misc.c	2008-10-17 06:19:34.000000000 -0700
@@ -134,7 +134,7 @@
   }
   ts[7] = (ptr - ts) - 8/*header*/ + 4/*CRC*/;
   r5000_calc_crc(ptr, ts + 5, (ptr - ts) - 5);
-  memset(ptr+4, 0xff, 188 - (ptr - ts - 4));
+  memset(ptr+4, 0xff, 188 - (ptr + 4 - ts));
   memcpy(r5kdev->pmt_pkt, ts, 188);
   //PRINTHEX("PMT", r5kdev->pmt_pkt, 188);
 }

I am currently working on trying to get more reliability with the vip211 (commercial detection/ff don't work very well still)

comment:23 Changed 16 years ago by anonymous

Please be advised that the ViP211k can never be supported by the R5000. I've solidly confirmed this with NextComm?. The TS is never exposed in the k.

A large change in Ubuntu 8.10 is that they've gone to QT4. The compile crash can't find qdeepcopy:

[code]ccache distcc gcc -c -pipe -march=k8 -fomit-frame-pointer -O3 -pthread -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -funit-at-a-time -D_REENTRANT -DPIC -fPIC -DQT_SHARED -DMMX -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DUSING_OSS -DUSING_H264TOOLS -DUSING_DIRECTFB -DUSING_X11 -DUSING_XV -DUSING_XVMC -DUSING_XVMCW -DUSING_XVMC_VLD -DUSING_OPENGL -DUSING_FRONTEND -DUSING_FFMPEG_THREADS -DUSING_V4L -DUSING_LINUX_FIREWIRE -DUSING_FIREWIRE -DUSING_LIBAVC_5_3 -DUSING_DBOX2 -DUSING_IPTV -DUSING_HDHOMERUN -DUSING_IVTV -DUSING_HDPVR -DUSING_DVB -DUSING_R5000 -DUSING_BACKEND -DQT_NO_DEBUG -DQT_QT3SUPPORT_LIB -DQT3_SUPPORT -DQT_SQL_LIB -DQT_XML_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtSql -I/usr/include/qt4/QtSql -I/usr/include/qt4/Qt3Support -I/usr/include/qt4/Qt3Support -I/usr/include/qt4 -I/usr/local/include -I/usr/include -I../.. -I.. -I. -I../libmyth -I../libavcodec -I../libavutil -I../libmythmpeg2 -Idvbdev -Impeg -Iiptv -I../libmythlivemedia/BasicUsageEnvironment/include -I../libmythlivemedia/groupsock/include -I../libmythlivemedia/liveMedia/include -I../libmythlivemedia/UsageEnvironment/include -I../libmythdb -I../libmythui -I/usr/X11R6/include -I. -I. -o r5k_misc.o r5000/r5k_misc.c /usr/bin/moc-qt4 -DQT_SHARED -DMMX -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DUSING_OSS -DUSING_H264TOOLS -DUSING_DIRECTFB -DUSING_X11 -DUSING_XV -DUSING_XVMC -DUSING_XVMCW -DUSING_XVMC_VLD -DUSING_OPENGL -DUSING_FRONTEND -DUSING_FFMPEG_THREADS -DUSING_V4L -DUSING_LINUX_FIREWIRE -DUSING_FIREWIRE -DUSING_LIBAVC_5_3 -DUSING_DBOX2 -DUSING_IPTV -DUSING_HDHOMERUN -DUSING_IVTV -DUSING_HDPVR -DUSING_DVB -DUSING_R5000 -DUSING_BACKEND -DQT_NO_DEBUG -DQT_QT3SUPPORT_LIB -DQT3_SUPPORT -DQT_SQL_LIB -DQT_XML_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtSql -I/usr/include/qt4/QtSql -I/usr/include/qt4/Qt3Support -I/usr/include/qt4/Qt3Support -I/usr/include/qt4 -I/usr/local/include -I/usr/include -I../.. -I.. -I. -I../libmyth -I../libavcodec -I../libavutil -I../libmythmpeg2 -Idvbdev -Impeg -Iiptv -I../libmythlivemedia/BasicUsageEnvironment/include -I../libmythlivemedia/groupsock/include -I../libmythlivemedia/liveMedia/include -I../libmythlivemedia/UsageEnvironment/include -I../libmythdb -I../libmythui -I/usr/X11R6/include -I. -I. proglist.h -o moc_proglist.cpp /usr/bin/moc-qt4 -DQT_SHARED -DMMX -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DUSING_OSS -DUSING_H264TOOLS -DUSING_DIRECTFB -DUSING_X11 -DUSING_XV -DUSING_XVMC -DUSING_XVMCW -DUSING_XVMC_VLD -DUSING_OPENGL -DUSING_FRONTEND -DUSING_FFMPEG_THREADS -DUSING_V4L -DUSING_LINUX_FIREWIRE -DUSING_FIREWIRE -DUSING_LIBAVC_5_3 -DUSING_DBOX2 -DUSING_IPTV -DUSING_HDHOMERUN -DUSING_IVTV -DUSING_HDPVR -DUSING_DVB -DUSING_R5000 -DUSING_BACKEND -DQT_NO_DEBUG -DQT_QT3SUPPORT_LIB -DQT3_SUPPORT -DQT_SQL_LIB -DQT_XML_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtSql -I/usr/include/qt4/QtSql -I/usr/include/qt4/Qt3Support -I/usr/include/qt4/Qt3Support -I/usr/include/qt4 -I/usr/local/include -I/usr/include -I../.. -I.. -I. -I../libmyth -I../libavcodec -I../libavutil -I../libmythmpeg2 -Idvbdev -Impeg -Iiptv -I../libmythlivemedia/BasicUsageEnvironment/include -I../libmythlivemedia/groupsock/include -I../libmythlivemedia/liveMedia/include -I../libmythlivemedia/UsageEnvironment/include -I../libmythdb -I../libmythui -I/usr/X11R6/include -I. -I. previouslist.h -o moc_previouslist.cpp /usr/include/qt4/QtCore/qstring.h: In member function ‘bool R5000Device::OpenPort?()’: /usr/include/qt4/QtCore/qstring.h:541: error: ‘QString::operator QNoImplicitBoolCast() const’ is private r5000device.cpp:285: error: within this context /usr/bin/moc-qt4 -DQT_SHARED -DMMX -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DUSING_OSS -DUSING_H264TOOLS -DUSING_DIRECTFB -DUSING_X11 -DUSING_XV -DUSING_XVMC -DUSING_XVMCW -DUSING_XVMC_VLD -DUSING_OPENGL -DUSING_FRONTEND -DUSING_FFMPEG_THREADS -DUSING_V4L -DUSING_LINUX_FIREWIRE -DUSING_FIREWIRE -DUSING_LIBAVC_5_3 -DUSING_DBOX2 -DUSING_IPTV -DUSING_HDHOMERUN -DUSING_IVTV -DUSING_HDPVR -DUSING_DVB -DUSING_R5000 -DUSING_BACKEND -DQT_NO_DEBUG -DQT_QT3SUPPORT_LIB -DQT3_SUPPORT -DQT_SQL_LIB -DQT_XML_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtSql -I/usr/include/qt4/QtSql -I/usr/include/qt4/Qt3Support -I/usr/include/qt4/Qt3Support -I/usr/include/qt4 -I/usr/local/include -I/usr/include -I../.. -I.. -I. -I../libmyth -I../libavcodec -I../libavutil -I../libmythmpeg2 -Idvbdev -Impeg -Iiptv -I../libmythlivemedia/BasicUsageEnvironment/include -I../libmythlivemedia/groupsock/include -I../libmythlivemedia/liveMedia/include -I../libmythlivemedia/UsageEnvironment/include -I../libmythdb -I../libmythui -I/usr/X11R6/include -I. -I. customedit.h -o moc_customedit.cpp distcc[4486] ERROR: compile r5000device.cpp on localhost failed make[2]: * [r5000device.o] Error 1 make[2]: * Waiting for unfinished jobs.... distcc[4483] ERROR: compile /root/.ccache/r5000signa.tmp.Hydra.4469.ii on localhost failed r5000signalmonitor.cpp: In constructor ‘R5000SignalMonitor::R5000SignalMonitor(int, R5000Channel*, uint64_t, const char*)’: r5000signalmonitor.cpp:50: error: no matching function for call to ‘DTVSignalMonitor::DTVSignalMonitor(int&, R5000Channel*&, uint64_t&, const char*&)’ dtvsignalmonitor.h:24: note: candidates are: DTVSignalMonitor::DTVSignalMonitor(int, DTVChannel*, uint64_t) dtvsignalmonitor.h:20: note: DTVSignalMonitor::DTVSignalMonitor(const DTVSignalMonitor&) r5000signalmonitor.cpp:56: error: ‘kDTVSigMon_WaitForSig’ was not declared in this scope r5000signalmonitor.cpp: In member function ‘void R5000SignalMonitor::deleteLater()’: r5000signalmonitor.cpp:73: error: ‘disconnect’ was not declared in this scope r5000signalmonitor.cpp:75: error: ‘deleteLater’ is not a member of ‘DTVSignalMonitor’ r5000signalmonitor.cpp: In member function ‘virtual void R5000SignalMonitor::UpdateValues?()’: r5000signalmonitor.cpp:202: error: ‘AllGood?’ was not declared in this scope r5000signalmonitor.cpp:270: error: ‘AllGood?’ was not declared in this scope r5000signalmonitor.cpp: In member function ‘void R5000SignalMonitor::EmitR5000Signals()’: r5000signalmonitor.cpp:307: error: ‘StatusSignalLock?’ was not declared in this scope r5000signalmonitor.cpp:308: error: ‘kDTVSigMon_WaitForSig’ was not declared in this scope r5000signalmonitor.cpp:309: error: ‘StatusSignalStrength?’ was not declared in this scope make[2]: * [r5000signalmonitor.o] Error 1 make[2]: Leaving directory `/home/bill/dl/test/mythtv.svn/mythtv/libs/libmythtv' make[1]: * [sub-libmythtv-make_default-ordered] Error 2 make[1]: Leaving directory `/home/bill/dl/test/mythtv.svn/mythtv/libs' make: * [sub-libs-make_default-ordered] Error 2 #code

With the latest Myth SVN there are a number of changes making it necessary to apply several parts of the patch by hand, although I don't know how to document those for you. Can anyone confirm that the EHCI patch is no longer required as of kernel 2.6.26? I could try, but I am waiting for a new mobo right now.

comment:24 in reply to:  23 ; Changed 16 years ago by David George <david@…>

Replying to anonymous:

A large change in Ubuntu 8.10 is that they've gone to QT4. The compile crash can't find qdeepcopy:

I have a patch that brings Alan's r11 patch up to trunk 18726. There were several changes that needed to be made for QT4 and other internal changes. I haven't had a chance to test it with my r5k, but it does compile. I will attach it soon in case it is useful for anyone and they get a chance to test it before I do. I have also added the couple of small patches Alan posted earlier today. This is meant to apply to an unpatched mythtv checkout.

Changed 16 years ago by David George <david@…>

comment:25 Changed 16 years ago by alannisota@…

ahh, I am still using 0.21. I'll take a look at David's patch, and release as appropriate a patch for trunk.

2.6.26 does work fine for me without the ehci patch, and the kernel change was prompted by the work I originally did, so it was specifically designed to resolve this issue.

comment:26 in reply to:  24 Changed 16 years ago by anonymous

Replying to David George <david@thegeorges.us>:

I have a patch that brings Alan's r11 patch up to trunk 18726.

With today's SVN (I don't know how to attach files nor do code blocks):

ccache distcc g++ -c -pipe -fpermissive -march=k8 -fomit-frame-pointer -O3 -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -Wno-non-virtual-dtor -funit-at-a-time -DSTDC_CONSTANT_MACROS -I/usr/include/kde/artsc -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/directfb -D_REENTRANT -I/usr/include/freetype2 -D_REENTRANT -DPIC -fPIC -DQT_SHARED -DMMX -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DUSING_OSS -DUSING_H264TOOLS -DUSING_DIRECTFB -DUSING_X11 -DUSING_XV -DUSING_XVMC -DUSING_XVMCW -DUSING_XVMC_VLD -DUSING_OPENGL -DUSING_FRONTEND -DUSING_FFMPEG_THREADS -DUSING_V4L -DUSING_LINUX_FIREWIRE -DUSING_FIREWIRE -DUSING_LIBAVC_5_3 -DUSING_IPTV -DUSING_HDHOMERUN -DUSING_IVTV -DUSING_HDPVR -DUSING_DVB -DUSING_R5000 -DUSING_BACKEND -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtSql -I/usr/include/qt4/QtSql -I/usr/include/qt4 -I/usr/local/include -I/usr/include -I../.. -I.. -I. -I../libmyth -I../libavcodec -I../libavutil -I../libmythmpeg2 -Idvbdev -Impeg -Iiptv -I../libmythlivemedia/BasicUsageEnvironment/include -I../libmythlivemedia/groupsock/include -I../libmythlivemedia/liveMedia/include -I../libmythlivemedia/UsageEnvironment/include -I../libmythdb -I../libmythui -I/usr/X11R6/include -I. -I. -o dtvsignalmonitor.o dtvsignalmonitor.cpp signalmonitor.cpp: In static member function ‘static SignalMonitor?* SignalMonitor::Init(QString, int, ChannelBase?*)’: signalmonitor.cpp:138: error: ‘class QString’ has no member named ‘upper’ make[2]: * [signalmonitor.o] Error 1 make[2]: * Waiting for unfinished jobs.... make[2]: Leaving directory `/home/bill/dl/test/mythtv-0.21.r5000.svn/mythtv/mythtv/libs/libmythtv' make[1]: * [sub-libmythtv-make_default-ordered] Error 2 make[1]: Leaving directory `/home/bill/dl/test/mythtv-0.21.r5000.svn/mythtv/mythtv/libs' make: * [sub-libs-make_default-ordered] Error 2 #

comment:27 Changed 16 years ago by David George <david@…>

Updated r11 patch for trunk 18851. Fixes compile issues with upper, R5000Device m_lock parameter. Removes Q3DeepCopy requirement (based on danielk's changes to firewirechannel.cpp in svn18752). Some updates for MythTV Coding Standards ( http://mythtv.org/wiki/index.php/Coding_Standards ).

Also, anonymous, you can identify yourself by clicking on Preferences in upper right of page. And to do code blocks hover over the icons above the text entry window to see what each does.

Changed 16 years ago by David George <david@…>

comment:28 Changed 15 years ago by Bill Southwell <chimera_god@…>

OK, the patch applies cleanly to Revision 18951 (I don't know how to specify a lower revision), and compiles cleanly in Kubuntu 8.04 on my HP 8710w notebook.

Tomorrow will try it on my new HTPC mobo and 8.10.

Nice work David!

comment:29 Changed 15 years ago by Bill Southwell <chimera_god@…>

My god, it appears to have compiled on my HTPC! This is a first.

All the latest stuff: Asus P5N7A-VM mobo (just released) with E8400 & 4GB RAM, Seagate 1 TB, Kubuntu 8.10 final.

I'm afraid it's almost time to actually try it! Scary, after years of wanting this very system.

But I don't know how to compile r5ktest.c . I'll experiment with gcc.

{{{# ./configure --enable-proc-opt # Basic Settings Compile type release Compiler cache yes DistCC no qmake /usr/bin/qmake-qt4 install prefix /usr/local runtime prefix /usr/local CPU x86_64 (model name : Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz) big-endian no yasm no MMX enabled yes CMOV enabled yes CMOV is fast yes

# Input Support Joystick menu yes lirc support yes Video4Linux sup. yes ivtv support yes HD-PVR support yes FireWire? support yes DVB support yes usr/include HDHomeRun support yes IPTV support yes R5000 support yes

# Sound Output Support OSS support yes ALSA support yes aRts support yes JACK support yes libfftw3 support no

# Video Output Support x11 support yes xrandr support yes xv support yes XvMC support yes XvMC VLD support yes XvMC pro support no XvMC OpenGL sup. no XvMC libs -lXvMCW OpenGL video no OpenGL vsync no DirectFB yes Fribidi formatting no MHEG support yes

# Misc Features multi threaded libavcodec yes Frontend yes Backend yes

# Bindings bindings_perl yes bindings_python yes

Creating libs/libmythdb/mythconfig.h and libs/libmythdb/mythconfig.mak

WARNING: When using --enable-proc-opt you must include the

output of ./configure along with any bug report.

#

# make -j 4 ... }}}

comment:30 Changed 15 years ago by Bill Southwell <chimera_god@…>

(Bugger, Code Block didn't work)

comment:31 Changed 15 years ago by Bill Southwell <chimera_god@…>

?

/home/bill/dl/mythtv/libs/libmythtv# gcc r5ktest.3.c
r5ktest.3.c: In function 'main':
r5ktest.3.c:160: warning: format '%d' expects type 'int', but argument 3 has type 'char *'
r5ktest.3.c:253: warning: too few arguments for format
/tmp/ccGuEvt4.o: In function `main':
r5ktest.3.c:(.text+0x69d): undefined reference to `r5000_init'
r5ktest.3.c:(.text+0x6bc): undefined reference to `r5000_find_stbs'
r5ktest.3.c:(.text+0x734): undefined reference to `r5000_open'
r5ktest.3.c:(.text+0x7a8): undefined reference to `r5000_toggle_on_off'
r5ktest.3.c:(.text+0x837): undefined reference to `r5000_change_channel'
r5ktest.3.c:(.text+0x85a): undefined reference to `r5000_get_power_state'
r5ktest.3.c:(.text+0x881): undefined reference to `r5000_close'
r5ktest.3.c:(.text+0x8b8): undefined reference to `r5000_open'
r5ktest.3.c:(.text+0x8d5): undefined reference to `r5000_get_power_state'
r5ktest.3.c:(.text+0x935): undefined reference to `r5000_change_channel'
r5ktest.3.c:(.text+0x94b): undefined reference to `r5000_start_stream'
r5ktest.3.c:(.text+0x976): undefined reference to `r5000_loop_iterate'
r5ktest.3.c:(.text+0x9aa): undefined reference to `r5000_stop_stream'
r5ktest.3.c:(.text+0xa0b): undefined reference to `r5000_start_stream'
r5ktest.3.c:(.text+0xa36): undefined reference to `r5000_loop_iterate'
r5ktest.3.c:(.text+0xa60): undefined reference to `r5000_stop_stream'
r5ktest.3.c:(.text+0xa88): undefined reference to `r5000_start_stream'
r5ktest.3.c:(.text+0xab3): undefined reference to `r5000_loop_iterate'
r5ktest.3.c:(.text+0xadd): undefined reference to `r5000_stop_stream'
r5ktest.3.c:(.text+0xae9): undefined reference to `r5000_close'
r5ktest.3.c:(.text+0xb20): undefined reference to `r5000_open'
r5ktest.3.c:(.text+0xb57): undefined reference to `r5000_start_stream'
r5ktest.3.c:(.text+0xb82): undefined reference to `r5000_loop_iterate'
r5ktest.3.c:(.text+0xbac): undefined reference to `r5000_stop_stream'
r5ktest.3.c:(.text+0xbb8): undefined reference to `r5000_close'
collect2: ld returned 1 exit status

comment:32 Changed 15 years ago by Bill Southwell

Loading the firmware causes the R5000 to disappear.

Plug in, and dmsg: [ 2448.588013] usb 3-3: new high speed USB device using ehci_hcd and address 10 [ 2448.721097] usb 3-3: configuration #1 chosen from 1 choice

# lsusb Bus 003 Device 010: ID 04b4:8613 Cypress Semiconductor Corp. CY7C68013 EZ-USB FX2 USB 2.0 Development Kit

# /sbin/fxload -t fx2 -D /dev/bus/usb/003/010 -I /usr/local/share/mythtv/r5000.hex

Poof, it's gone.

PS - there is no more usb /proc device with Kubongo 8.10

comment:33 Changed 15 years ago by alannisota@…

yes, apparently /proc/bus/usb is no longer populated. I recommend using lsusb instead. After loading the firmware, the device will renumerate as follows: before loading firmware: Bus 004 Device 004: ID 04b4:8613 Cypress Semiconductor Corp. CY7C68013 EZ-USB FX2 USB 2.0 Development Kit

After loading firmware: Bus 004 Device 006: ID 0547:1002 Anchor Chips, Inc.

note that the Device number changed. This is normal. you should be able to use r5ktest to scan for this device now.

r5ktest -m 6 -t 0 Should return: Scanning for R5000 devices Found: xxxxxxx

comment:34 Changed 15 years ago by alannisota@…

Well, that formatting didn't work. Let me try again:

yes, apparently /proc/bus/usb is no longer populated. I recommend using lsusb instead. After loading the firmware, the device will renumerate as follows:

before loading firmware:

Bus 004 Device 004: ID 04b4:8613 Cypress Semiconductor Corp. CY7C68013 EZ-USB FX2 USB 2.0 Development Kit

After loading firmware:

Bus 004 Device 006: ID 0547:1002 Anchor Chips, Inc.

note that the Device number changed. This is normal. you should be able to use r5ktest to scan for this device now.

r5ktest -m 6 -t 0 Should return:

Scanning for R5000 devices

Found: xxxxxxx

comment:35 Changed 15 years ago by Bill Southwell <chimera_god@…>

Thanks Alan, but I am unable to get r5ktest compiled. (above)

Worse, I am completely unable to get HDMI working on my new mobo (Asus P5N7A-VM), so it looks like I'm out of the game: http://www.avsforum.com/avs-vb/showthread.php?t=1081038 (quantumstate)

Apparently I have to resort to Winduhs.

comment:36 Changed 15 years ago by Bill Southwell <chimera_god@…>

OK, got that problem solved, but now have an R5000 specific one. Starting the backend:

2008-11-05 15:13:56.219 MythBackend: Starting up as the master server.
2008-11-05 15:13:56.224 New DB connection, total: 2
2008-11-05 15:13:56.225 Connected to database 'mythconverg' at host: localhost
2008-11-05 15:13:56.429 R5kLib: R5000 initialization failed at stage 1:
	Expected 1 bytes, but got -1 bytes

2008-11-05 15:13:56.431 R5kLib: R5000 failed to locate any R5000 devices.  Are you sure you have permissions set properly?

Right, so I set permissions of /dev/bus/usb/003/005 to 666. But next time I boot it's at /dev/bus/usb/001/003, or somewhere else. Is there anything that can be done?

So now permissions are right and I stop/start the backend:

2008-11-05 15:26:36.640 R5kLib: Could not locate R5000 device with serial ''

2008-11-05 15:26:36.642 R5kDev: Failed to open R5000 device
2008-11-05 15:26:36.650 MythBackend, Error: No valid capture cards are defined in the database.
			Perhaps you should re-read the installation instructions?

LOL, pffffffffffff

In Setup|Capture Cards Serial Number is a pulldown, and it's blank. It won't let me fill in its serial number, and apparently it's not autofetching it. I can't find where in ~/.mythtv where I could enter it manually. So I'm stuck I guess.

Kubuntu 8.10final, R5000 in a ViP211.

comment:37 in reply to:  27 Changed 15 years ago by Bill Southwell <chimera_god@…>

Trying to automatically set permissions on a USB plugin of the R5000, but it doesn't work.

Edited /etc/udev.rules.d/40-permissions.rules and added the lines: KERNEL=="Cypress*", GROUP="mythtv" KERNEL=="Anchor*", GROUP="mythtv"

... but it does not work on plug event, for some reason. If it worked, it could even be set to automatically load the R5000 firmware when plugged. (if it senses Cypress*)

What does work is editing /etc/udev.rules.d/40-basic-permissions.rules and changing SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664" SUBSYSTEM=="usb_device", MODE="0664" ... to SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664", GROUP="mythtv" SUBSYSTEM=="usb_device", MODE="0664", GROUP="mythtv"

But this means that any USB device plugged in will have a group of mythtv. May be too indiscriminate.

Still stuck on no R5000 serial number. Tried editing the database with mysql-admin, but in the capture-card table there is no 'serial number'. I guess it's mapped from another name, but I couldn't guess what.

comment:38 Changed 15 years ago by alannisota@…

FYI, I haven't had any luck getting a reliable rule for setting usb permissions properly either. I end up just manually loading the r5000 code and setting permissions after each boot (luckily these are few and far between)

When you run myth-setup, does it detect your card and serial number? If not, then there is likely still a permissions issue. The console output when selecting the R5000 in myth-setup may be helpful here.

Changed 15 years ago by anonymous

Attachment: r5000_r14.patch added

Version 14 for Stable branch

comment:39 Changed 15 years ago by alannisota@…

version 14 adds support for using the remote with the BEV9242 (which should be fully functional now), adds discrete power on/off codes for the Dish/BEV boxes to make power cycling more reliable, supports channels starting with '0', fixes an issue with H264 streams, fixes a bug where R5000 detection didn't work in mythtv-setup, and includes all needed collateral (ehci patch, r5ktest, firmware) in contrib/r5000.

See contrib/r5000/README for uptodate usage instructions. I'll look into putting out an equivalent patch against 'HEAD'

Changed 15 years ago by anonymous

Attachment: r5000_r14_trunk19162.patch added

Version 14 for TRUNK

Changed 15 years ago by anonymous

Attachment: r5000_r15_trunk19162.patch added

Version 15 for TRUNK

Changed 15 years ago by anonymous

Attachment: r5000_r15.patch added

Version 15 for STABLE

comment:40 Changed 15 years ago by alannisota@…

Version 15 fixes corrupt-video issues on ViP style boxes as well as fixing a case where myth would stop recording the stream.

comment:41 Changed 15 years ago by alannisota@…

oops. don't apply r15, I posted the wrong one, and r15 is really broken. I'll put up a new patch once I finish working on some power-on issues.

Changed 15 years ago by anonymous

Attachment: r5000_r16.patch added

Version 16 for STABLE

Changed 15 years ago by anonymous

Attachment: r5000_r16_trunk19162.patch added

Version 16 for TRUNK

comment:42 Changed 15 years ago by alannisota@…

Version 16 fixes the issues that were introduced in Version 15. I'm still having some issues with fast-forward and commercial skipping not working properly.

comment:43 Changed 15 years ago by chimera_god@…

I'd deinstalled my R5000, but maybe this is worth reinstalling for.

Actually tried Myth with an OTA card yesterday, and what a revelation! Automatic commercial skipping is wonderful.

Working to compile trunk now, since I can't go back to stable owing to database schema. Then will reinstall R5000 this week.

Changed 15 years ago by anonymous

Attachment: r5000_r17.patch added

Version 17 for STABLE

Changed 15 years ago by anonymous

Attachment: r5000_r17_trunk19210.patch added

Version 17 for TRUNK

Changed 15 years ago by anonymous

Attachment: h264_length.diff added

Prevent double-length recordings on STABLE

comment:44 Changed 15 years ago by alannisota@…

Version 17 should fix Fast-forward and Commercial skipping issues with H264. On STABLE, you'll also need h264_length.patch to prevent myth showing H264 recordings as double-length. That one's not mine; I got it from some DVB folks, though I don't remember whom.

I don't have any more planned features, don't have any known outstanding bugs, and have tried to clean up the patch to meet myth coding standards, so I'd like to propose Version 17 for inclusion in TRUNK.

comment:45 Changed 15 years ago by Bill Southwell

Crap, I just invested another two days trying to make this work, and it's still busted. Still can't enter the r5000 serial number, and the udev permission rule doesn't work. I keep getting up hope, but he's gone again.


# lsusb |grep Cypress Bus 004 Device 006: ID 04b4:8613 Cypress Semiconductor Corp. CY7C68013 EZ-USB FX2 USB 2.0 Development Kit

# fxload -t fx2 -D /dev/bus/usb/004/006 -I /home/bill/.mythtv/r5000.hex EOF without EOF record!

# lsusb |grep Anchor Bus 002 Device 006: ID 0547:1002 Anchor Chips, Inc. Python2 WDM Encoder

# chmod 666 /dev/bus/usb/002/006 # ls -al /dev/bus/usb/002/006 crw-rw-rw- 1 root root 189, 133 Dec 5 17:42 /dev/bus/usb/002/006

# r5ktest -t 0 -m 6 R5000 initialization failed at stage 1:

Expected 1 bytes, but got -3 bytes

R5000 failed to locate any R5000 devices. Are you sure you have permissions set properly? Scanning for R5000 devices R5000 was not initialized before r5000_find_stbs(). Please call r5000_init() first Failed to initialize r5000 devices


I give up. Sage works. Back to Windows.

comment:46 Changed 15 years ago by alannisota@…

I'm sorry it doesn't work for you but: lsusb |grep Anchor Bus 002 Device 006: ID 0547:1002 Anchor Chips, Inc. Python2 WDM Encoder this looks broken. To me it appears another module may have claimed the device. The R5000 does not use valid producid/vendorid strings, so there is no way to autodetect one properly when plugged into a linux system (in Windows this works because the R5000 vendor just assumes he can claim that interface, but in Linux that isn't an option)

I would need to see your dmesg logs after installing the firmware. It is much more helpful if people run into problems to contact me directly or at least respond to the ticket when they run into issues, rather than working in a vacuum, since it can be difficult to get the R5000 device initialized properly.

But to each his own, time is precious, and I can understand not wanting to fiddle with it. The R5000 is certainly not plug-and-play in Linux, and it isn't possible to make it too much better than it is now.

comment:47 Changed 15 years ago by alannisota@…

Here is a udev rule that seems to work well for me: create /etc/udev/rules.d/85-r5000.rules SUBSYSTEM=="usb", ACTION=="add", ENV{PRODUCT}=="4b4/8613/*", RUN+="/sbin/fxload -D %N -I /lib/firmware/r5000.hex -t fx2 -m 0666"

replace the path to r5000.hex as appropriate.

comment:48 Changed 15 years ago by alannisota@…

Of course I didn't paste the whole thing. That should be:

SUBSYSTEM=="usb", ACTION=="add", ENV{PRODUCT}=="4b4/8613/*", RUN+="/sbin/fxload -D %N -I /lib/firmware/r5000.hex -t fx2 -m 0666"
SUBSYSTEM=="usb", ENV{PRODUCT}=="547/1002/*", MODE="666"

comment:49 in reply to:  22 ; Changed 15 years ago by thfisher@…

Replying to alannisota@gmail.com:

I've offered to work on supporting the 6000 series boxes if someone has one with an R5k mod and can provide test streams and help with debug. It shouldn't be too hard, though because the 6000 delivers PES rather than TS, synchronization will take longer. Apparently BEV is going to the 9242 which should already work, or the 6141 which is not yet supported by R5k, but when it is, will likely work with the existing code (my understanding is that the 6141== vip211k, which is nearly identical inside to the vip211)

I have a BEV 6000 with an R5000 that I'd like to get working with MythTv?. I can help with the coding/debugging if you point me in the right direction. Let me know what you need.

comment:50 in reply to:  49 Changed 15 years ago by anonymous

Replying to thfisher@sympatico.ca:

I have a BEV 6000 with an R5000 that I'd like to get working with MythTv?. I can help with the coding/debugging if you point me in the right direction. Let me know what you need.

I'll be happy to help you with this. The simplest thing is to use the R5000 stream to capture in raw AV format, and send that to me.

The output should be PES which means we just need to convert to TS before delivering to MythTV. There is already code to do that in the DirecTV library (r5k_directv.c) but it'll take some work, since there is a lot more stuff in the directTv code that we don't need. Basically it'll be a hybrid between the vip code and the directv code.

I need beteeen 10 and 20MB of output to analyze and test, and with that I can probably get you something that mostly works very quickly.

Please contact me by email, as it is too difficult to do development using a ticket for communication.

comment:51 Changed 15 years ago by alannisota@…

that should have said:

The simplest thing is to use the R5000 software (in Windows) to capture in raw AV format, and send that to me. I should proof-read more.

Changed 15 years ago by anonymous

Attachment: r5000_r18.patch added

Version 18 for STABLE

Changed 15 years ago by anonymous

Attachment: r5000_r18_trunk19501.patch added

Version 18 for TRUNK

comment:52 Changed 15 years ago by alannisota@…

Verison 18 adds support for the Dish/BEV 6000 series boxes. I think mythtv now supports all boxes supported by the R5000.

It also adds an option to send a 'turn on' command before each channel change on ViP boxes. This is needed on the ViP211 because if that box goes into standby (to update the guide or from timeout) the R5000 module can't detect whether it is on or off.

This switch (in mythtv-setup) won't do anything for other STBs because it requires discrete-power remote codes which I only have for the ViP boxes.

Changed 15 years ago by anonymous

Attachment: r5000_r19.patch added

Version 19 for STABLE

Changed 15 years ago by anonymous

Attachment: r5000_r19_trunk19501.patch added

Version 19 for TRUNK

comment:53 Changed 15 years ago by alannisota@…

Version 19 fixes several issues with the 6000 series STB support, most notably remote commands and a bug fix for mp3 audio.

comment:54 Changed 15 years ago by Michael Norton <spam2009-mythtrac@…>

Two problems... first, I could not get the patch for STABLE to compile on Kubuntu 8.10. I was able to get around that issue by adding #include <algorithm> to r5000device.cpp.

Secondly, has anyone gotten a working recording from a DSR receiver? I can't get the r5ktest app to work with my DSR505. When I do r5ktest -t 3 -m 2, it gives me output such as

Reading stream
(0) Found 188 byte sync at 00000446: bytesize = 2
(0)Lost sync at 00000736
(27) Found 188 byte sync at 0006c842: bytesize = 2
(27)Lost sync at 0006cb32
(27) Found 188 byte sync at 0006cc17: bytesize = 1
(27)Lost sync at 0006ce4b
(27) Found 188 byte sync at 0006d07f: bytesize = 1
(27)Lost sync at 0006d2b3
(27) Found 188 byte sync at 0006d42b: bytesize = 1
(27)Lost sync at 0006d65f
(27) Found 188 byte sync at 0006d893: bytesize = 1
(27)Lost sync at 0006dac7

and over and over again for several lines, until eventually a segmentation fault. The resulting raw.ts is zero bytes.

comment:55 Changed 15 years ago by alannisota@…

Yes, we have gotten a DSR working properly with this code. I don't recall which model, but there are many variations of the output from a DSR and I wouldn't be surprised if there aren't some that aren't supported.

You'd need to build r5ktest with -DR5K_RAWUSB and then run it to generate a raw.av file, then send that to me (please contact me via e-mail, this ticket is already getting really long). I'll try to figure out what is wrong.

Alternatively, if you have Windows working with your R5000 you could capture a raw av file with the R5000 software, and send that to me instead.

comment:56 Changed 15 years ago by Bill Southwell <chimera_god@…>

Hello Michael,

Trunk with r19 compiles fine in Intrepid, although trunk versions in the 19600's have been unstable - avoid. I'm running 19564 with r19 and it's fine, although channel-changing is dicey. I set manual record of 5710 at 13:00 for 30min; 101 at 14:00 for 30 min; 5710 at 15:00 for 30 min; 101 at 16:00 for 30 min... and all four recordings are of 5710. It's in beautiful HD though!

comment:57 Changed 15 years ago by Bill Southwell <chimera_god@…>

Just a quick tip for all you guys with nVidia cards:

We now have hardware acceleration in Linux for mpeg2, H.264, deinterlacing, and many more things if you have a recent card with the 9300 or 9400 chipset. Even older cards benefit from VDPAU in the nVidia beta drivers on nvnews.

I am running driver 180.22 with Myth SVN 19564 and r19, and am playing 1080i high def from HD Theater on a Quadro 1600m (without HW H.264) and 2GHz CPU, running at ~33%. This ran at 66% with CPU+ and CPU++ profiles, and halted every three seconds, but no more. No CoreAVC decoder or anything else needed.

You have to compile Myth with --enable-vdpau and --enable-proc-opt then in Setup|Setup|TVSettings|Playback|{3rdScreen} and Add New. Name your new profile VDPAU and Add New Entry, Match Criteria '>', Decoder 'Nvidia VDPAU Acceleration', Max CPUs is the # of cores+1, Next. Primary Deinterlace is 'Bob (2x, HW)' (Advanced2x is blurry on pans) and Fallback is 'Advanced (1x, HW)', Finish. On the next page make sure 'Use HW Accel for Live Preview' is checked, and go back through Playback to make sure VDPAU is selected, then Bob's your uncle.

Enjoy VDPAU hardware acceleration!

Changed 15 years ago by alannisota@…

Attachment: r5000.512.hex added

New firmware

comment:58 Changed 15 years ago by alannisota@…

I've uploaded a new firmware r5000.512.hex firmware. This was provided to me by Sergio Ammirata. We found that some hardware is not compatible (at least in Linux) with 1024byte packets even with the relevant kernel patch. the r5000.512.hex firmware uses 512byte packets, and should be fully compliant with the USB 2.0 spec. It doesn't provide any additional features for Linux, so if the normal r5000.hex works, there's no reason to use this one, but if you can't get r5ktest to capture, you might try this alternate firmware. This firmware is NOT supported by nextcomwireless, but it has been tested to work well on multiple hardware setups in Linux.

comment:59 Changed 15 years ago by David George <david@…>

I am attaching a patch that brings Alan's r19_trunk19501 patch up to trunk 20440. This patch fixes a couple of rejects in cardutil.h and videosource.cpp. Tested and working with R5000 in a Directv Mitsu SR-HD5.

Changed 15 years ago by David George <david@…>

comment:60 Changed 15 years ago by Lingerie Ninja <ninja@…>

I'm trying to get a motorola dcp501 with r5000 working.

I can load the firmware (512 byte packets) and get the serial number (via "r5ktest -t 0 -m 6") But I can't seem to turn the power on or off via software. When I use the r5ktest program to do any power related change it says it is doing it, pauses and prints a second line reporting that the power state is the same as whatever it was previously.

For example: # ./r5ktest -t 0 -m 8 Turning STB Off Turned power On

On the plus side, Myth is also able to see the device and retrieve the serial and I can add the DCP501 as an r5000 device. But I have yet to get it provisioned by the cabletv company, so I can't say if it is able to record anything yet.

And FWIW, I get the same ID string out of lsusb that Bill Southwell was getting:

Bus 004 Device 003: ID 0547:1002 Anchor Chips, Inc. Python2 WDM Encoder

so I think that's normal.

Also, I am using the latest patch -- 4752_r5k_r19_trunk20440.patch on trunk20450, patch applied cleanly, only one file had an offset of a couple of lines. My other inputs are all HDHomeRun's and they appear to be working just fine with this build.

comment:61 Changed 15 years ago by alannisota@…

The reason your box doesn't change channels is that there are no channel-change codes in the r5000 code for it. I don't know anything about the DCP501, and don't have any test streams from it. You'll probably want to start trying either setting it to type 'dsr' or 'hdd', since the dish-network/expessVu types are very unlikely to work with it. It is also possible that this box won't work at all in Myth until you can provide me with some test streams (which means getting it activated 1st). It depends how how closely the box follows the mpeg2-ts format standards.

As for getting the remote to work, I have codes from NextcomWireless?, but I was never able to reliably turn them into USB commands. Instead you'll need a windows install (real, not with a virtual machine) and will need to capture the channel change commands from the r5000 software. I can then build the codes for your box.

So getting this box fully functional with myth will take some effort on your part. I can't say how much until you've activated the box and see whether it can capture with one of the existing types or not. Contact me off-list and I'll work with you to help collect what I need.

comment:62 Changed 15 years ago by danielk

Resolution: wontfix
Status: assignedclosed

After some digging I've determined that there is no way to use the R5000 mod without violating ToS & probably the DMCA anti-circumvention provisions as well, so I can not apply this patch in good conscience.

comment:63 Changed 15 years ago by anonymous

Oh FGS danielk, you haven't done any 'digging'. You are just frightened of what you don't understand. This is a -religious- issue for you and other devs.

Are you not aware that auto commercial skip (which is built-in to MythTV) is ostensibly illegal? Yes, ReplayTV was actually sued for this.

And are you not aware that whenever Big Media doesn't like something, they always, always send a cease and desist giving plenty of time for the 'offensive' function to be removed, before any legal action is even considered?

And are you not aware that a number of very large corporations are selling this very function? Hauppauge has sold millions of HD-PVRs.

And SageTV and MediaCenter? have had R5000 functionality BUILT IN FOREVER, without Big Media's permission. No different than MythTV R5000 functionality. These are big corporations who have the legal expertise to actually understand the issues.

Your fears are further proof to me that innovation in MythTV is dead. I look forward to XBMC.

comment:64 Changed 15 years ago by Bill Southwell

And BTW I am Bill Southwell.

comment:65 Changed 15 years ago by stuartm

Ticket locked: set
Note: See TracTickets for help on using tickets.