Home
Eruption - What is LavaRnd?
Obsidian - FAQ
Lava - Demos
Lavaologists - About us
Strata - New and old stuff
Magma - Download
Bedrock - Developers

LavaRnd D-LINK DSB-C100 webcam settings

To maximize the noise to signal ratio of the chaotic source, LavaRnd cranks up the webcam settings to maximize the chaotic noise that the CCD records. The following sections describe these settings.

Linux module setting

The /etc/hotplug/usb/ov511 performs the following modprobe:
/sbin/modprobe ov511 autobright=1 autogain=1 autoexp=1 fastset=1 compress=0 force_palette=15

Open camera state

The camset tool:
camset dsbc100 /dev/video0 -L -v 1
reports that the default LavaRnd open state of the camera is as follows:
Camera name: OV511+ USB Camera
ov511 camera type: 513
Picture brightness: 11520
Picture hue: 35840
Picture colour: 65280
Picture contrast: 65280
Picture depth: 12
Min width: 64
Min height: 48
Max width: 352
Max height: 288
Width: 352
Height: 288
Video mbuf size: 608272
Video mbuf count: 2
Palette: YUV 4:2:0 Planar (15)

Camera sanity check parameters

To help ensure that the camera is operating in a proper fashion, the LavaRnd camop layer performs the following sanity checks as reported by the camset tool:
4 most frequent octet values are considered common
max fraction of frame containing common octet values: 0.432444
3 most common values must be < 1/2 of frame octets
min fraction of bits same in next frame: 0.212036
max fraction of bits same in next frame: 0.787964
NOTE: In the above, the frame refers to only the chaos potion of the frame. See the camera frame size below.

Camera frame size

When using the -L default LavaRnd settings, the following frame information is reported by the camset tool:
read size: 304136
read LavaRnd offset: 0
read LavaRnd length: 101376

mmap size: 608272
mmap frame size: 304136
mmap frames: 2
mmap LavaRnd offset: 304136
mmap LavaRnd length: 101376

will use mmap I/O
mmap image: 608272
chaos size: 101376
chaos offset: 304136

LavaRnd output rate

We use the lavadump tool to measure the amount of time it takes for LavaRnd to output 1 Megabyte (1048576 octets) for a given camera. When using lavadump, we set the default LavaRnd parameters (see above), and we disable the normal warm-up wait period. These tests were perform on a Linux system with a detected 1529.526 MHz Athlon processor (3053.97 BogoMIPS) using the following command:
time lavadump dsbc100 /dev/video0 1048576 alpha_rate -L -T 0 >/dev/null
lavadump of 1 Megabyte
alpha rate bits/second real seconds user seconds system seconds
1.0 19883 7m1.899s 0m4.600s 0m10.350s
2.0 28277 4m56.659s 0m3.230s 0m7.070s
4.0 37367 3m44.490s 0m2.540s 0m5.170s
8.0 52270 2m40.486s 0m1.820s 0m3.670s

You should remember that the lavadump tool, while it performs the LavaRnd Digital Blendertm Algorithm using the server libraries, is intended for use as a test tool only. One should use the LavaRnd application interface (API) and allow the lavapool daemon to access the webcam and buffer the random numbers.

An application using the LavaRnd API can receive random data at a high rate as long as the lavapool daemon's buffer contains random data. One may configure the size of the lavapool buffer by adjusting the poolsize value in the cfg.lavapool file. So unless your application requires a great deal of random data over an extended period of time, the actual output rate of the webcam may not be that important.

An alpha rate of 8.0 is used when the lavapool buffer is below the fastpool configure value. As the buffer level increases to the slowpool, the alpha rate drops to 1.0. Above the slowpool an alpha rate of 1.0 is used.

The above timings suggest that the random data output rate is not limited by the CPU, but rather by the webcam's ability to output chaos. The limiting factor in webcam chaos output may be a combination of the webcam frame rate & size, perhaps the webcam signal to noise ratio, and the webcam data transfer rate.

Entropy measurements

We use the imgtally tool to process 131072 frames:
imgtally dsbc100 /dev/video0 131072 /var/tmp/tally_file -L -v 2

to produce the following entropy measurement on the luminance data found in a webcam frame:

Shannon entropy bit measure:    565894.05
Shannon total image entropy:    481231.67
Shannon estimate entropy/pixel:      4.7470

NOTE: The above is not a measurement of LavaRnd's output, it is a measurement of the luminance that would have been feed to the LavaRnd Digital Blendertm Algorithm to produce random data.

Luminance octet value distribution

Using the gnuplot on the /var/tmp/tally_file file (produced by the previous imgtally command), we can observe the distribution of octet values within the raw luminance data:

dsbc100 luminance octets values dsbc100 luminance octets values

Additional resources

See the webcam page for information about other webcams that LavaRnd supports.

One may obtain informaion on the ov511 Linux kernel module that supports this webcam.

SourceForge.net Logo
Home  |   LavaRnd?  |   FAQ  |   Demos  |   About us  |   New & Old  |   Download  |   Developers  |   Tour