[mythtv-users] Firewire Problems, was working

Jim Westfall jwestfall at surrealistic.net
Wed Sep 20 22:23:04 EDT 2006


Allan Wilson <allanwilson at gmail.com> wrote [09.18.06]:
> 
> Sorry I am just now getting back to posting but I went out of town. I just
> sat down and played with it a little and it turns out that having the second
> cable box plugged in to the firewire card was enough to cause Myth not to
> show anything over firewire. Next I am going to try daisy chaining instead
> of directly plugging both in to the firewire card to see if that makes a
> difference. Right now I have the following problems with two SA3250HD cable
> boxes:
> 
> 1) Two SA3250HD cables boxes does not appear to work with MythTV although it
> works fine with test-mpeg2.

It works ok with broadcast connections.  Attaching a patch that should 
support multiple p2p connections, it should apply to 0.20-fixes.  I 
would appreciate it of you could test it.  The person that was testing it 
for me hasnt gotten back to me about it yet.

> 2) The channel change command only works on one box. You cannot specify
> nodes.

The internal changer supports this.

thx
jim

> 
> I am definately not complaining though I am happy to get one working and
> maybe I can figure out how to get both working. Just thought I would post in
> case anyone runs across the same problems as me. Thanks
> 
> Allan

> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

-------------- next part --------------
Index: libs/libmythtv/firewirerecorder.cpp
===================================================================
--- libs/libmythtv/firewirerecorder.cpp	(revision 10875)
+++ libs/libmythtv/firewirerecorder.cpp	(working copy)
@@ -25,6 +25,7 @@
 const int FirewireRecorder::kBroadcastChannel    = 63;
 const int FirewireRecorder::kConnectionP2P       = 0;
 const int FirewireRecorder::kConnectionBroadcast = 1;
+const int FirewireRecorder::kPlug                = 0;
 const uint FirewireRecorder::kMaxBufferedPackets = 2000;
 
 // callback function for libiec61883
@@ -78,18 +79,20 @@
 
      if (kConnectionP2P == fwconnection)
      {
+          fwchannel = fwnode;
+
           VERBOSE(VB_RECORD, LOC + "Creating P2P Connection " +
-                  QString("with Node: %1").arg(fwnode));
-          fwchannel = iec61883_cmp_connect(fwhandle,
-                                           fwnode | 0xffc0, &fwoplug,
-                                           raw1394_get_local_id(fwhandle),
-                                           &fwiplug, &fwbandwidth);
-          if (fwchannel > -1)
+                  QString("with Node: %1, Channel: %2").arg(fwnode)
+                  .arg(fwchannel));
+          if (iec61883_cmp_create_p2p_output(fwhandle,
+                                             fwnode | 0xffc0, kPlug,
+                                             fwchannel, 
+                                             fwspeed) != 0)
           {
-	      VERBOSE(VB_RECORD, LOC +
-                      QString("Created Channel: %1, "
-                              "Bandwidth Allocation: %2")
-                      .arg(fwchannel).arg(fwbandwidth));
+             VERBOSE(VB_IMPORTANT, LOC + "Failed to create connection");
+             // release raw1394 object;
+             raw1394_destroy_handle(fwhandle);
+             return false;
           }
      }
      else
@@ -100,7 +103,7 @@
                  QString("with Node: %1, Channel: %2").arg(fwnode)
                  .arg(fwchannel));
          if (iec61883_cmp_create_bcast_output(fwhandle,
-                                              fwnode | 0xffc0, 0,
+                                              fwnode | 0xffc0, kPlug,
                                               fwchannel,
                                               fwspeed) != 0)
          {
@@ -109,7 +112,6 @@
              raw1394_destroy_handle(fwhandle);
              return false;
          }
-         fwbandwidth = 0;
      }
 
      fwmpeg = iec61883_mpeg2_recv_init(fwhandle, fw_tspacket_handler, this);
@@ -151,9 +153,7 @@
                       "Unable to set firewire speed, continuing");
          }
      }
-
      fwfd = raw1394_get_fd(fwhandle);
-
      return isopen = true;
 }
 
@@ -167,15 +167,12 @@
     VERBOSE(VB_RECORD, LOC + "Releasing iec61883_mpeg2 object");
     iec61883_mpeg2_close(fwmpeg);
 
-    if (fwconnection == kConnectionP2P && fwchannel > -1)
-    {
-        VERBOSE(VB_RECORD, LOC +
-                QString("Disconnecting channel %1").arg(fwchannel));
+    VERBOSE(VB_RECORD, LOC +
+            QString("Disconnecting channel %1").arg(fwchannel));
 
-        iec61883_cmp_disconnect(fwhandle, fwnode | 0xffc0, fwoplug,
-                                raw1394_get_local_id (fwhandle),
-                                fwiplug, fwchannel, fwbandwidth);
-    }
+    iec61883_cmp_disconnect(fwhandle, fwnode | 0xffc0, kPlug,
+                            raw1394_get_local_id (fwhandle),
+                            -1, fwchannel, 0);
 
     VERBOSE(VB_RECORD, LOC + "Releasing raw1394 handle");
     raw1394_destroy_handle(fwhandle);
Index: libs/libmythtv/firewirerecorder.h
===================================================================
--- libs/libmythtv/firewirerecorder.h	(revision 10875)
+++ libs/libmythtv/firewirerecorder.h	(working copy)
@@ -24,10 +24,10 @@
   public:
     FirewireRecorder(TVRec *rec) 
         : FirewireRecorderBase(rec),
-        fwport(-1),     fwchannel(-1), fwspeed(-1),   fwbandwidth(-1), 
+        fwport(-1),     fwchannel(-1), fwspeed(-1),
         fwfd(-1),       fwconnection(kConnectionP2P), 
-        fwoplug(-1),    fwiplug(-1),   fwmodel(""),   fwnode(0), 
-        fwhandle(NULL), fwmpeg(NULL),  isopen(false) { } 
+        fwmodel(""),    fwnode(0),     fwhandle(NULL),
+        fwmpeg(NULL),   isopen(false) { } 
    ~FirewireRecorder() { Close(); }
 
     // Commands
@@ -47,11 +47,8 @@
     int              fwport;
     int              fwchannel;
     int              fwspeed;
-    int              fwbandwidth;
     int              fwfd;
     int              fwconnection;
-    int              fwoplug;
-    int              fwiplug;
     QString          fwmodel;
     nodeid_t         fwnode;
     raw1394handle_t  fwhandle;
@@ -61,6 +58,7 @@
     static const int kBroadcastChannel;
     static const int kConnectionP2P;
     static const int kConnectionBroadcast;
+    static const int kPlug;
     static const uint kMaxBufferedPackets;
 };
 


More information about the mythtv-users mailing list