Audio Switching

From BATC Wiki
Jump to: navigation, search

The capability to transmit or stream sound from either the video capture device (EasyCap) or a microphone connected through a cheap USB dongle was overhauled and further developed in software 201707221. Note that sound is only added to MPEG-2 transmissions. The capability to add sound to H264 transmissions is being developed, but is not yet ready for release.

In the Console, System Setup, Audio Input menu there are 5 options: auto, mic, video, bleeps and no_audio. The switching behaviour is as follows:

1. If "no_audio" is selected, no audio stream is generated.

2. If "bleeps" is selected, mono bleeps are transmitted.

3. If neither an EasyCap or USB Sound Dongle is detected (see below), no audio channel is generated, unless the option for "bleeps" has been requested. In which case "bleeps" are generated.

4. In "auto" mode:

If both an EasyCap and a USB Sound Dongle are detected, the video source is checked. If video from the Pi Cam is selected, mono audio from the USB Sound Dongle is transmitted. If the EasyCap is selected for video, stereo audio from the EasyCap is transmitted.

If only a USB Sound Dongle is detected, mono audio from the USB Sound Dongle is transmitted.

If only an EasyCap is detected, stereo audio from the EasyCap is transmitted.

5. In "mic" mode, if a USB Sound Dongle is detected, mono audio from the USB Sound Dongle is transmitted. If no USB Sound Dongle is detected, but an EasyCap is, stereo audio from the EasyCap is transmitted.

6. In "video" mode, if an EasyCap is detected, stereo audio from the EasyCap is transmitted. If no EasyCap is detected, but a USB Sound Dongle is, mono audio from the USB Sound Dongle is transmitted.

The "auto", "mic" and "EC" (video) modes can also be selected from Menu 2 of the Touchscreen.

Identification of Audio Devices

Audio devices are identified as being Microphone Dongles or EasyCaps by analysing the response to the Linux command "arecord -l".

If the response includes any of the following strings (case sensitive) , the device is classed as a USB Microphone Dongle:

USB Audio Device
USB AUDIO
Head
Sound Device

This means that the following audio devices are supported by this logic:

Device [USB Audio Device], device 0: USB Audio [USB Audio]
AUDIO [USB AUDIO], device 0: USB Audio [USB Audio]
Set [C-Media USB Headphone Set], device 0: USB Audio [USB Audio]
Headset [Logitech USB Headset], device 0: USB Audio [USB Audio]
Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]

Note that the Samson C01UPro USB Microphone is not supported. It requires relatively complex Linux driver software that is beyond the scope of this project.

If the response includes any of the following strings, the device is classed as a video capture device:

usbtv
U0x534d0x21
DVC90
Cx231xxAudio
STK1160
U0xeb1a0x2861
AV TO USB
Grabby
Webcam

This takes account of the following devices:

usbtv [usbtv], device 0: USBTV Audio [USBTV Audio Input]
U0x534d0x21 [USB Device 0x534d:0x21], device 0: USB Audio [USB Audio]
DVC90 [DVC90], device 0: USB Audio [USB Audio]
Cx231xxAudio [Cx231xx Audio], device 0: Cx231xx Audio [Conexant cx231xx Capture]
STK1160 [STK1160], device 0: USB Audio [USB Audio]
U0xeb1a0x2861 [USB Device 0xeb1a:0x2861], device 0: USB Audio [USB Audio ]
USB20 [AV TO USB2.0], device 0: USB Audio [USB Audio]
Grabby (TerraTec Grabby), device 0: USB Audio (USB Audio)
C525 [HD Webcam C525], device 0: USB Audio [USB Audio]

Note that inclusion in this list does not mean that the Portsdown will work with the device for video capture. All it means is that it can capture audio from it; in particular, the DVC90 and Cx231xxAudio devices will not work for video capture (yet).

If you want an entry added to either of these lists (which each appear twice between lines 70 and 100 in the file scripts/a.sh) please post full details on the BATC Forum.