AXIOM Beta/AXIOM Beta Manual

From apertus wiki
Jump to: navigation, search

The AXIOM Beta Manual (ABM) can be downloaded in full, in various languages from AXIOM Beta/AXIOM Beta Manual/Versions

In some instances the instructions we have prepared are written in a manor that can be followed by people without a deep technical knowledge. If you are an advanced user please keep this in mind.

Notes on Userspace: Arch Linux comes with systemd, which has the advantage of incredibly fast boot processing. Standard tools such as sshd and dhcpcd have been pre-installed.

Warning: If you make amendments or additions to this page then please be careful with title syntax as mistakes can throw its content numbering structure off.




1 General Information

One solution to storing camera relevant parameters inside the camera and to provide access from most programming languages is to use a database like http://en.wikipedia.org/wiki/Berkeley\DB




1.1 AXIOM Beta Connector Overview

ToDo




1.2 Mountpoints

ToDo




1.3 Accessories and Connected Devices

ToDo




2 Operating Basics

2.1 Prepare Your AXIOM Beta Camera for Use

  1. Use a micro-USB cable to connect the camera's MicroZed development board (USB UART) to a computer. The MicroZed board is the backmost, red PCB. (There is another micro-USB socket on the Power Board, but that is the JTAG Interface.)
  2. Connect the ethernet port on the MicroZed to an ethernet port on your computer. You might have to use an ethernet adapter on newer, smaller machines which come without a native ethernet port.
  3. Connect the AC adapter to the camera's Power Board. (The power cord plugs into an adapter that connects to the Power Board; to power the camera off at a later point, you need not disconnect the adapter from the board but can just unplug the cord from the adapter.)




2.2 Prep your computer for use with your camera

BetaGuide.jpg

To communicate with your AXIOM Beta camera, you will send it instructions via your computer's command line.

In case you have not worked with a shell (console, terminal) much or ever before, we have prepared detailed instructions to help you get you set up. The steps which need to be taken to prepare your machine sometimes differ between operating systems, so pick the ones that are applicable to you(r system).

Note that dollar signs $ placed in front of commands are not meant to be typed in but denote the command line prompt (a signal indicating the computer is ready for user input). It is used in documentation to differentiate between commands and output resulting from commands. The prompt might look different on your machine (e.g. an angled bracket >) and be preceded by your user name, computer name or the name of the directory which you are currently inside.




2.2.1 USB to UART drivers

For the USB connection to work, you will need drivers for bridging USB to UART (USB to serial). (Under Linux this works out of the box in most distributions) for other operating systems they can be downloaded from e.g. Silicon Labs' website – pick the software provided for your OS and install it.




2.2.2 Serial console

The tool we recommend for connecting to the AXIOM Beta camera via serial port with Mac OS X or Linux is minicom; for connections from Windows machines, we have used Putty.




2.2.2.1 Linux setup

Check if you already have minicom installed on your system by trying to run it:

$ minicom

Your system will respond with a message like bash: command not found: minicom if it's not installed.

Install minicom

Install the minicom package like you'd install other software on your system – which could be via a GUI tool or using aptitude or apt-get (for wich you might need super user rights), e.g.:

$ apt-get install minicom

or

$ sudo apt-get install minicom




2.2.2.2 Mac OS X setup

You will want to have Homebrew installed on your system to use minicom for serial communication as it is more convenient than using screen.

Note: Homebrew is a package manager for Mac - a piece of software that helps you install other software on your Mac machine, particularly software which is readily available on Linux but which does not come in the form of Mac "applications", which you can download via your web browser and simply drop into your Applications folder.

Open Terminal.app (or your preferred terminal emulator if you have another installed). Terminal can be found via e.g. Spotlight search or via the Finder menu: Go > Utilities > Terminal.app.

Check if you already have brew installed by entering the brew command:

$ brew

If you don't have Homebrew installed, your shell will reply with something like bash: command not found: brew. Otherwise, it will spit out a list of brew commands.


Installing Homebrew

To install Homebrew, go to the Homebrew website and follow the install instructions there. You can simply copy the command used for installing Homebrew from their website and paste it into your terminal.


Installing minicom

With brew installed, you want to install minicom:

$ brew install minicom 

Homebrew will tell you if you already have minicom installed on your system (e.g. Warning: minicom-2.7 already installed), otherwise it will install it for you.




2.2.2.3 minicom configuration

Once you have minicom installed, you need to configure it in order to talk to the camera. You can either use the configuration file we prepared or configure it yourself, following our step-by-step instructions.


Linux

Go to the minicom setup page:

$ minicom -s

In the "Serial port setup" subpage, check that "Serial Device" 's name is the good one (usually /dev/ttyUSB0 on Linux) and check the baud rate (115200).


Mac

Download the settings file for Mac, unzip it and place it in the etc directory of your minicom install.

The minicom installation can be found in the standard directory used by homebrew, /usr/local/Cellar, in a subdirectory based on the minicom version number, e.g. /usr/local/Cellar/minicom/2.7/etc .

You can also use Homebrew's info command to find minicom on your hard disk:

$ brew info minicom

which will output general information on the installed package, including its install directory e.g.:

minicom: stable 2.7 (bottled)
Menu-driven communications program
https://alioth.debian.org/projects/minicom/
/usr/local/Cellar/minicom/2.7 (17 files, 346.6K) *
  Poured from bottle on ...




2.2.3 Serial connection (via USB)

Note: You will not be able to use the terminal window you initiate the serial connection in for anything else (it needs to remain open while you access the camera), so it might make sense to open a separate window just for this purpose.




2.2.3.1 Connect using minicom

With minicom installed and properly configured, all you need to do is run the following command to start it with the correct settings:

$ minicom -8 USB0

On successful connection, you will be prompted to enter user credentials (which are needed to log into the camera).

If your terminal remains blank except for the minicom welcome screen/information about your connection settings, try pressing enter. If this still does not result in the prompt for user credentials – while testing, we discovered the initial connection with minicom does not always work – disconnect the camera from the power adapter, then reconnect it: in your minicom window you should now see the camera's operating system booting up, followed by the login prompt. (From then on, connecting with minicom should work smoothly and at most require you to press enter to make the login prompt appear.)

The default credentials are:

user: root
password: beta


Alternatives

Before you can use any tool to initiate a serial connection with your Beta camera you need to know through which special device file it can be accessed.

Once the Beta is connected and powered on (and you installed the necessary drivers), it gets listed as a USB device in the /dev directory of your file system, e.g.
/dev/ttyUSB0 (on Linux)
or
/dev/cu.SLAB_USBtoUART
/dev/tty.SLAB_USBtoUART (on Mac).

You can use a command such as:

$ ls -al /dev | grep -i usb

to list all USB devices currently connected to your machine.




2.2.3.2 Connect using screen

To connect to the camera, use the command:

$ screen file_path 115200

where file_path is the full path to the special device file (e.g. /dev/ttyUSB0 or /dev/cu.SLAB_USBtoUART).

You might have to run the command with superuser rights, i.e.:

$ sudo screen file_path 115200

On successful connection, you will be prompted to enter user credentials needed for logging into the camera.
If your terminal remains blank, try pressing enter.

The default credentials are:

user: root
password: beta




2.2.3.3 Disconnect

To exit the camera's operating system, use:

$ exit

The result will be a logout message followed by a new login prompt.

To suspend or quit your screen session (and return to your regular terminal window) use one of the following commands:

CTRL+a CTRL+z
CTRL+a CTRL+\




2.2.4 Ethernet connection (using SSH)

2.2.4.1 SSH Keys How to For Linux and Mac

To access the AXIOM Beta via Ethernet – which is the preferred way to communicate with it and will also work remotely, from a machine which is not directly connected to the camera – authentication via SSH is required.

If you have never created SSH keys before or need a refresher in order to create a new pair, see the How-to below.




2.2.4.1.1 Storage location / find existing keys

Mac & Linux

By default, the ssh directory is located at ~/.ssh, and contains key files called id_rsa and id_rsa.pub, respectively. Check if the directory exists and already contains keys by listing its contents:

$ ls -al ~/.ssh

If the directory doesn't exist or is empty and you don't have your SSH keys stored elsewhere on your machine, follow the instructions for key creation below.




2.2.4.1.2 SSH key creation

Linux machines as well as new Macs usually come pre-installed with the tools you need for creating SSH keys. To start the key creation process, use the command:

$ ssh-keygen -t rsa -b 4096 -C "yourname@yourmachine"

Note: The -C argument is used to add a comment which can help indentify your key as yours/your machine's, which might come in handy once you use other computers to connect to your Beta camera. If you leave it out, your default username/hostname will be used (you can check with $ echo "$(whoami)@$(hostname)" either beforehand or in another Terminal window to find out what it is), though you can always change the comment part again later on.


You will be prompted for a file in which to save the keys. To use the default install location (recommended), just press Enter.

Next, you will be asked to enter a passphrase. Using a passphrase means greater security, though you can continue without one by just pressing Enter. In either case you will be asked to confirm your passphrase (by re-entering it if you used one, or pressing Enter again in case you did not).

Subsequently, your keys will be created and saved in the directory you specified (~/.ssh by default). You can have your machine print out your public key for you by using the command:

$ cat ~/.ssh/id_rsa.pub

The output will look approximately like this:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCj8ZHA1ehuCwXvEzyG20Cv0SX1BZ9uyXvON4mDOJJHtG7WolOZG0QPYEPpNxUIFuuvYYl/ffNrV9v2cXyit28N28kqHprGlQK43r9poLACIU4BA6uFIFp5++tEsAiM0bCbQlExcZvxvQQONY8Slrl9/2kbEwFSnYdY9ORQxYsxB0gHAaDq8KFj6XQXZlyrLC46uoUDvF9DJOYmRBV/6gieWfPo3jaLS6S7mLICSB3jUK81ZD5D7IJrh1kifahmSyaui1kU4PxmmqdwPG8sFGhTsZTCavngYNzNaK1XhTeUppHblDuQUc6Z02K62Od6LMgk7khdrFlBrzpt5Yds3CztTiJ1PI1XKawhRLEMJe4ekXg+i+bz8vmuMiOrnzrK4U/GCs2a7pjx2mC4WBDd7xJKwYh9HMmLAT9l0VKH+BwEBJXq/0EqKDvMwpUn1h3HQey+Rcujf77IX+eSafyg762OKTRAniCSuhiH2jUWEzhj7cjTRIllxwXOBUUS6FtUYBUQ/sBE3bMmY85VMyF+6z6iiep7VZ9vBMNJtuol2k1wKsrrD3Finynr8gPqO2ghjK+ZvkxjgYANvV+gSvWVo2R8H1FUGA2pJegEkFNKONCyyd6xMWR5loh9NkG0UQpSk95kJH2q0QbaCrxLdPqqGY6UWp1zbXNMk33FeBv0XjjI+w== anne@farragut

Note that in newer Ubuntu versions (tested with 16.04) it seems that the newly created key is not loaded by the keyserver until you manually run:

$ ssh-add




2.2.4.2 Get/set IP address

If your network has a DHCP server running somewhere (eg. router) the AXIOM Beta will receive an IP address automatically as soon as it is connected the network.

Otherwise, you will have to set the Beta's IP address manually with the ifconfig command over the serial console (USB).




2.2.4.3 IP address check

While connected to the AXIOM Beta via USB, you can use the command:

$ ip a l

... to check whether the Beta is currently assigned an IP address. Find the entry which begins with eth0 and check if it contains a line starting with inet followed by an IP address. If it does, this is the IP address the Beta can be reached at.

Example output with no IP address assigned:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0a:35:00:01:26 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::20a:35ff:fe00:126/64 scope link 
       valid_lft forever preferred_lft forever




2.2.4.4 Set IP address

If the IP address check is not successful – in that it does not produce an IP address you can connect to – you will have to set your Beta's IP address manually with the ifconfig command.

While connected to the Beta, you can do that like so:

$ ifconfig eth0 192.168.0.9/24 up

It does not really matter which IP address you choose as long as it is one allowed for private use (e.g. addresses in the 192.168.x.x range) and you make sure to use the /24 prefix. Note that this will set the IP only until you reboot the camera - then the IP has to be set this same way. A more permanenty solution is using a router and connecting your camera and computer. Then the router assigns IPs using DHCP automatically.

If you now use $ ip a l (again) to check for the camera's IP address, you should see the address you assigned listed after inet, e.g.:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0a:35:00:01:26 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.9/24 brd 192.168.0.255 scope global dynamic eth0
       valid_lft 172739sec preferred_lft 172739sec
    inet6 fe80::20a:35ff:fe00:126/64 scope link 
       valid_lft forever preferred_lft forever




2.2.4.5 Establish a connection via Key

Now we have the network configured we need to copy over our SSH key to the Beta.

While connected to the AXIOM Beta via USB, you can use the command:

cd ~/.ssh/
cp authorized_keys authorized_keys.orig

Strictly speaking the cp (copy) command isn't needed, but it's best practice to always make a copy of a file before editing it - just in case.

The next command will be to add your SSH key to the SSH file which contains the information on who can log into it via SSH without a password.

You will need to first copy (control/command c) - IMPORTANT, make sure that you copy the whole key but do not include the next/new line.

Next, with the command below, you will add your key to the authorized_keys file. The structure of the command below is:

  • echo - writes the text after it
  • [your key] - pastes (control/command v) your key, so do not type in [your key]!
  • > - overwrites the existing file and adds just this text
  • authorized_keys - make sure to spell this correctly.

As a heads-up when you paste in your SSH key the terminal window may wrap the text in a way that it looks like a bit of a mess - this is normal and you can then carry on typing in the rest of the command.

echo [yourkey] >> authorized_keys

Alternatively, you can use ssh-copy-id to do it. Don't forget to adapt the IP adress.

ssh-copy-id root@192.168.0.9

Now you have added you key you can then try and ssh into the Beta.

On your computer use the following command - note the IP address will be the one you set earlier, the one used below is just the example IP.

ssh root@192.168.0.9

You should now see the following prompt if you have logged on successfully to the Beta.

Last login: Fri Jun 10 15:12:17 2016
sourcing .bashrc ...
[root@beta ~]# 

Congratulations, you have now set up the Beta's networking and SSH configuration.

The minicom or screen method you used to connect is no longer needed.




2.2.4.6 Password Based Authentication

If you do not want to use the public/private keypair authentication you can edit /etc/ssh/sshd_config and set

PasswordAuthentication yes
PermitRootLogin yes

Note: This has the potential to be a security vulnerability (especially if you do not change the default credentials) and connect your Beta directly to the Internet.




2.2.5 Start the camera

As development of the Beta continues the camera will initialize all systems and train the sensor communication automatically when powered on, but for now you will have to manually start this yourself.

Run the following command:

./kick_manual.sh

You will see a lot of output, the tail of it is below.

..
mapped 0x8030C000+0x00004000 to 0x8030C000.
mapped 0x80000000+0x00400000 to 0xA6961000.
mapped 0x18000000+0x08000000 to 0x18000000.
read buffer = 0x18390200
selecting RFW [bus A] ...
found MXO2-1200HC [00000001001010111010000001000011]
[root@beta ~]# 

If you look at the back of the camera you will now see a blue LED near the top flashing very fast - this indicates everything is now running.

If you turn the camera off when you turn it back on you will need to re-run this command.




Beta-wifi.jpg

2.2.6 WiFi Access Point Setup

Connecting a USB wifi dongle (that supports Soft-AP) to the AXIOM Beta USB port allows controlling the camera via wireless connection

Check your wifi card:

ifconfig

Turn on wifi card:

ifconfig wlan0 up

Search wifi essid/hotspot name:

iwlist wlan0 scan

Setting up Essid and password:

WEP

iwconfig wlan0 essid "yourhotspotname" key yourpassword 

ASCII

iwconfig wlan0 essid "yourhotspotname" key s:asciikey 

WPA2 (tested and working) update mirrors database (it is required to connect to the Internet via Ethernet):

pacman -Syy 

install wpa_supplicant:

pacman -S wpa_supplicant

Configuration with wpa_passphrase - https://wiki.archlinux.org/index.php/WPA_supplicant create basic configuration file MYSSID = name of your wireless network passphrase = password to connect to your wireless network

wpa_passphrase MYSSID passphrase > /etc/wpa_supplicant/example.conf
ip link set dev wlan0 up
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/example.conf

if nl80211 driver does not support the given hardware. The deprecated wext driver might still support the device:

wpa_supplicant -B -i wlan0 -D wext -c /etc/wpa_supplicant/example.conf
dhcpcd wlan0

Autostart connect https://wiki.archlinux.org/index.php/netctl copy config from example:

cp /etc/netctl/example/wireless-wpa /etc/netctl/wireless-wpa

edit the config for you network (interface/ESSID/key):

nano /etc/netctl/wireless-wpa

First manually check that the profile can be started successfully with:

netctl start wireless-wpa 

If the above command results in a failure, then use

journalctl -xn 
netctl status profile 

to obtain a more in depth explanation of the failure. (profile might already been started)

Enable:

netctl enable wireless-wpa

This will create and enable a systemd service that will start when the computer boots. Changes to the profile file will not propagate to the service file automatically. After such changes, it is necessary to reenable the profile:

netctl reenable wireless-wpa




3 Writing Images

3.1 Capture Still Images

For writing uncompressed full resolution full bitdepth raw image the AXIOM Beta uses a software called cmv_snap3.

It is located in the /root/ directory and writes the images data directly to STDOUT.

cmv_snap3 writes images in the RAW12 format. Writing one image takes a few seconds depending on where the image is written to so this method is not viable for recording video footage other than timelapse.




3.1.1 Parameters

The following parameters are available:

./cmv_snap3 -h
This is ./cmv_snap3 V1.10
options are:
-h        print this help message
-8        output 8 bit per pixel
-2        output 12 bit per pixel
-d        dump buffer memory
-b        enable black columns
-p        prime buffer memory
-r        dump sensor registers
-t        enable cmv test pattern
-z        produce no data output
-e <exp>  exposure times
-v <exp>  exposure voltages
-s <num>  shift values by <num>
-S <val>  writer byte strobe
-R <fil>  load sensor registers


Examples

Images can be written directly to the cameras internal micro SD card like this (10 milliseconds exposure time, 16bit):

./cmv_snap3 -e 10ms > image.raw16

Write image plus metadata (sensor configuration) to cameras internal micro SD card (20 milliseconds exposure time, 12bit):

./cmv_snap3 -2 -r -e 20ms > image.raw12

You can also use cmv_snap3 to change to exposure time (to 5 milliseconds in this example) without actually capturing an image, for the that -z parameter is used to not produce any data output:

./cmv_snap3 -z -e 5ms


That cmv_snap3 writes data to STDOUT makes it very versatile, we can for example capture images from and to a remote Linux machine connected to the Beta via Ethernet easily (lets assume the AXIOM Betas camera IP is set up as: 192.168.0.9 - SSH access has to be set up for this to work with a keypair)

ssh root@192.168.0.9 "./cmv_snap3 -2 -r -e 10ms" > snap.raw12

To pipe the data into a file and display it at the same time with imagemagick on a remote machine:

ssh root@192.168.0.9 "./cmv_snap3 -2 -r -e 10ms" | tee snap.raw12 | display -size 4096x3072 -depth 12 gray:-

Use imagemagick to convert raw12 file into a color preview image:

cat test.raw12 | convert \( -size 4096x3072 -depth 12 gray:- \) \( -clone 0 -crop -1-1 \) \( -clone 0 -crop -1+0 \) \( -clone 0 -crop +0-1 \) -sample 2048x1536 \( -clone 2,3 -average \) -delete 2,3 -swap 0,1 +swap -combine test_color.png

With raw2dng compiled inside the camera you can capture images directly to DNG, without saving the raw12:

./cmv_snap3 -2 -b -r -e 10ms | raw2dng snap.DNG

Note: Supplying exposure time as parameter is required otherwise cmv_snap3 will not capture an image. The exposure time can be supplied in "s" (seconds), "ms" (milliseconds), "us" (microseconds) and "ns" (nanoseconds). Decimal values also work (eg. "15.5ms").




3.2 Image Overlays

This section covers the mimg version 1.8 (see https://github.com/apertus-open-source-cinema/beta-software/tree/master/mimg), not the previous 1.6.

AXIOM Beta features a full HD framebuffer that can be altered from the Linux userspace and is automatically "mixed" with the real time video from the image sensor on HDMI outputs.

The overlay could also be used to draw live histograms/scopes/HUD or menus.

The overlay in more recent firmware revisions supports alpha channel transparency.




3.2.1 Internals

The raw memory image is saved the following way: <ch0/12bit><ch1/12bit><ch2/12bit><ch3/12bit><overlay/16bit>

That means for every 4 sensels there is only one overlay pixel. Meaning while the CMV12000 image sensor is 4Kx3K the overlay is Full HD (1080p).




3.2.2 Prepare Images

Convert 24bit PNG (1920x1080 pixels) with transparency to AXIOM Beta raw format:

convert input.png rgba:output.rgb

Note: This image format is different from RAW12 (See Section 8)




3.2.3 mimg

mimg is software running on the camera that's used to load/alter anything related to overlays or test images.

Source Code: https://github.com/apertus-open-source-cinema/beta-software/tree/master/mimg

This is ./mimg V1.8
options are:
-h        print this help message
-a        load all buffers
-o        load as overlay
-O        load as color overlay
-r        load raw data
-w        use word sized data
-D <val>  image color depth
-W <val>  image width
-H <val>  image height
-P <val>  uniform pixel color
-T <val>  load test pattern
-B <val>  memory mapping base
-S <val>  memory mapping size
-A <val>  memory mapping address


Examples

clear overlay:

./mimg -a -o -P 0

load monochrome overlay:

./mimg -o -a file.raw

load color overlay:

./mimg -O -a file.raw

enable overlay:

gen_reg 11 0x0104F000

disable overlay:

gen_reg 11 0x0004F000


Old overlays

Overlays for mimg 1.6 are not compatible anymore. You can use

convert -size 1920x1080 -depth 6 rgba:overlay_04.rgb overlay_04.png

... to convert them to PNG before continuing with the preparation above.




4 Changing Camera Parameters

4.1 cmv_reg

Get and Set CMV12000 image sensor registers (CMV12000 sports 128x16 Bit registers).

Details are in the sensor datasheet: https://github.com/apertus-open-source-cinema/beta-hardware/tree/master/Datasheets

Examples:

Read register 115 (which contains the analog gain settings):

cmv_reg 115

Return value:

0x00

Means we are currently operating at analog gain x1 = unity gain

Set register 115 to gain x2:

cmv_reg 115 1




4.2 Setting Exposure Time

To set the exposure time use the cmv_snap3 tool with -z parameter (this will tell the software to not save the image):

./cmv_snap3 -e 9.2ms -z

Note: The exposure time can be supplied in "s" (seconds), "ms" (milliseconds), "us" (microseconds) and "ns" (nanoseconds). Decimal values also work (eg. "15.5ms").




4.3 Setting Gain Values

set_gain.sh

Set gain and related settings (ADC range and offsets).

./set_gain.sh 1 
./set_gain.sh 2
./set_gain.sh 3/3 # almost the same as gain 1
./set_gain.sh 3
./set_gain.sh 4
./set_gain.sh 1 **J
./set_gain.sh 2 **J
./set_gain.sh 3/3 # almost the same as gain 1 **J
./set_gain.sh 3 **J
./set_gain.sh 4 **J




4.4 Setting Gamma Values

gamma_conf.sh

Set the gamma value:

./gamma_conf.sh 0.4
./gamma_conf.sh 0.9
./gamma_conf.sh 1
./gamma_conf.sh 2




5 Image metadata

The RAW12 is designed to contain native raw image sensor data for images written by the AXIOM Beta and can optionally also contain an image sensor registers dump (128 x 16bit, big endian) appened at the end of file.

The -r command indicates to include the sensor registers when capturing an image (See Section Capture Still Images):

./cmv_snap3 -r -e 10ms > image.raw12

Show metadata from a RAW12 file (without converting it):

raw2dng file.raw12 --dump-regs

or, with metadatareader: https://github.com/apertus-open-source-cinema/misc-tools-utilities/tree/master/cmv12000-metadata-reader

cat image.raw12 | dd bs=256 skip=73728 | ./metadatareader

Details about the meaning of all image sensor registers can be found in the image sensor datasheet: https://github.com/apertus-open-source-cinema/beta-hardware/tree/master/Datasheets




5.1 Image Histogram Data

To read and output histogram data from the Beta's live image a tool called cmv_hist3 is available inside the AXIOM Beta.

./cmv_hist3 -h                                                   

This is ./cmv_hist3 V1.4

Options are:

-h        print this help message                                               
-s        acquire snapshot                                                      
-b <num>  number of bins                                                        
-d <num>  decimation factor                                                     
-r <num>  number of rows                                                        
-C <prc>  center sample area                                                    
-B <val>  register mapping base                                                 
-S <val>  register mapping size

The output in 12 bit mode (default) are values in 4096 lines and 4 columns (R, G, B, GB channels)




6 Output

ToDo - Intro text

6.1 HDMI

HDMI is a two-way communication protocol and supports a ton of different formats/frequencies/specs. Many monitors/recorders only support a subset of these formats and expect signals to conform to certain values. These values are not documented publicly so we are currently in the process of debugging device compatibility one by one. The good thing is that its a pure software thing and we can add support and test compatibility with additional devices as we go.

In general we discovered that monitors are more flexible when it comes to HDMI (TMDS) freqencies as they just "tune" into (sync to) the provided clock/data rate. Recorders expect signals to be in a much more stricter/narrow range and will not work (show "no signal") if there is a minor deviation.

Watch this 33C3 talk by Tim Ansell about "Discecting HDMI": https://media.ccc.de/v/33c3-8057-dissecting_hdmi to get insight into how HDMI works.




6.1.1 External HDMI Recording

Settings for VSync, HSync, etc. inside the AXIOM Beta can be found in:

/root/gen_init.sh

For example the Atomos SHOGUN was found to work with these HDMI parameters:

scn_reg  0 2200             # total_w
scn_reg  1 1125             # total_h
scn_reg  2   60             # total_f

scn_reg  4  262             # hdisp_s
scn_reg  5 2182             # hdisp_e
scn_reg  6   45             # vdisp_s
scn_reg  7 1125             # vdisp_e

scn_reg  8    0             # hsync_s
scn_reg  9 2100             # hsync_e
scn_reg 10    4             # vsync_s
scn_reg 11    9             # vsync_e

scn_reg 32  252             # pream_s
scn_reg 33  260             # guard_s
scn_reg 34  294             # terc4_e
scn_reg 35  296             # guard_e

Currently it is not possible to alter TMDS and Clock frequencies from the userspace (requires new FPGA bitstream).

For the firmware there are two modes available, the 30Hz and 60Hz variant. You can switch between them quite easily.

cmv_hdmi3.bit is the FPGA bitstream loaded for the HDMI interface. We use symlinks to switch this file easily.

Before doing this, don't forget to check if the files (cmv_hdmi3_60.bit or cmv_hdmi3_30.bit) really exist in the /root folder.

The output is always in 8bpc RGB color space without subsampling (4:4:4). Not all capture devices can manage this.

Other modes like YCrCb, etc. are currently not supported.




6.1.1.1 Devices Confirmed Working

Atomos Shogun

AXIOM Beta supports up to 1080p60


Atomos Ninja

AXIOM Beta supports up to 1080p30

Blackmagic Video Assist


Blackmagic Video Assist and Video Assist 4K

AXIOM Beta supports up to 1080p60


Changes for Blackmagic Video Assist and Video Assist 4K, tested on firmware 2.3.1:

edit setup.sh

Add:

./gen_init.sh 1080p60BMVA

comment out any other ./gen_init.sh entries.


edit gen_init.sh

Replace:
  SHOGUN)
With:
  SHOGUN|1080p60BMVA|1080p30BMVA)

Add the section below:
  1080p50BMVA|1080p25BMVA)
    scn_reg  0 2640             # total_w
    scn_reg  1 1125             # total_h
    scn_reg  2   60             # total_f

    scn_reg  4  262             # hdisp_s
    scn_reg  5 2182             # hdisp_e
    scn_reg  6   45             # vdisp_s
    scn_reg  7 1125             # vdisp_e

    scn_reg  8    0             # hsync_s
    scn_reg  9 2100             # hsync_e
    scn_reg 10    4             # vsync_s
    scn_reg 11    9             # vsync_e

    scn_reg 32  252             # pream_s
    scn_reg 33  260             # guard_s
    scn_reg 34  294             # terc4_e
    scn_reg 35  296             # guard_e
    ;;

  1080p24BMVA)
    scn_reg  0 2750             # total_w
    scn_reg  1 1125             # total_h
    scn_reg  2   60             # total_f

    scn_reg  4  262             # hdisp_s
    scn_reg  5 2182             # hdisp_e
    scn_reg  6   45             # vdisp_s
    scn_reg  7 1125             # vdisp_e

    scn_reg  8    0             # hsync_s
    scn_reg  9 2100             # hsync_e
    scn_reg 10    4             # vsync_s
    scn_reg 11    9             # vsync_e

    scn_reg 32  252             # pream_s
    scn_reg 33  260             # guard_s
    scn_reg 34  294             # terc4_e
    scn_reg 35  296             # guard_e
    ;;

6.1.2 Experimental UHD Raw Recording

6.1.2.1 Enable raw Recording Mode

6.1.2.2 Processing