Streaming Services

Streaming services are the mechanism by which users, over the internet, can listen to and watch the Vinophonics device in action. Many options are available.

ADC hardware

The Raspberry Pi 4 in vinophonics does not provide any audio input to enable streaming.  The HiFiBerry DAC+ ADC hat is added for audio input on the Pi:

The HiFiBerry DAC+ ADC is a high-resolution digital-to-analog and analog-to-digital converter sound card for the Raspberry Pi, optimized for one specific use case: the best audio playback quality. It is specifically designed for applications that do not only need playback, but also recording functionalities.

  • Stereo input and output

  • Dedicated 192kHz/24bit high-quality Burr-Brown DAC

  • Dedicated 192kHz/24bit high-quality Burr-Brown ADC

  • Hardware volume control for DAC. You can control the output volume using “alsamixer” or any application that supports ALSA mixer controls.

  • Connects directly to the Raspberry Pi, no additional cables needed

  • No soldering, comes as a pre-fabricated kit. You just plug it onto the Raspberry Pi, it is conform to the Raspberry Pi hardware-attached-on-top (HAT) specification.

  • Compatible with all Raspberry Pi models with a 40-pin GPIO connector

  • Directly powered from the Raspberry Pi, no additional power supply

  • Three ultra-low-noise linear voltage regulators for optimal audio performance

  • HAT compliant, EEPROM for automatic configuration

  • Gold plated RCA output connectors

  • Comes with all components required to mount it. We include 4 M2.5x12mm spacers to fix the board onto the Raspberry Pi

  • Audio input requires updated Linux kernel

CONNECTORS AND JUMPERS

Pin

Usage

Vinophonics

1

Analogue input, phone jack 3.5mm

not used

2

Analogue output RCA

wired to headphone jack on rear panel (Red = Right, White = Left)

3

Analogue output (p5)

wired to 3.5mm jack on rear panel

4

Input configuration jumper (J1)

default

5

Alternative input connector (P6)

wired to 3.5mm jack on rear panel

INPUT CONNECTOR P6

This allows you to connect an alternative input connector.

1

right +

2

3

GND

4

5

left +

OUTPUT CONNECTOR P5

This connector can be used to connect to external components, e.g. an amplifier. The output is connected in parallel to the RCA jacks. Pin 1 is on the top left.

+5V

1

2

R

GND

3

4

GND

+5V

5

6

L

Audio Streaming

Audio streaming is accommodated by two components:

VLC audio source

Audio source on the Vinophonics on-board server, capturing sound emitted by the Antonus 2600 through the audio-in port, and streaming this audio source to the broadcaster server.

OBS server

The OBS (Open Broadcaster Server) that receives the vinophonics audio and video streams with the Costaflores 360º video stream, to live stream on YouTube.com/TheLuckHunters/Live

HiFiBerry Setup and Testing

First the HiFiBerry ADC+DAC needs to be configured.

Edit the /boot/config.txt

Remove the line:

dtparam=audio=on

Add the lines:

dtoverlay=hifiberry-dacplusadc

force_eeprom_read=0

Create the /etc/asound.conf file:

pcm.!default {      type hw card 0 } ctl.!default {      type hw card 0 }

Install Sox, a set of tools to create/modify/convert sound files. 

sudo apt-get install sox

Then play an 1kHz sine test tone using the command
play -n synth sine 1000

 

Here are some simple command lines showing how to record and play back a test sample (the file that is stored is called “1”)

Use CD quality (44.1kHz/16bit)

arecord -f cd -d 10 1; sleep 1; aplay 1

VLC audio streaming

Install VLC

Run VLC to capture audio

 

Video Streaming

Vinophonics streams two image sources:

Both cameras shoot regular static images. These images are written to foxtrot:/ov_data/threesixty and foxtrot:/ov_data/vinofisheye, respectively.

The 360º camera updates every 60 seconds images of the vineyard, whereas the 600D snaps a new image every time there is an update to the blockchain and slider positions are moved. This so that Vinophonics participants over the internet can visualize the current patch configurations and LED returns. The Canon 600D is modified with a permanent power supply.

Static images are used, rather than video,to increase the quality uploaded to YouTube, and more importantly to reduce the OBS bandwith demand.

gphoto2

This program uses PTP (picture transfer protocol) to pull images from the camera. After installing gphoto2, test for access to the camera:

pi@vinophonics:~ $ sudo gphoto2 --summary

Camera summary:                                                                

Manufacturer: Canon Inc.

Model: Canon EOS 600D

  Version: 3-1.0.2

  Serial Number: d72398932d634d31afb8914d3e6c62fb

Vendor Extension ID: 0xb (2.0)

 

Capture Formats: JPEG

Display Formats: Association/Directory, Script, DPOF, MS AVI, MS Wave, JPEG, CRW, Unknown(b103), Unknown(bf02), Defined Type, Unknown(b104), Unknown(b105)

 

Device Capabilities:

File Download, File Deletion, File Upload

No Image Capture, No Open Capture, Canon EOS Capture, Canon EOS Capture 2

 

Storage Devices Summary:

store_00020001:

StorageDescription: SD

VolumeLabel: None

Storage Type: Removable RAM (memory card)

Filesystemtype: Digital Camera Layout (DCIM)

Access Capability: Read-Write

Maximum Capability: 16128106496 (15380 MB)

Free Space (Bytes): 16122003456 (15375 MB)

Free Space (Images): -1

 

Device Property Summary:

Property 0xd402:(read only) (type=0xffff) 'Canon EOS 600D'

Property 0xd407:(read only) (type=0x6) 1

Property 0xd406:(readwrite) (type=0xffff) 'Unknown Initiator'

Property 0xd303:(read only) (type=0x2) 1

Battery Level(0x5001):(read only) (type=0x2) Enumeration [100,0,75,0,50] value: 100% (100)

 

Turn off the auto-shutoff mode on the camera.

 

pi@vinophonics:~ $ gphoto2 --auto-detect

Model                          Port                                            

----------------------------------------------------------

Canon EOS 600D                 usb:001,004     

 

Set the camera to NOT write the image to the camera's SD-CARD. Since we are taking a picture, downloading it, and erasing it, we do not need to abuse the SD-CARD but writing (and erasing every picture). Instead we use the camera's RAM.

 

pi@vinophonics:~ $ gphoto2 --set-config capturetarget=0

 

If you are connecting more than one camera at a time to the pi, you can select:

pi@vinophonics:~ $ gphoto2 --capture-image-and-download --camera="Canon EOS 600D" --filename "vinofisheye.jpg"

For vinophonics, the 600D is connected directly to the vinophonics raspberry pi server, and the 360º camera is connected to openvinopi on the platform, but for testing purposes, both cameras can be connected.

 

Writing to foxtrot:/ov_data/*

 

Time-lapse code