Avid Diamond Platform

From musings of k8
Revision as of 22:30, 14 December 2020 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Avid devices including the Diamond Platform embedded Linux controller include: - Avid E3 Engine - Avid E6 Engine - Avid Stage 16 - Avid Stage 64

This controller connects to all of the ADC (Analog to Digital Converters), and runs the `avbd` daemon, which provides AVB connectivity. The `avdecc` and `diag` commands are used for configuring the ADCs.

Both the E3 Engine and the Stage16 contain this Linux device.

    1. Overview
      1. Hardware

Hardware

Processor
ARMv7 Processor rev 2 (v7l)
BogoMIPS
719.25
Hardware
Diamond
RAM
256M
      1. Operating system

The OS is Linux, and looks to be named "Bonanza Green Salamander". On the S3L-X 4.6.1.4 release this OS version is 1.2.0.152.

      1. Networking

This controller provides two Ethernet interfaces, `eth0` and `eth0:avahi` (a virtual interface managed by `avahi-daemon`).

The `eth0:avahi` interface has a link-local address that is available even though the `eth0` interface, and is accessible using the address `diamondXXXX.local`, where `XXXX` is replaced by the hex characters of the last two octets of the system MAC address.

    1. OS
    • uname -a**

```

  1. uname -a

Linux DiamondF7E0 2.6.37 #1 Wed Jan 10 06:10:38 PST 2018 armv7l GNU/Linux ```


    • /etc/version** – Linux version

```

  1. cat /etc/version

Bonanza Green Salamander 1.2.0.152 ```


    • /proc/cpuinfo**

```

  1. cat /proc/cpuinfo

Processor : ARMv7 Processor rev 2 (v7l) BogoMIPS : 719.25 Features : swp half fastmult vfp edsp neon vfpv3 CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x3 CPU part : 0xc08 CPU revision : 2

Hardware : Diamond Revision : 0000 Serial : 0000000000000000 ```


    • /proc/meminfo**

```

  1. cat /proc/meminfo

MemTotal: 256016 kB MemFree: 216372 kB Buffers: 1016 kB Cached: 27192 kB SwapCached: 0 kB Active: 29984 kB Inactive: 1036 kB Active(anon): 3996 kB Inactive(anon): 0 kB Active(file): 25988 kB Inactive(file): 1036 kB Unevictable: 0 kB Mlocked: 0 kB SwapTotal: 0 kB SwapFree: 0 kB Dirty: 0 kB Writeback: 0 kB AnonPages: 2828 kB Mapped: 4288 kB Shmem: 1184 kB Slab: 6224 kB SReclaimable: 3204 kB SUnreclaim: 3020 kB KernelStack: 480 kB PageTables: 344 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 128008 kB Committed_AS: 75812 kB VmallocTotal: 647168 kB VmallocUsed: 17620 kB VmallocChunk: 622588 kB ```


    • /proc/version**

```

  1. cat /proc/version

Linux version 2.6.37 (mir@audiofw-us-server0) (gcc version 4.8.1 (Sourcery CodeBench Lite 2013.11-33) ) #1 Wed Jan 10 06:10:38 PST 2018 ```


    • df -h**

```

  1. df -h

Filesystem Size Used Available Use% Mounted on /dev/root 12.0M 6.4M 5.6M 54% / tmpfs 61.4M 252.0K 61.2M 0% /tmp tmpfs 61.4M 0 61.4M 0% /dev tmpfs 61.4M 0 61.4M 0% /dev/shm tmpfs 61.4M 252.0K 61.2M 0% /etc ```


    • hostname**

```

  1. hostname

DiamondF7E0 ```


    • ifconfig -a**

```

  1. ifconfig -a

eth0 Link encap:Ethernet HWaddr 84:7E:40:E5:F7:E0

         inet addr:10.0.1.6  Bcast:10.0.1.255  Mask:255.255.255.0
         inet6 addr: fe80::867e:40ff:fee5:f7e0/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:127849856 errors:0 dropped:0 overruns:0 frame:0
         TX packets:127746073 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000 
         RX bytes:1840653429 (1.7 GiB)  TX bytes:1901257965 (1.7 GiB)

eth0:avahi Link encap:Ethernet HWaddr 84:7E:40:E5:F7:E0

         inet addr:169.254.12.234  Bcast:169.254.255.255  Mask:255.255.0.0
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

lo Link encap:Local Loopback

         inet addr:127.0.0.1  Mask:255.0.0.0
         inet6 addr: ::1/128 Scope:Host
         UP LOOPBACK RUNNING  MTU:16436  Metric:1
         RX packets:9 errors:0 dropped:0 overruns:0 frame:0
         TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:0 
         RX bytes:972 (972.0 B)  TX bytes:972 (972.0 B)

sit0 Link encap:IPv6-in-IPv4

         NOARP  MTU:1480  Metric:1
         RX packets:0 errors:0 dropped:0 overruns:0 frame:0
         TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:0 
         RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

```


    • lsmod**

```

  1. lsmod

Module Size Used by Not tainted carbonui_flash_qe 1329 0 carbonui_program 2245 0 carbonreario 3097 0 carbonreario_bosb 9655 0 carbonreario_boer 4531 0 carbonreario_generic 1355 1 carbonreario carbonio 10445 0 carbonio_aes4x4 19459 0 carbonio_adc8 24052 0 carbonio_adc4 16412 0 carbonio_dac8 7034 0 carbonio_dac4_single 5986 0 carbonio_dac4 9842 0 carbonio_bo_sb_mb 4099 0 carbonio_bo_surf_reartwo 7045 0 carbonio_bo_surf_reario 7722 0 carbonio_generic 1523 1 carbonio carbonio_mute 1867 7 carbonreario_bosb,carbonreario_boer,carbonio_aes4x4,carbonio_dac8,carbonio_dac4_single,carbonio_bo_sb_mb,carbonio_bo_surf_reario carbonio_nconfig 3939 1 carbonio_aes4x4 cs4272 11652 0 logicalio 9510 9 carbonreario_bosb,carbonreario_boer,carbonio_adc8,carbonio_adc4,carbonio_dac8,carbonio_dac4_single,carbonio_dac4,carbonio_bo_surf_reario,cs4272 lm63 7758 0 avb_emac 76091 0 ```


    • lspci**

```

  1. lspci

lspci: /sys/bus/pci/devices: No such file or directory ```

    • lsusb**

```

  1. lsusb -v

Bus 001 Device 001: ID 1d6b:0002 Bus 002 Device 001: ID 1d6b:0002

From http://www.linux-usb.org/usb.ids: 1d6b Linux Foundation 0001 1.1 root hub 0002 2.0 root hub 0003 3.0 root hub 0100 PTP Gadget 0101 Audio Gadget 0102 EEM Gadget 0103 NCM (Ethernet) Gadget 0104 Multifunction Composite Gadget 0105 FunctionFS Gadget 0200 Qemu Audio Device ```


    • netstat -an**

```

  1. netstat -an

Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:45641 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:23 0.0.0.0:* LISTEN tcp 0 0 169.254.12.234:23 169.254.219.148:55078 ESTABLISHED tcp 0 0 169.254.12.234:45641 169.254.181.43:49220 ESTABLISHED udp 0 0 0.0.0.0:47166 0.0.0.0:* udp 0 0 0.0.0.0:5353 0.0.0.0:* ```


    • ps**

```

  1. ps
 PID USER       VSZ STAT COMMAND
   1 root      2924 S    init
   2 root         0 SW   [kthreadd]
   3 root         0 SW   [ksoftirqd/0]
   4 root         0 SW   [kworker/0:0]
   6 root         0 SW<  [khelper]
   7 root         0 SW   [irq/72-serial i]
   8 root         0 SW   [irq/73-serial i]
   9 root         0 SW   [irq/74-serial i]
  10 root         0 SW   [irq/44-serial i]
  11 root         0 SW   [irq/45-serial i]
  12 root         0 SW   [sync_supers]
  13 root         0 SW   [bdi-default]
  14 root         0 SW<  [kblockd]
  15 root         0 SW<  [omap2_mcspi]
  16 root         0 SW   [khubd]
  17 root         0 SW   [kseriod]
  18 root         0 SW<  [kmmcd]
  19 root         0 SW<  [musb-hdrc.0]
  20 root         0 SW<  [musb-hdrc.1]
  21 root         0 SW<  [rpciod]
  22 root         0 SW   [gatekeeper/0]
  23 root         0 SW   [kworker/0:1]
  24 root         0 SW   [kswapd0]
  25 root         0 SW   [fsnotify_mark]
  26 root         0 SW<  [aio]
  27 root         0 SW<  [nfsiod]
  28 root         0 SW<  [crypto]
  35 root         0 SW<  [spi_gpio.5]
  36 root         0 SW<  [usbhid_resumer]
  37 root         0 SW   [kworker/u:1]
  38 root         0 SW   [mmcqd/0]
  39 root         0 SW   [kjournald]
  45 root         0 SW   [kjournald]
  68 root      2924 S    /sbin/syslogd -m 0
  70 root      2924 S    /sbin/klogd
  92 dbus      2580 S    dbus-daemon --system
  98 root         0 SW   [logicalio]
 189 root         0 SW   [kworker/u:2]
 228 root      1936 S    /usr/bin/linkwatcher
 233 root      2160 S    /usr/bin/mstpd
 255 default   2048 S    avahi-autoipd: [eth0] bound 169.254.12.234
 256 root      1960 S    avahi-autoipd: [eth0] callout dispatcher
 266 root      3920 S <  /usr/bin/switchd2
 276 root      3012 S    /usr/sbin/inetd /etc/inetd.conf
 281 default   3152 S    avahi-daemon: registering [DiamondF7E0.local]
 286 root      4912 S <  /usr/bin/avbd -p -x -l /opt/etc/avdecc_layout.xml
 295 root      2928 S    /sbin/getty -L ttyO0 115200 vt100
 296 root     77068 S    bonanzafw --boer -L 31 -R 1 -B 2048 -K 2 -F /tmp/BonanzaER.log
 316 root      2924 S    udhcpc -R -b -t6 -T1 -p /var/run/udhcpc.eth0.pid -i eth0
 357 root      3020 S    telnetd -i
 358 root      3016 S    -sh
1255 root      3016 R    ps

```

    1. Web server

This controller is running a BusyBox web server on port 80 via inetd.

```

  1. grep http /etc/inetd.conf

http stream tcp nowait root /usr/sbin/httpd httpd -i -h/www ```

    1. AVB
    • /proc/avb**

```

  1. cat /proc/avb

AVB general settings:

       Sample rate:    48000 Hz
       Sync source:    Internal 
       Global PTO:     750000 ns

AVB RT subsystem:

       AVB avg cyc:    8687 / 12 us
       AVB max cyc:    12324 / 17 us
       Total cyc:      89960 / 124 us
       CPU time:       9 %
       QDMA time:      1 us
       Num late IRQ:   0
       Min IRQ delta:  120 us
       Max IRQ delta:  130 us
       Rem QDMA slots: 363

AVB TX Timestamping:

       Detected rate:  48003 Hz
       TS delta avg:   166661 ns
       TS max err:     25 ns

AVB RX Timestamping:

       TS delta avg:   166670 ns
       TS max err:     1979 ns

AVB TX Streams: 3 active streams with 72 channels total

Entry Type Stream ID nCh DMA PTO ns Forced DMA fail

(0) 0 847e40e5f7e20000 8 64 2000000 * 0 (1) 0 847e40e5f7e10000 32 64 2000000 * 0 (2) 0 847e40e5f7e10001 32 96 2000000 * 0

AVB RX Streams: 3 active streams with 72 mapped channels total

Entry Type Stream ID sync nCh Phase state src Relax Miss Late Exc Seq Slip Avg Min

                                               deg                                                                     us      us

(0) 0 0001f20035e60000 8 -180 NSTART 0 0 0 0 0 0 0 2666 (1) 0 38c98645b3ff0000 32 52 RUN 1 0 0 0 0 0 106 1940 1938 (2) 0 38c98645b3ff0001 32 52 RUN 1 0 0 0 0 0 106 1828 1813 ```


    1. Quartz

Configure INSA for Audio IO. From `/usr/sbin/avb_dd_io.sh` (as `/opt/etc/routing_layout.sh`).

``` diag -quartz write 0xc00 0x501 ```

Load quartz routing file.

``` diag -quartz loadpre /lib/rt/Bonanza/Stage16.rt ```

[Un]mute IO boards – change will be reflected within Avid VENUE

``` diag -iomute 0 # unmute diag -iomute 1 # mute ```


    1. Devices
      1. /sys/bus/i2c/devices

Device numbers:

1 (bus 1)
generic
4 (bus 4)
carbonui

The `i2c*` commands don't seem to work on the carbonui devices.

      1. carbonio (/sys/bus/spi/devices)

carbonio is a Linux module that directly controls the audio I/O devices.

Audio settings that can be controlled: - Gain - Pad - Phase - Mute - Phantom

Non-audio settings that can be controlled: - LEDs on the Avid Stage 16 - The opamp (operational amplifier) for each channel.


`/sys/bus/spi/devices`

Device overview:

spi1.[0-8]
channel gain and pad
spi2.[0-3]
unknown
spi3.[0-2]
unknown
spi4.0
power, mute, phantom, and status LEDs

The `_en` extension on some files represents "enable".

| Directory | File | modalias | Description | | ---------- | --------------- | ---------------- | ----------- | | spi1.[0-3] | | carbonio_adc4 | mic inputs (\*1) | | | chX_pad_en | | pad -- 0=off, 1=on | | | chX_preamp_gain | | gain -- 1-51 (10.0-60.0 dB) (\*2) | | spi1.[4-5] | | carbonio_dac4 | line outputs (\*1) | | | chX_attenuation | | | | | chX_mute | | mute -- 0=off, 1=on | | | opamp_en | | | | | phase_invert | | | | spi1.6 | | carbonio_aes4x4 | aes outputs | | spi1.7 | | spidev | | | spi1.8 | | cs4272 | | | spi2.[0-3] | | spidev | | | spi3.[0-2] | | carbonui-s6-spi | | | spi4.0 | LED indicators | carbonreario_bosb | | | | adc0_phantom_en | | 0-15 (binary) / Ch 8 - Ch 5 Phantom | | | adc1_phantom_en | | 0-15 (binary) / Ch 4 - Ch 1 Phantom | | | adc2_phantom_en | | 0-15 (binary) / Ch 12 - Ch 9 Phantom | | | adc3_phantom_en | | 0-15 (binary) / Ch 16 - Ch 13 Phantom | | | mute_led_en | | 0,1 (off, on) / Mute LED | | | status_led_0_en | | 0-2 (off, orange, green) / Status LED | | | status_led_1_en | | 0-2 (off, orange, green) / Power LED |

    • (\*1)** Each directory controls a bank of 4 channels. The directory 0 or 4: Ch 8-5, 1 or 5: Ch 4-1, 2: Ch 12-9 3: Ch 16-13). E.g., `spi1` channel #1 == `spi1.1/ch3_*`. **NOTE:** Changing file values directly will not be reflected in the VENUE UI.
    • (\*2)** The `preamp_gain` values are set to 0 before the device is first initialized by the E3 Engine.
    • /usr/bin/carbonui-util.sh**

This command seems to control the LEDs on the Avid S3 console using the `/sys/kernel/carbonui/oled` interface.

    • /usr/bin/carbonio-dump.sh**

This command dumps the values of the IO board devices in `/sys/bus/spi/devices`.

```

  1. carbonio-dump.sh

]]] slot spi1.0 ]]] board ID: 0x6 ]]] board rev: 0x0 ]]] ch0_overload: 0 ]]] ch0_pad_en: 0 ]]] ch0_preamp_gain: 1 ]]] ch1_overload: 0 ]]] ch1_pad_en: 0 ]]] ch1_preamp_gain: 1 ]]] ch2_overload: 0 ]]] ch2_pad_en: 0 ]]] ch2_preamp_gain: 1 ]]] ch3_overload: 0 ]]] ch3_pad_en: 0 ]]] ch3_preamp_gain: 1 ... ```

```

  1. ls -R spi1.0/

spi1.0/ spi1.0/uevent spi1.0/modalias spi1.0/subsystem spi1.0/power spi1.0/power/wakeup spi1.0/power/runtime_status spi1.0/power/control spi1.0/power/runtime_suspended_time spi1.0/power/runtime_active_time spi1.0/power/autosuspend_delay_ms spi1.0/driver spi1.0/board_id spi1.0/board_revision spi1.0/ch0_preamp_gain spi1.0/ch0_overload spi1.0/ch0_pad_en spi1.0/ch1_preamp_gain spi1.0/ch1_overload spi1.0/ch1_pad_en spi1.0/ch2_preamp_gain spi1.0/ch2_overload spi1.0/ch2_pad_en spi1.0/ch3_preamp_gain spi1.0/ch3_overload spi1.0/ch3_pad_en ```

```

  1. ls -R spi4.0/

spi4.0/ spi4.0/uevent spi4.0/modalias spi4.0/subsystem spi4.0/power spi4.0/power/wakeup spi4.0/power/runtime_status spi4.0/power/control spi4.0/power/runtime_suspended_time spi4.0/power/runtime_active_time spi4.0/power/autosuspend_delay_ms spi4.0/driver spi4.0/board_id spi4.0/board_revision spi4.0/ins_a_board_present spi4.0/ins_b_board_present spi4.0/mute_n spi4.0/mute_led_en spi4.0/status_led_0_en spi4.0/status_led_1_en spi4.0/dac0_mute_n spi4.0/dac1_mute_n spi4.0/adc0_phantom_en spi4.0/adc1_phantom_en spi4.0/adc2_phantom_en spi4.0/adc3_phantom_en ```


    1. Commands
      1. diag

This command configures the ADC for the E3 signals.

```

  1. diag
       Version 3.02  2014-Apr-17
       Options:
       -testall        Run All Tests
       -loop           Loop Individual Test
       -loopsuite      Loop Test Suite
       -avbloop        AVB Loopback Tests
       -i2c            I2C Test
       -ins            InS Test
       -quartz         Quartz Tests
       -spi            SPI Test
       -uart           UART Test
       -usb            USB Test
       -insboard       InS Board Test
       -boardrev       Board Rev Utility
       -aesloop        AES Loopback Test
       -usbutil        USB Utilities
       -ethtest        Ethernet Test
       -mixer          Mixer Utility
       -ext            Ext Sync Test
       -iomute         IO Card Mute
       -fifoloop       Quartz FIFO InS Loop Test
       -miscutils      Miscellaneous Utilities
       -codec          Codec Utility
       I/O Card Mute:  unmute
       Quartz Mute:    unmute

```