WIP: multimedia/XdTV port

Ion-Mihai Tetcu itetcu at people.tecnik93.com
Tue Aug 9 11:01:26 GMT 2005


On Tue, 9 Aug 2005 11:08:24 +0200 (CEST)
Sir Pingus <pingus_77 at yahoo.fr> wrote:

> Hi,
> 
> 
> 
> > Known "running" problems:
> > - no sound source selection support (general problem, no support for
> > it at all) - for me this equals no sound. [1]
> 
> Ho.... so a patch seems to be needed

Yeh :) Will do it, I hope, when I return from holidays.
 
> > - no channel scanning (it's based on v4l and I'm not aware of any
> > working software that does this for FreeBSD - xawtv doesn't find any
> > channels for me - it scans for them but doesn't lock on) - copy your
> > channels from ~/.xawtv
> 
> Yes we know that. xdtv_scan which is based on the scan software from
> XawTV doesn't work on *BSD system. I don't know if there is something
> like such software that works on *BSD.

Me neither.
 
> > - trying to use Xosd or Mozaic Channels makes it stopping to accept
> > input and you'll have to Ctrl+C it which will generate a core
> > (either threading problem or something masked by libpthread - I
> > haven't have time to debug) [2]
> 
> Could be interessting to know why..

I didn't manage to crash it with xosd this time.

This is what gdb show for mozaic windows:

 > gdb xdtv xdtv.core
GNU gdb 6.1.1 [FreeBSD]
 ...
Core was generated by `xdtv'.
Program terminated with signal 11, Segmentation fault.
 ....
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  0x283230cb in pthread_testcancel () from /usr/lib/libpthread.so.1
(gdb) bt
#0  0x283230cb in pthread_testcancel () from /usr/lib/libpthread.so.1
#1  0x28310e7a in sigaction () from /usr/lib/libpthread.so.1
#2  0x2831b530 in pthread_mutexattr_init () from /usr/lib/libpthread.so.1
#3  0x00000000 in ?? ()
(gdb) info threads
* 6 LWP 100264  0x283230cb in pthread_testcancel () from /usr/lib/libpthread.so.1
  5 Thread 5 (runnable)  0x0808c781 in mmx2_memcpy_64K (dst=0x0, src=0x0, n=0) at memcpy.c:503
  4 Thread 4 (LWP 100244)  0x283230eb in pthread_testcancel () from /usr/lib/libpthread.so.1
  3 Thread 3 (runnable)  0x2832316b in pthread_testcancel () from /usr/lib/libpthread.so.1
  2 Thread 2 (runnable)  0x2874b2cf in select () from /lib/libc.so.5
  1 Thread 1 (runnable)  0x2831b5b5 in pthread_mutexattr_init () from /usr/lib/libpthread.so.1
(gdb) thread 5
[Switching to thread 5 (Thread 5 (runnable))]#0  0x0808c781 in mmx2_memcpy_64K (dst=0x0, src=0x0, n=0)
    at memcpy.c:503
503             __asm__ __volatile__(   "movl %1, %%esi\n"                                              // esi = src

Is this asm really needed ?


Running from valgrind doesn't get there:
 > valgrind --leak-resolution=high --leak-check=yes --tool=memcheck --show-reachable=yes --error-limit=no --show-below-main=yes xdtv
==74233== Memcheck, a memory error detector for x86-linux.
==74233== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward.
==74233== Using valgrind-2.1.0, a program supervision framework for x86-linux.
==74233== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward.
==74233== Estimated CPU clock rate is 1672 MHz
==74233== For more details, rerun with: -v
==74233==

This is xdtv 2.2.0 running on FreeBSD/i386 (5.4-STABLE).
==74233== Conditional jump or move depends on uninitialised value(s)
==74233==    at 0x3C182658: store_to_database (in /usr/X11R6/lib/libX11.so.6)
==74233==    by 0x3C182853: f_newline (in /usr/X11R6/lib/libX11.so.6)
==74233==    by 0x3C18356C: _XlcCreateLocaleDataBase (in /usr/X11R6/lib/libX11.so.6)
==74233==    by 0x3C18876B: initialize (in /usr/X11R6/lib/libX11.so.6)
==74233==
==74233== Conditional jump or move depends on uninitialised value(s)
==74233==    at 0x3C18265E: store_to_database (in /usr/X11R6/lib/libX11.so.6)
==74233==    by 0x3C182853: f_newline (in /usr/X11R6/lib/libX11.so.6)
==74233==    by 0x3C18356C: _XlcCreateLocaleDataBase (in /usr/X11R6/lib/libX11.so.6)
==74233==    by 0x3C18876B: initialize (in /usr/X11R6/lib/libX11.so.6)
==74233==
==74233== Conditional jump or move depends on uninitialised value(s)
==74233==    at 0x3C1826A2: store_to_database (in /usr/X11R6/lib/libX11.so.6)
==74233==    by 0x3C182853: f_newline (in /usr/X11R6/lib/libX11.so.6)
==74233==    by 0x3C18356C: _XlcCreateLocaleDataBase (in /usr/X11R6/lib/libX11.so.6)
==74233==    by 0x3C18876B: initialize (in /usr/X11R6/lib/libX11.so.6)
==74233==
==74233== Conditional jump or move depends on uninitialised value(s)
==74233==    at 0x3C1826A8: store_to_database (in /usr/X11R6/lib/libX11.so.6)
==74233==    by 0x3C182853: f_newline (in /usr/X11R6/lib/libX11.so.6)
==74233==    by 0x3C18356C: _XlcCreateLocaleDataBase (in /usr/X11R6/lib/libX11.so.6)
==74233==    by 0x3C18876B: initialize (in /usr/X11R6/lib/libX11.so.6)
filename = /home/itetcu/.xdtv/xdtvrc
xdtv_v4l-conf: not found
xdtv_v4l-conf had some trouble, trying to continue anyway
==74233==
==74233== Source and destination overlap in memcpy(0x3CB3DC4C, 0x3CB3DC4C, 4)
==74233==    at 0x3C03EEB7: memcpy (in /usr/local/lib/valgrind/vgpreload_memcheck.so)
==74233==    by 0x3C0C5569: GetResources (in /usr/X11R6/lib/libXt.so.6)
==74233==    by 0x3C0C5D93: _XtGetResources (in /usr/X11R6/lib/libXt.so.6)
==74233==    by 0x3C0AEC3E: xtCreate (in /usr/X11R6/lib/libXt.so.6)
==74233==
==74233== Source and destination overlap in memcpy(0x3CB489AC, 0x3CB489AC, 5)
==74233==    at 0x3C03EEB7: memcpy (in /usr/local/lib/valgrind/vgpreload_memcheck.so)
==74233==    by 0x3C71536E: __sfvwrite (in /lib/libc.so.5)
==74233==    by 0x3C70A10C: (within /lib/libc.so.5)
==74233==    by 0x3C70CD14: __vfprintf (in /lib/libc.so.5)
==74233==
==74233== Conditional jump or move depends on uninitialised value(s)
==74233==    at 0x3C1E70A2: XmuReadBitmapData (in /usr/X11R6/lib/libXmu.so.6)
==74233==    by 0x3C1E7574: XmuReadBitmapDataFromFile (in /usr/X11R6/lib/libXmu.so.6)
==74233==    by 0x3C1E5A6C: XmuLocatePixmapFile (in /usr/X11R6/lib/libXmu.so.6)
==74233==    by 0x3C1E5E95: XmuLocateBitmapFile (in /usr/X11R6/lib/libXmu.so.6)
==74233==
==74233== Conditional jump or move depends on uninitialised value(s)
==74233==    at 0x3C1E70A8: XmuReadBitmapData (in /usr/X11R6/lib/libXmu.so.6)
==74233==    by 0x3C1E7574: XmuReadBitmapDataFromFile (in /usr/X11R6/lib/libXmu.so.6)
==74233==    by 0x3C1E5A6C: XmuLocatePixmapFile (in /usr/X11R6/lib/libXmu.so.6)
==74233==    by 0x3C1E5E95: XmuLocateBitmapFile (in /usr/X11R6/lib/libXmu.so.6)
==74233==
==74233== Conditional jump or move depends on uninitialised value(s)
==74233==    at 0x3C238CA1: xpmParseColors (in /usr/X11R6/lib/libXpm.so.4)
==74233==    by 0x3C23579A: xpmParseDataAndCreate (in /usr/X11R6/lib/libXpm.so.4)
==74233==    by 0x3C23CF88: XpmCreateImageFromData (in /usr/X11R6/lib/libXpm.so.4)
==74233==    by 0x3C23C146: XpmCreatePixmapFromData (in /usr/X11R6/lib/libXpm.so.4)
==74233==
==74233== Conditional jump or move depends on uninitialised value(s)
==74233==    at 0x3C238CA7: xpmParseColors (in /usr/X11R6/lib/libXpm.so.4)
==74233==    by 0x3C23579A: xpmParseDataAndCreate (in /usr/X11R6/lib/libXpm.so.4)
==74233==    by 0x3C23CF88: XpmCreateImageFromData (in /usr/X11R6/lib/libXpm.so.4)
==74233==    by 0x3C23C146: XpmCreatePixmapFromData (in /usr/X11R6/lib/libXpm.so.4)
wmhooks: netwm detected
wmhooks: netwm state above supported
wmhooks: netwm fullscreen supported
wmhooks: nothing found...
DGA: server=2.0, include=2.0
VidMode: server=2.2, include=2.2
  available video mode(s): 1024x768 800x600 640x480 1024x768 1024x768 1024x768 1024x768 832x624 800x600 800x600 800x600 800x600 640x480 640x480 640x480 720x400 640x400 640x350 512x384 416x312 400x300 400x300 400x300 400x300
Selected XvImage adaptor with yuyv support: ATI Radeon Video Overlay on port 61 (grabdisplay)
No XvVideo port available.
true
*** AUDIO DEVICE TYPE = oss
supported formats
(0,type=0,bpp=2,masks=0x7c00/0x3e0/0x1f,sb=0,ss=0)
(1,type=0,bpp=2,masks=0x7c00/0x3e0/0x1f,sb=1,ss=0)
(2,type=0,bpp=2,masks=0xf800/0x7e0/0x1f,sb=0,ss=0)
(3,type=0,bpp=2,masks=0xf800/0x7e0/0x1f,sb=1,ss=0)
(4,type=0,bpp=3,masks=0xff0000/0xff00/0xff,sb=1,ss=0)
(5,type=0,bpp=4,masks=0xff0000/0xff00/0xff,sb=0,ss=0)
(6,type=0,bpp=4,masks=0xff0000/0xff00/0xff,sb=0,ss=1)
(7,type=0,bpp=4,masks=0xff0000/0xff00/0xff,sb=1,ss=0)
(8,type=0,bpp=4,masks=0xff0000/0xff00/0xff,sb=1,ss=1)
(9,type=1,bpp=2,masks=0xff0000/0xff00/0xff,sb=1,ss=1)
(10,type=2,bpp=2,masks=0xff0000/0xff00/0xff,sb=0,ss=1)
(11,type=3,bpp=2,masks=0xff0000/0xff00/0xff,sb=1,ss=1)
@@@@@@@@@@ f=5 i=8
*** GRABBER DEVICE TYPE = bktr
@@@@@@@@@@ f=2 i=1
@@@@@@@@@@ f=3 i=3
@@@@@@@@@@ f=4 i=4
@@@@@@@@@@ f=5 i=8
@@@@@@@@@@ f=10 i=10
@@@@@@@@@@ f=13 i=11
@@@@@@@@@@ f=20 i=0
@@@@@@@@@@ f=21 i=2
@@@@@@@@@@ f=23 i=5
*** MIXER DEVICE TYPE = oss
==74233==
==74233== Conditional jump or move depends on uninitialised value(s)
==74233==    at 0x8061C6C: lookup_channel (channel.c:237)
Warning: Cannot convert string "-*-ledfixed-medium-r-*--39-*-*-*-c-*-*-*" to type FontStruct
MMX, SSE, AMD MMX extensions, have been detected.
Method mmxext_64K
v=19000 arg=148 min=0 max=511
v=34000 arg=4 min=-128 max=127
v=32768 arg=-1 min=-128 max=127
v=28000 arg=218 min=0 max=511
@@@@@ 2 512 256
init grab_scr 128 96
@@@@@@@@@@ f=5 i=8
BEGIN CAPTURE
--74233-- sigprocmask: unknown `how' field 0
==74233==
==74233== Syscall param sigsuspend(mask) contains uninitialised or unaddressable byte(s)
==74233==    at 0x3C6A132F: (within /lib/libc.so.5)
==74233==    by 0x5F747360: ???
==74233==  Address 0x4FFFE0B0 is on thread 1's stack

 
> > - scheduling recording doesn't work (not everybody run linux - some
> > of the *.sh files installed need to be modified from bash to sh) [3]
> 
> ok
> 
> > - NLS support doesn't work because of a problem ./configure has with
> > testing for gettext so no internationalization for now.
> 
> you meen that the "gettext" test don't work on *BSD?

No, ./configure fails to detect gettext.

configure:26585: checking for gettext
configure:26642: cc -o conftest -O2 -pipe -march=athlon-xp -DMMX=1 -g -DDEBUG -I/usr/local/include  -L/usr/loc
al/lib conftest.c  >&5
conftest.c:84: warning: conflicting types for built-in function 'gettext'
/var/tmp//ccG0IuvS.o(.text+0x14): In function `main':
/usr/ports/multimedia/xdtv/work/xdtv-2.2.0/conftest.c:100: undefined reference to `gettext'
/var/tmp//ccG0IuvS.o(.data+0x0):/usr/ports/multimedia/xdtv/work/xdtv-2.2.0/conftest.c:99: undefined reference
to `gettext'
configure:26648: $? = 1
configure: failed program was:
| /* confdefs.h.  */
..........

> > - you actually need misc/alevt for teletext support (xdtv contains
> > alevt source code but it doesn't actually build alevt binary, only
> > xdtv_alevt-cap - and the port won't pull it for you right now, so you
> > have to install it manually. [4]
> 
> Why? AleVT is inside the XdTV software now (version 1.6.1). I just
> restore for you the possibility to use png format to export as a
> picture and AleVT teletext capture. I also restore the "smallfont"
> possibility. Third, I apply the patch about html export you suggest
> me.

Hmm, I think you're right here. I'll have to retrace my steps to see
what did make me say this. I first worked on the port on a machine
without a tv card so I think that's why I didn't got the alevt screen
and forgot all about it when doing the actual testing.

 [ ... ]
 
> > When writing patches please consider that we have very good chances to
> > propagate them upstream, thanks to the support of one of the
> > developers, Pingus, so please try not to break non-FreeBSD cases.
> 
> 
> Yes please. If we commit any patch from *BSD user these patch must
> also work for *Linux too.
> 
> About the modification to test BT8xx presence, do you think your
> patch will work on all *BSD system? 

No. I'm not convinced they work on FreeBSD 4.x either, but I have no
machine to test on and I don't care much, anyone running FreeBSD as a
desktop should be running 5.x or the upcoming 6.

> -#include <machine/ioctl_meteor.h> <==== this doesn't works??
> 
> -#include <machine/ioctl_bt848.h> <==== this doesn't works??
> 
> +#include <dev/bktr/ioctl_meteor.h>
> 
> +#include <dev/bktr/ioctl_bt848.h>

They work, but then I get a warning saying to include those from dev;

> - AC_CHECK_HEADERS(dev/ic/bt8xx.h) <==== this doesn't works??
> 
> + AC_CHECK_HEADERS(dev/bktr/ioctl_bt848.h)

No, that's for OpenBSD, which imported both our meteor and bt484
headers mixed in one file.

> and you don't modify that:
> 
>  #if HAVE_DEV_IC_BT8XX_H
> 
>  #include <dev/ic/bt8xx.h> <============ so why /dev/ic and
> sometimes /dev/bktr. What is the best to test the drivers?

From what I see in dev/ic/ we have headers for some controllers/serial
cards. Bktr is in dev/bktr

> 2) about font/Makefile.in:
> 
> -prefix=/usr/X11R6
> 
> +prefix=%%X11BASE%%
> 
> I'm  not sure we use this line actually. perhaps we have to remove it.

I don't think so; I'm replacing it and then, in post-patch target, I'm
writing the "right" value (which defaults to /usr/X11R6) from the
port's Makefile. One can have X11 installed in an other location.

> 
> 3) about xdtv_wizard: I don't understand what you do on it. we
> suggest to copy the conf file in /etc/xdtv. for the
> internationalization we propose the same. Why changing the path?

Because on *BSDs /etc is for system configuration files, while third
party software config files goes to PREFIX/etc (PREFIX defaulting
o /usr/local on FreeBSD). See hier(7)
http://www.freebsd.org/cgi/man.cgi?query=hier&apropos=0&sektion=7&manpath=FreeBSD+5.4-RELEASE+and+Ports&format=html

Your ./configure should respect --sysconfigdir, which it ignores.

> 4) divx4linux OFF : yes of course it work only for linux. 

There is probably a way to make it work, since we have it 

> ALSA: there is no alsa on BSD?


 
> 5) explain me why you need a complete path for JPEG header:
> 
> -# include <jpeglib.h>
> 
> +# include </usr/local/include/jpeglib.h>

This is not the right way, I know; without it ./configure will work but
compile will fail finding the file; I don't understand why; quick and
dirty work as I've said. :(


-- 
IOnut
Unregistered ;) FreeBSD "user"
  "Intellectual Property" is   nowhere near as valuable   as "Intellect"




More information about the freebsd-multimedia mailing list