Help sought for new nvtv (NVidia TV-Out) port (was: ? getopt_long(), iopl() and ioperm() ?)

Peter Cornelius pcc at gmx.net
Sun Nov 2 09:59:24 PST 2003


[follow-ups please to FreeBSD-Multimedia and Cc: to me, for the time being.
- Thanks!]   
   
Hi there,   
   
I have started to fiddle with a program called nvtv which supposedly makes
the tv-out 
on my graphics card work (an nVidia Corporation NV20 [GeForce3 Ti200]), and
possibly   
some other NVidia-based cards, too. However, as it turns out, odds are
against me and   
my (very) limited programming abilities; I have the bugger on my table for
several   
weeks now without making real progress. To a certain extent, this is also
due to the   
workload I currently have from the hand that feeds me.   
   
Therefore, I have decided to make a preliminary port and start to look for
someone who   
knows more & better than I do. Please find enclosed a tar ball (relative to
/usr/
ports) of the port skeleton I  made. To build, it needs a modified version
of the 
pciutils port as it requires the pci.h headers and the libpci.a library.
There is a 
diff against pciutils-2.1.11's Makefile below (I took the freedom to label
it 
PORTREVISION=1 ;-)). 
   
The preliminary port apparently installs and deinstalls ok, but it has a
good lot of  
pecularities and todos which I also list and discuss below.   
   
So, if you wish to help, it is very much so appreciated. Please be patient
with me,   
however, as I probably only have time at weekends for some time to come. 8-S

  
Keep me Cc'd if urgent ;-) I dig into the digest otherwise...  
  
Please also be advised that this program may still be very unstable, crash
your box,  
burn your video and cause data loss, make your wife go away, etc., so
understand that  
you play with it at your own risk.  
  
Finally, my special thanks go to the people on the Bcc list for providing
hints, help 
and/or other support on the way here. Thank you, folks! 
   
Thanks again and   
   
all the best,   
   
Peter.   
   
--- --- ---  
  
Here is the patch to pciutils-2.1.11's Makefile (sorry, cut&paste, you may
have to   
replace some spaces with tabs 8-S):   
$ diff Makefile Makefile.orig  
10d9  
< PORTREVISION=	1  
44,49c43  
<	# This makes nvtv compile under FreeBSD:  
<	@${INSTALL_DATA} ${WRKSRC}/lib/libpci.a ${PREFIX}/lib  
<	@${MKDIR} ${PREFIX}/include/pci  
<	@${INSTALL_DATA} ${WRKSRC}/lib/pci.h ${PREFIX}/include/pci  
<	@${INSTALL_DATA} ${WRKSRC}/lib/config.h ${PREFIX}/include/pci  
<	@${INSTALL_DATA} ${WRKSRC}/lib/header.h ${PREFIX}/include/pci  
---  
>  
$ diff pkg-plist pkg-plist.orig  
5,9d4  
< lib/libpci.a  
< @dirrm include/pci  
< include/pci/pci.h  
< include/pci/config.h  
< include/pci/header.h  
  
--- --- ---  
  
Here's a list of issues I have with my attached port skeleton. Most of these
are  
included as todos in my Makefile. I include some remarks further below.  
  
(i)	Currently, nvtv is 'untested'  
(ii)	Unknown/unsure whether to add nvidia-drivers dependency or not  
(iii)	Find bsd replacement for iopl() and ioperm()  
(iv)	Fix port to honour MANx  
(v)	Fix configure/configure.in to properly configure gtk in  
(vi)	Fix port to install properly named binaries/manpages (see pkg-plist)  
(vii)	Clear up handling of different gtk versions  
(viii)	Write pkg-descr.  
  
--- --- ---  
  
Here's the above list with a couple of cents of my thoughts about these.  
  
(i)	Currently, nvtv is 'untested'  
  
At this point, I have not been able to successfully use my tv-out, because
apparently  
my card's Philips SAA7108E is not detected properly. This may or may not be
a bug in  
nvtv, and I already have loose contact to the author of it about that
matter, so  
please let me know if you have or have not success with that chip (or any
other).  
  
(ii)	Unknown/unsure whether to add nvidia-drivers dependency or not  
  
I would not expect any effect, but as I currently can't properly test,
please do check  
the -N/--nvdev option if you have a chance (and the confidence ;-).  
  
(iii)	Find bsd replacement for iopl() and ioperm()  
  
There is an occurrence of either one in the code once. I don't know what
they do and  
even less whether there's an appropriate replacement for them on FreeBSD.
Since I  
simply commented these out in order to be able to build (see the patch file
in files/ 
patch-src___card_direct.c.aa), owners of Vodoo 3 and Intel cards currently
will have  
no joy with this nvtv port.  
  
(iv)	Fix port to honour MANx  
  
Should be minor, but must probably fix the binary naming issue first (see
below).  
Don't forget to amend pkg-plist accordingly, as this currently catches the
man pages.  
  
(v)	Fix configure/configure.in to properly configure gtk in  
  
To me, this smells like a problem inherited from the configure.in/.ac files.
That's a  
terrain in which I am *absolutely* lost, so please do help, thank you. In
any case, 
currently configure is broken and 'forgets' to add the gtk version to
${WRKSRC}/src/
config.h (if you manually fix it in there, the gui can be built and used,
though). 
  
(vi)	Fix port to install properly named binaries/manpages (see pkg-plist) 
 
I assume, though not investigated, that this also is a configure issue.
Currently, e. 
g. i386-portbld-freebsd4.9-nvtv is used... (sigh...) 
 
(vii)	Clear up handling of different gtk versions  
 
One could also stick just with gtk2 and a cli interface, or even only gtk2
once it 
works. Since it's an X thingy, a gui-only version is OK with me (not
thinking of the 
svgalib-mplayer fetishists ;-)) 
 
(viii)	Write pkg-descr.  
 
...it has just not been done yet. 
  
--- Original message follows ---   
   
> > > # pcc at gmx.net / 2003-10-19 01:59:45 +0200:    
> > > > I'm hacking at a piece of code that I want to turn into a port. It's

  
> >from    
> > > > Linux and uses libpci and some other 'strange' functions.     
> > > > While I think that I've managed to modify the libpci port to install

  
> the    
> > > > required lib, I'm more or less lost at getopt_long() which I     
> > > > assume is in the libgnugetopt port. However, for some reason, even  

> if   
> I    
> > > > include it explicitly (#include "/usr/local/include/getopt.h"), I   

 
> > > > run into problems. Please note that I'm not a programmer at all, so 

 
> it's    
> > > > very much hacking along, so I may look for someone patient     
> > > > to bear with me ;-) But I am willing to learn.     
> > >     
> > >     AFAICT you need to tell the compiler about the library. The rule  

> in    
> > >     your Makefile needs to have "-L /usr/local/lib -lgnugetopt".    
>     
> Thanks for that, Roman, I did so and got some sort of binary to play with.

  
> For a port, however, I think I must    
> dig in deeper, or rather climb higher for that matter -- autoconf & co.   
> are   
> used for making the makefiles, so I    
> probably must fix it there somewhere there. If it was for plain makefiles,

  
> I   
> might not have the problems I see,    
> but this is something entirely new for me ;-)    
>     
> > The best way is to set USE_GETOPT_LONG=yes in your port Makefile.    
> >     
> > # USE_GETOPT_LONG - Says that the port uses getopt_long. If OSVERSION   

> > #                   less than 500041, automatically adds   
> devel/libgnugeopt   
>    
> > #                   to LIB_DEPENDS, and pass adjusted values of     
> > #                   CPPFLAGS and LDFLAGS in CONFIGURE_ENV.    
> > #                   Default: not set.    
>     
> Thanks, Dan, I'm not that far yet. As I said above, I'm still trying to   
> understand what is required by nvtv in    
> the first place. There still seem to be bugs in there, at least with my   
> card. I have contact with the author who    
> is willing to help as long as I can build and test. Which I sort of   
> achieved   
> now with your help and the of a    
> friend. Anyways, as I must have overread that comment in bsd.ports.mk,   
> thanks for the pointer.    
>     
> In any case, if it makes to be a port, I'll proceed as suggested.    
>     
> So, thanks for the help and watch ports@ if it ever makes it there ;-)==) 

  
>     
> All the best,    
>     
> Peter.    
>     
> Btw, iopl() and ioperm() I currently simply get around by uncommenting   
> them.   
> Which probably makes those    
> sections unuseable for the cards covered there, so I would not mind a hint

  
> for these by any other reader ;-)    

-- 
NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService

Jetzt kostenlos anmelden unter http://www.gmx.net

+++ GMX - die erste Adresse für Mail, Message, More! +++


More information about the freebsd-multimedia mailing list