Hi,

After using an old and stable driver for about a year, it was time to try out a newer one, I've attached the few changes I had to make to the driver for my user level code to work, here's an explanation of what needed doing:

- FWAPI ioctl, this is used by both the vdr analogtv and pvr350 plugins (former to set the stream PIDs, latter to change the frame size to respect the stream aspect ratio/scrunch up to 1/4 display). The code needs to pick up the Firmware command not the ioctl command.

- STOP_DECODE ioctl. If no pts is specified then the firmware will stop decoding immediately. So the ioctl now checks for 0 and only supplies a single argument to the firmware. This used to be achieved in user code by using FWAPI, but the DEC_FLUSH ioctl doesn't seem to work correctly for me and leaves picture remnants which are picked up when the channel changes.

- Some fixes to make ivtvctl compile with gcc 3.3.4.

These changes make my system run in a similar manner to 0.1.0-pre2-ck34 which I was previously using, except channel changing is a lot slower - I suspect there's too much buffering happening somewhere in the dataflow somewhere - I'll play with the buffer sizes.

cheers,

d.
diff -ur ivtv-0.2.0-rc3f/driver/ivtv-ioctl.c 
ivtv-0.2.0-rc3f-new/driver/ivtv-ioctl.c
--- ivtv-0.2.0-rc3f/driver/ivtv-ioctl.c Thu Jan  6 17:46:33 2005
+++ ivtv-0.2.0-rc3f-new/driver/ivtv-ioctl.c     Sat Feb 12 22:01:28 2005
@@ -300,7 +300,7 @@
                IVTV_DEBUG(IVTV_DEBUG_INFO,"ivtv ioctl: FWAPI\n");
 
                 /* Encoder */
-                if(cmd>=128)
+                if(fwapi->cmd>=128)
                         return ivtv_api(itv, itv->enc_mbox, &itv->enc_msem,
                                fwapi->cmd, &fwapi->result, fwapi->args, 
                                fwapi->data);
diff -ur ivtv-0.2.0-rc3f/driver/ivtv-streams.c 
ivtv-0.2.0-rc3f-new/driver/ivtv-streams.c
--- ivtv-0.2.0-rc3f/driver/ivtv-streams.c       Mon Dec  6 00:32:36 2004
+++ ivtv-0.2.0-rc3f-new/driver/ivtv-streams.c   Sat Feb 12 22:16:22 2005
@@ -1235,11 +1235,17 @@
 
        /* Stop Decoder, must have failed, probably won't get here */
        if (test_and_clear_bit(IVTV_F_S_STREAMOFF, &st->s_flags)) {
-               x = ivtv_vapi(itv, IVTV_API_DEC_STOP_PLAYBACK, 3,
+               if ( itv->dec_options.pts_low && itv->dec_options.pts_hi ) {
+                   x = ivtv_vapi(itv, IVTV_API_DEC_STOP_PLAYBACK, 3,
                        /*  0 = last frame, 1 = black */
                        itv->dec_options.hide_last_frame,
                        itv->dec_options.pts_low, /* when: pts low */
                        itv->dec_options.pts_hi);  /* when: pts hi */
+               } else {
+                   x = ivtv_vapi(itv, IVTV_API_DEC_STOP_PLAYBACK, 1,
+                       /*  0 = last frame, 1 = black */
+                       itv->dec_options.hide_last_frame);
+               }
        
                if (x) IVTV_DEBUG(IVTV_DEBUG_ERR, 
                        "DEC: Error stopping decode (%d) on try number %d\n",
diff -ur ivtv-0.2.0-rc3f/driver/ivtv.h ivtv-0.2.0-rc3f-new/driver/ivtv.h
--- ivtv-0.2.0-rc3f/driver/ivtv.h       Fri Nov 19 05:00:27 2004
+++ ivtv-0.2.0-rc3f-new/driver/ivtv.h   Sat Feb 12 21:26:58 2005
@@ -54,7 +54,7 @@
 struct ivtv_sliced_data {
        unsigned long id;
        unsigned long line;
-       unsigned char data[];
+       unsigned char data[0];
 };
 
 /* The four bit VBI data type found in the embedded VBI data of an
diff -ur ivtv-0.2.0-rc3f/utils/ivtvctl.c ivtv-0.2.0-rc3f-new/utils/ivtvctl.c
--- ivtv-0.2.0-rc3f/utils/ivtvctl.c     Fri Nov 19 05:00:27 2004
+++ ivtv-0.2.0-rc3f-new/utils/ivtvctl.c Sat Feb 12 21:27:09 2005
@@ -1173,8 +1173,8 @@
        }
 
        if (options[OptGetDriverInfo]) {
-               printf("ioctl: IVTV_IOC_G_DRIVER_INFO\n");
                struct ivtv_driver_info di;
+               printf("ioctl: IVTV_IOC_G_DRIVER_INFO\n");
                di.size = sizeof(struct ivtv_driver_info);
                if (ioctl(fd, IVTV_IOC_G_DRIVER_INFO, &di) == 0) {
                        printf(" driver info:\n");

Reply via email to