[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-video
Subject:    Re[2]: [V4L] NVrec - V4L1 interface ( does mmap() work with bttv 0.8.16? )
From:       Eugene Kuznetsov <divx () euro ! ru>
Date:       2001-06-08 11:30:01
[Download RAW message or body]

Hello Justin,

Friday, June 08, 2001, 2:22:51 AM, you wrote:

JS> Eugene Kuznetsov wrote:
>> >> Next question is, why mmap() is failing? I tried to add a couple
>> >> of printk()'s to find out what happens, and this looks quite weird
>> >> for me. One of the first sanity checks in bttv_mmap() ( sources of
>> >> 0.8.16 ) fails. It is:
>> >>
>> >>         if (!(vma->vm_flags & VM_SHARED))
>> >>             return -EINVAL;
>> >>
>> >> But, if I correctly understood what happens during the mmap() syscall
>> >> ( /usr/src/linux/mm/mmap.c ), VM_SHARED flag is not set for mapping
>> >> areas read-only! I tried to change protection in parameters to
>> >> mmap(), but only to receive 'permission denied' instead of 'invalid
>> >> argument', even as root.
>> 
>> JS> Umm.. Try the attached patch - this may work...
>> 
>> As I already mentioned, applying this change does not help, because
>> then I receive 'permission denied'.

JS> Now that is strange... The patched mmap command is now identical to that
JS> used in xawtv!  Has anybody else gotten this to work with bttv 0.8.16? 
JS> If so, please let us know how!

This problem was really simple - you can't mmap() read-write when the
device is opened read-only. After I fixed that, I even managed to
capture something. I'll give more details tomorrow.

-- 
Best regards,
 Eugene



NetZero Platinum
No Banner Ads and Unlimited Access
Sign Up Today - Only $9.95 per month!
http://www.netzero.net



_______________________________________________
Video4linux-list mailing list
Video4linux-list@redhat.com
https://listman.redhat.com/mailman/listinfo/video4linux-list

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic