From: Simon Farnsworth <simon.farnsworth@onelan.com>
To: Hans de Goede <j.w.r.degoede@hhs.nl>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: libv4l2 and the Hauppauge HVR1600 (cx18 driver) not working well together
Date: Thu, 03 Sep 2009 10:17:33 +0100 [thread overview]
Message-ID: <4A9F89AD.7030106@onelan.com> (raw)
In-Reply-To: <4A9EAF07.3040303@hhs.nl>
Hans de Goede wrote:
> Hi,
>
> On 09/02/2009 06:32 PM, Simon Farnsworth wrote:
>> I have a Hauppauge HVR1600 for NTSC and ATSC support, and it appears to
>> simply not work with libv4l2, due to lack of mmap support. My code works
>> adequately (modulo a nice pile of bugs) with a HVR1110r3, so it appears
>> to be driver level.
>>
>> Which is the better route to handling this; adding code to input_v4l to
>> use libv4lconvert when mmap isn't available, or converting the cx18
>> driver to use mmap?
>>
>
> Or modify libv4l2 to also handle devices which can only do read. There have
> been some changes to libv4l2 recently which would make doing that feasible.
>
Roughly what would I need to do to libv4l2?
I can see four new cases to handle:
1) driver supports read(), client wants read(), format supported by
both. Just pass read() through to the driver.
2) driver supports read(), client wants mmap(), format supported by
both. Allocate buffers when REQBUFs happens, handle QBUF and DQBUF by
read()ing frame size chunks into the buffer at the head of the internal
queue when a DQBUF happens, and passing it back out.
3) As 1, but needs conversion. read() into a temporary buffer, convert
with libv4lconvert (I think this needs a secondary buffer), and supply
data from the secondary buffer to read()
4) As 2, but needs conversion. Change DQBUF handling to read() frame
size chunks into a temporary buffer, then use libv4lconvert to copy
those chunks from the temporary buffer into the buffer you're about to
pass out.
Have I missed anything?
>> If it's a case of converting the cx18 driver, how would I go about doing
>> that? I have no experience of the driver, so I'm not sure what I'd have
>> to do - noting that if I break the existing read() support, other users
>> will get upset.
>
> I don't believe that modifying the driver is the answer, we need to either
> fix this at the libv4l or xine level.
>
> I wonder though, doesn't the cx18 offer any format that xine can handle
> directly?
>
Not sensibly; it offers HM12 only, and Xine needs an RGB format, YV12,
or YUYV. With a lot of rework, I could have the cx18 encode video to
MPEG-2, then have Xine decode the resulting MPEG-2 stream, but this
seems like overkill for uncompressed video. I could also teach Xine to
handle HM12 natively, but that would duplicate effort already done in
libv4l2 and libv4lconvert, which seems a bit silly to me.
--
Simon Farnsworth
next prev parent reply other threads:[~2009-09-03 9:17 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-02 16:32 libv4l2 and the Hauppauge HVR1600 (cx18 driver) not working well together Simon Farnsworth
2009-09-02 17:44 ` Hans de Goede
2009-09-03 9:17 ` Simon Farnsworth [this message]
2009-09-03 9:28 ` Hans de Goede
2009-09-03 9:44 ` Hans de Goede
2009-09-03 10:21 ` Simon Farnsworth
2009-09-03 10:37 ` Simon Farnsworth
2009-09-03 10:56 ` Simon Farnsworth
2009-09-03 11:16 ` Andy Walls
2009-09-03 11:20 ` Hans de Goede
2009-09-03 11:23 ` Andy Walls
2009-09-04 3:14 ` Andy Walls
2009-09-04 6:22 ` Hans de Goede
2009-09-03 11:13 ` Hans de Goede
2009-09-03 11:45 ` Hans de Goede
2009-09-03 11:06 ` Andy Walls
2009-09-03 11:23 ` Simon Farnsworth
2009-09-03 11:29 ` Andy Walls
2009-09-03 11:44 ` Simon Farnsworth
2009-09-03 23:34 ` Andy Walls
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A9F89AD.7030106@onelan.com \
--to=simon.farnsworth@onelan.com \
--cc=j.w.r.degoede@hhs.nl \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox