Re: FYI: v4l-linuxulator support in FreeBSD-current now

2011-01-11 Thread Alexander Leidinger
Quoting Hans Petter Selasky hsela...@c2i.net (from Tue, 11 Jan 2011  
09:47:46 +0100):



Hi,

I've received the following patch for my cuse4bsd module. Could this be


From Andrew Gallatin (gallatin@)?


included in the kernel's linux.ko ? This patch allows for linux DVB
applications running under FreeBSD linux emulation.


Yes, but I would prefer the person who submitted it could test it  
before it is committed.


Semi-OT: Are you sure the MODULE_DEPEND is not necessary for your  
module and should be included?


Bye,
Alexander.


--HPS

Index: cuse4bsd_kmod.c
===
--- cuse4bsd_kmod.c (revision 1700)
+++ cuse4bsd_kmod.c (working copy)
@@ -1689,3 +1689,49 @@

return (0);
 }
+
+
+#include sys/sysproto.h
+#if defined (__amd64__)
+#include machine/../linux32/linux.h
+#include machine/../linux32/linux32_proto.h
+#else
+#include machine/../linux/linux.h
+#include machine/../linux/linux_proto.h
+#endif
+
+#include compat/linux/linux_ioctl.h
+MODULE_DEPEND(cuse4bsd, linux, 1, 1, 1);
+
+#define DVB_LINUX_IOCTL_MIN  0x6f00
+#define DVB_LINUX_IOCTL_MAX  0x6fff
+
+
+static linux_ioctl_function_t cuse4bsd_linux_ioctl;
+static struct linux_ioctl_handler cuse4bsd_linux_handler =
+  {cuse4bsd_linux_ioctl, DVB_LINUX_IOCTL_MIN, DVB_LINUX_IOCTL_MAX};
+
+SYSINIT  (cuse4bsd_linux_register,   SI_SUB_KLD, SI_ORDER_MIDDLE,
+  linux_ioctl_register_handler, cuse4bsd_linux_handler);
+SYSUNINIT(cuse4bsd_linux_unregister, SI_SUB_KLD, SI_ORDER_MIDDLE,
+  linux_ioctl_unregister_handler, cuse4bsd_linux_handler);
+
+static int
+cuse4bsd_linux_ioctl(struct thread *td, struct linux_ioctl_args *args)
+{
+  unsigned long cmd;
+
+  /* swap the read/write bits, due to differences in bsd  linux ioctls*/
+  cmd = (unsigned long)args-cmd;
+  if (cmd  (0x40  24)) {
+ cmd = 0xff;
+ cmd |= (0x80  24);
+  } else if (cmd  (0x80  24)) {
+ cmd = 0xff;
+ cmd |= (0x40  24);
+  }
+  args-cmd = (l_uint)cmd;
+
+  /* Pass the ioctl off to our standard handler, now that its valid */
+  return(ioctl(td, (struct ioctl_args *)args));
+}






--
Seems this guy showed up at a party, and all of his friends jumped for
Joy.  But she sidestepped, and they missed.

http://www.Leidinger.netAlexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org   netchild @ FreeBSD.org  : PGP ID = 72077137
___
freebsd-emulation@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-emulation
To unsubscribe, send any mail to freebsd-emulation-unsubscr...@freebsd.org


Re: FYI: v4l-linuxulator support in FreeBSD-current now

2011-01-11 Thread Alexander Leidinger
Quoting Hans Petter Selasky hsela...@c2i.net (from Tue, 11 Jan 2011  
13:19:28 +0100):



On Tuesday 11 January 2011 13:11:53 Alexander Leidinger wrote:

Quoting Hans Petter Selasky hsela...@c2i.net (from Tue, 11 Jan 2011

09:47:46 +0100):
 Hi,

 I've received the following patch for my cuse4bsd module. Could this be

 From Andrew Gallatin (gallatin@)?


Yes, that is correct.


I'll contact him, and I think he can commit this himself.

Bye,
Alexander.

--
You auto buy now.

http://www.Leidinger.netAlexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org   netchild @ FreeBSD.org  : PGP ID = 72077137
___
freebsd-emulation@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-emulation
To unsubscribe, send any mail to freebsd-emulation-unsubscr...@freebsd.org


Re: FYI: v4l-linuxulator support in FreeBSD-current now

2011-01-11 Thread Andrew Gallatin
On Tue, Jan 11, 2011 at 9:26 AM, J.R. Oldroyd f...@opal.com wrote:

 This patch merely flips the cmd bits.

 I'm not familiar with the Linux DVB ioctls... is it really the case
 that none of the data structures have 32/64-bit architecture dependent
 field sizes?  Great if that's the case, but if not, we need to do
 data structure conversions here too, as we did for V4L.

I looked for a compat_ioctl for DVB, but came up with nothing.  From a
2.6.37 kernel:

$ pwd
/usr/src/kernels/linux-2.6.37/drivers/media
$ find . -name '*.c' | xargs grep compat_ioctl
./video/v4l2-dev.c: .compat_ioctl = v4l2_compat_ioctl32,
./video/v4l2-compat-ioctl32.c:  printk(KERN_INFO
compat_ioctl32: unexpected VIDIOC_FMT type %d\n,
./video/v4l2-compat-ioctl32.c:  printk(KERN_INFO
compat_ioctl32: unexpected VIDIOC_FMT type %d\n,
./video/v4l2-compat-ioctl32.c:long v4l2_compat_ioctl32(struct file
*file, unsigned int cmd, unsigned long arg)
./video/v4l2-compat-ioctl32.c:  printk(KERN_WARNING compat_ioctl32: 
./video/v4l2-compat-ioctl32.c:EXPORT_SYMBOL_GPL(v4l2_compat_ioctl32);
./IR/ir-lirc-codec.c:   .compat_ioctl   = ir_lirc_ioctl,
./IR/lirc_dev.c:.compat_ioctl   = lirc_dev_fop_ioctl,

Also,  the DVB ioctls  I've looked at seem to be explictly sized (no
long used, u32 or u64 everywhere).

I tested the patch last night on amd64. I was able to successfully run
ia32 linux azap, dvbtraffic and test_dvr utils to tune a channel, find
the active PIDs, and record the stream to a file.

Drew
___
freebsd-emulation@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-emulation
To unsubscribe, send any mail to freebsd-emulation-unsubscr...@freebsd.org


Re: FYI: v4l-linuxulator support in FreeBSD-current now

2010-09-07 Thread Matthias Apitz
El día Monday, September 06, 2010 a las 02:45:36PM +0200, Alexander Leidinger 
escribió:

 Skype in FreeBSD as guest in the VM:
 
 $ skype
 Starting the process...
 Skype Xv: Xv ports available: 1
 Skype XShm: XShm support enabled
 Skype Xv: Using Xv port 56
 Skype Xv: No suitable overlay format found
 ^^
 
 Skype in the host:
 
 $ skype
 Starting the process...
 Skype Xv: Xv ports available: 32
 Skype XShm: XShm support enabled
 Skype Xv: Using Xv port 416
 
 What you see is related to the output (X11/Xv). This is not related to  
 v4l. You can run xvinfo on both systems to see the difference of the  
 video output capabilities.

In the VM the Xorg server is using the 'vmware' driver (while native the
nvidia driver). The output of xvinfo is rather short in the VM:

X-Video Extension version 2.2
screen #0
  Adaptor #0: VMware Video Engine
number of ports: 1
port base: 56
operations supported: PutImage
supported visuals:
  depth 24, visualID 0x21
number of attributes: 2
  XV_COLORKEY (range 0 to 16777215)
  client settable attribute
  client gettable attribute
  XV_AUTOPAINT_COLORKEY (range 0 to 1)
  client settable attribute
  client gettable attribute
maximum XvImage size: 2048 x 2048
Number of image formats: 3
  id: 0x32315659 (YV12)
guid: 59563132--0010-8000-00aa00389b71
bits per pixel: 12
number of planes: 3
type: YUV (planar)
  id: 0x32595559 (YUY2)
guid: 59555932--0010-8000-00aa00389b71
bits per pixel: 16
number of planes: 1
type: YUV (packed)
  id: 0x59565955 (UYVY)
guid: 55595659--0010-8000-00aa00389b71
bits per pixel: 16
number of planes: 1
type: YUV (packed)

Any hint what is missing or wrong in the VM? Thanks

matthias

-- 
Matthias Apitz
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e g...@unixarea.de - w http://www.unixarea.de/
Solidarity with the zionistic pirates of Israel?   Not in my  name!
¿Solidaridad con los piratas sionistas de Israel? ¡No en mi nombre!
___
freebsd-emulation@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-emulation
To unsubscribe, send any mail to freebsd-emulation-unsubscr...@freebsd.org


Re: FYI: v4l-linuxulator support in FreeBSD-current now

2010-09-07 Thread Alexander Leidinger
Quoting Matthias Apitz g...@unixarea.de (from Tue, 7 Sep 2010  
11:44:10 +0200):


El día Monday, September 06, 2010 a las 02:45:36PM +0200, Alexander  
Leidinger escribió:



Skype in FreeBSD as guest in the VM:

$ skype
Starting the process...
Skype Xv: Xv ports available: 1
Skype XShm: XShm support enabled
Skype Xv: Using Xv port 56
Skype Xv: No suitable overlay format found
^^

Skype in the host:

$ skype
Starting the process...
Skype Xv: Xv ports available: 32
Skype XShm: XShm support enabled
Skype Xv: Using Xv port 416

What you see is related to the output (X11/Xv). This is not related to
v4l. You can run xvinfo on both systems to see the difference of the
video output capabilities.


In the VM the Xorg server is using the 'vmware' driver (while native the
nvidia driver). The output of xvinfo is rather short in the VM:


snip/


Any hint what is missing or wrong in the VM? Thanks


No idea, but an educated guess would be: maybe the format which is  
used in the input (or by Skype, but I would first look at the input  
format).


Bye,
Alexander.

--
All theoretical chemistry is really physics;
and all theoretical chemists know it.
-- Richard P. Feynman

http://www.Leidinger.netAlexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org   netchild @ FreeBSD.org  : PGP ID = 72077137
___
freebsd-emulation@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-emulation
To unsubscribe, send any mail to freebsd-emulation-unsubscr...@freebsd.org


Re: FYI: v4l-linuxulator support in FreeBSD-current now

2010-09-06 Thread Alexander Leidinger


Quoting Matthias Apitz g...@unixarea.de (from Mon, 6 Sep 2010  
13:51:53 +0200):


El día Monday, September 06, 2010 a las 10:34:39AM +0200, Matthias  
Apitz escribió:



If I say all is working fine, there is one small exception: When I plug
in my Phillips USB video cam, the device /dev/video0 appears, pwcview(1)
works fine and also Skype sees and uses the device. The called party see
my picture fine, but locally in Skype I don't have my own picture,
neither in the probe window in Options (there it is only black), and not
in the call embedded in the picture of the called party (there it's only
white). What could be the reason of this?


more info: I run Skype from a command line terminal and there is a
difference in the moment the 'probe' button is pressed:

Skype in FreeBSD as guest in the VM:

$ skype
Starting the process...
Skype Xv: Xv ports available: 1
Skype XShm: XShm support enabled
Skype Xv: Using Xv port 56
Skype Xv: No suitable overlay format found
^^

Skype in the host:

$ skype
Starting the process...
Skype Xv: Xv ports available: 32
Skype XShm: XShm support enabled
Skype Xv: Using Xv port 416


What you see is related to the output (X11/Xv). This is not related to  
v4l. You can run xvinfo on both systems to see the difference of the  
video output capabilities.


Bye,
Alexander.

--
Quality Control, n.:
The process of testing one out of every 1,000 units coming off
a production line to make sure that at least one out of 100 works.

http://www.Leidinger.netAlexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org   netchild @ FreeBSD.org  : PGP ID = 72077137
___
freebsd-emulation@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-emulation
To unsubscribe, send any mail to freebsd-emulation-unsubscr...@freebsd.org