* Re: capture.c example (multiple inputs)
@ 2008-10-07 13:57 Brian Phelps
2008-10-07 14:52 ` Daniel Glöckner
0 siblings, 1 reply; 4+ messages in thread
From: Brian Phelps @ 2008-10-07 13:57 UTC (permalink / raw)
To: video4linux-list
I did some digging and it looks like this single chip bt878 card must
cut the frame rate when switching inputs. Is this correct?
I found a 4-chip version from bluecherry.com that seems to do this at
full 30 FPS per channel.
On Tue, Oct 7, 2008 at 9:15 AM, Brian Phelps <lm317t@gmail.com> wrote:
> Hi, I have a 4 input Hauppage ImpactVCB.
>
> I have modified capture.c to display frames from an input using SDL
> and the mmap method and this seems to work great. I would like to
> modify capture.c to display video using 2 inputs. The problem is that
> if I change inputs, I have to wait for another frame to enter the
> buffer. This cuts the frame rate in half.
>
> How do I capture frames from two inputs without cutting the frame rate?
>
>
> static void
> mainloop (void)
> {
> unsigned int count;
>
> count = 1000;
>
> //Frame_timer = SDL_AddTimer(INTERVAL, process_image, NULL);
> while (count-- > 0)
> {
> for (;;)
> {
> fd_set fds;
> struct timeval tv;
> int r;
>
> FD_ZERO (&fds);
> FD_SET (fd, &fds);
>
> /* Timeout. */
> tv.tv_sec = 2;
> tv.tv_usec = 0;
>
> r = select (fd + 1, &fds, NULL, NULL, &tv);
>
> if (-1 == r)
> {
> if (EINTR == errno)
> continue;
>
> errno_exit ("select");
> }
>
> if (0 == r)
> {
> fprintf (stderr, "select timeout\n");
> exit (EXIT_FAILURE);
> }
>
> // if (read_frame (0))
> {
> ;
> //r = select (fd + 1, &fds, NULL, NULL, &tv);
> }
>
>
> while(read_frame (0)==0) // I modified read_frame to change
> the input: read_frame(int input_number)
> r = select (fd + 1, &fds, NULL, NULL, &tv);
>
> while(read_frame (1)==0)
> r = select (fd + 1, &fds, NULL, NULL, &tv);
> break;
>
> /* EAGAIN - continue select loop. */
> }
> printf("Count is %d\n", count);
> }
> }
>
--
Brian Phelps
System Design Engineer
Custom Light and Sound
919-286-0011
http://customlightandsound.com
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: capture.c example (multiple inputs)
2008-10-07 13:57 capture.c example (multiple inputs) Brian Phelps
@ 2008-10-07 14:52 ` Daniel Glöckner
2008-10-07 16:34 ` Brian Phelps
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Glöckner @ 2008-10-07 14:52 UTC (permalink / raw)
To: Brian Phelps; +Cc: video4linux-list
On Tue, Oct 07, 2008 at 09:57:28AM -0400, Brian Phelps wrote:
> I did some digging and it looks like this single chip bt878 card must
> cut the frame rate when switching inputs. Is this correct?
correct.
> I found a 4-chip version from bluecherry.com that seems to do this at
> full 30 FPS per channel.
You mean .net, not .com?
Be warned, depending on your system there may be dropped pixels when
capturing four inputs at high resolution in inefficient color spaces.
Especially when you try to write the videos to harddisk while the
harddisk controller shares a PCI bus with the capture card.
Daniel
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: capture.c example (multiple inputs)
2008-10-07 14:52 ` Daniel Glöckner
@ 2008-10-07 16:34 ` Brian Phelps
2008-10-07 18:37 ` Daniel Glöckner
0 siblings, 1 reply; 4+ messages in thread
From: Brian Phelps @ 2008-10-07 16:34 UTC (permalink / raw)
To: video4linux-list
Hi Daniel,
On Tue, Oct 7, 2008 at 10:52 AM, Daniel Glöckner <daniel-gl@gmx.net> wrote:
> On Tue, Oct 07, 2008 at 09:57:28AM -0400, Brian Phelps wrote:
>> I did some digging and it looks like this single chip bt878 card must
>> cut the frame rate when switching inputs. Is this correct?
>
> correct.
>
>> I found a 4-chip version from bluecherry.com that seems to do this at
>> full 30 FPS per channel.
>
> You mean .net, not .com?
Yes its bluecherry.net, I was in a hurry
>
> Be warned, depending on your system there may be dropped pixels when
> capturing four inputs at high resolution in inefficient color spaces.
> Especially when you try to write the videos to harddisk while the
> harddisk controller shares a PCI bus with the capture card.
Thanks for the advice Dan.
I am a bit of a newbie the concept of PCI buses. In this example (not
mine) is the 1e that the bt878 card is on, on a different bus than the
IDE controller, 1f?:
# lspci -tv
-[00]-+-00.0 Intel Corporation 82845G/GL[Brookdale-G]/GE/PE DRAM
Controller/Host-Hub Interface
+-02.0 Intel Corporation 82845G/GL[Brookdale-G]/GE Chipset
Integrated Graphics Device
+-1d.0 Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M)
USB UHCI Controller #1
+-1d.1 Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M)
USB UHCI Controller #2
+-1d.2 Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M)
USB UHCI Controller #3
+-1d.7 Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller
+-1e.0-[01]--+-02.0 Brooktree Corporation Bt878 Video Capture
| +-02.1 Brooktree Corporation Bt878 Audio Capture
| \-05.0 Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+
+-1f.0 Intel Corporation 82801DB/DBL (ICH4/ICH4-L) LPC Interface Bridge
+-1f.1 Intel Corporation 82801DB (ICH4) IDE Controller
+-1f.3 Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M)
SMBus Controller
\-1f.5 Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M)
AC'97 Audio Controller
>
> Daniel
>
--
Brian Phelps
System Design Engineer
Custom Light and Sound
919-286-0011
http://customlightandsound.com
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: capture.c example (multiple inputs)
2008-10-07 16:34 ` Brian Phelps
@ 2008-10-07 18:37 ` Daniel Glöckner
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Glöckner @ 2008-10-07 18:37 UTC (permalink / raw)
To: Brian Phelps; +Cc: video4linux-list
On Tue, Oct 07, 2008 at 12:34:50PM -0400, Brian Phelps wrote:
> I am a bit of a newbie the concept of PCI buses. In this example (not
> mine) is the 1e that the bt878 card is on, on a different bus than the
> IDE controller, 1f?:
PCI busses always form a logical tree structure with the CPU at its root.
So there will always be one bus in the lspci -tv diagram that appears
to be affected by capturing and harddisk access. If this bus (and every
other bus between it and main memory) is plain 33 MHz 32 bit PCI, you're
out of luck. If it is PCIe, PCI-X, 66 MHz PCI, or 64 bit PCI (assuming
the non-PCIe busses are not throttled to 33 MHz/32 bit during transfers),
it should be possible to transfer the incoming data to the harddisk
controller.
> -[00]-+-00.0 Intel Corporation 82845G/GL[Brookdale-G]/GE/PE DRAM
> Controller/Host-Hub Interface
> +-1e.0-[01]--+-02.0 Brooktree Corporation Bt878 Video Capture
> | +-02.1 Brooktree Corporation Bt878 Audio Capture
> +-1f.1 Intel Corporation 82801DB (ICH4) IDE Controller
In your example the IDE controller is in the same chip that provides the
PCI interface. The datasheet says:
"By placing the I/O bridge on the hub interface (instead of PCI), the hub
architecture ensures that both the I/O functions integrated into the ICH4
and the PCI peripherals obtain the bandwidth necessary for peak performance."
According to Wikipedia (couldn't find it in the datasheet..) the hub
interface to the host controller is 266 MHz 8 bit.
Daniel
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-10-07 18:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-07 13:57 capture.c example (multiple inputs) Brian Phelps
2008-10-07 14:52 ` Daniel Glöckner
2008-10-07 16:34 ` Brian Phelps
2008-10-07 18:37 ` Daniel Glöckner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox