Skip to content

Audio Settings

Vitek edited this page Nov 30, 2016 · 13 revisions

Audio Settings

Currently you can choose following capture/playback devices:

  • portaudio - use system sound via PortAudio
  • jack - use JACK Audio Connection Kit
  • alsa - use Advanced Linux Sound Architecture (ALSA)
  • coreaudio - use Core Audio (OS X)

Further 3 devices are used to capture/playback audio with device currently used for video. Therefore, -d option always needs to be present and indicates which HW device to use sound from.

  • embedded - grab/play audio embedded in SDI
  • analog - grab/play analog audio connected to capture card
  • AESEBU - grab/play AES/EBU (digital) audio connected to capture card

Sending

  • send video and analog audio (XLR-connected) from Decklink

./uv -t decklink:0:6:UYVY -s`` ``analog  

  • send audio and video from Quicktime

./uv -t quicktime:0:1:12:0:0 -s`` ``embedded  # not that to config string was appended also configuration for audio

  • Send system's default audio, without any video stream

./uv -s`` ``portaudio 192.0.43.20 # sender

  • the same, but with ALSA, Coreaudio or jack

./uv -s`` ``alsa 192.0.43.20 # use default ALSA device ./uv -s`` ``coreaudio 192.0.43.20 # use default Coreaudio device ./uv -s`` ``jack:system:capture 192.0.43.20 # send sound captured with JACK

  • send selected audio source (CoreAudio)

./uv -t dvs:37:UYVY -s`` ``coreaudio:1

to get list of available audio devices, issue:

./uv`` ``-s`` ``help

You can specify number of captured (and sent) audio channels:

./uv -s alsa --audio-capture-channels`` ``1 # send only mono

Receiving

  • receive sound and embed it into SDI (DVS and Quicktime)

./uv -d dvs -r`` ``embedded  ./uv -d quicktime:65534 -r`` ``embedded 

  • playback video and play audio through AES/EBU (note that, however, Decklinks always play audio through all available outputs - analog, AES/EBU and embedded into SDI)

./uv -d decklink -r`` ``AESEBU  

  • receive only audio with PortAudio (Windows/OS X/Linux)

./uv -r`` ``portaudio 192.0.43.10 # use default system sound device

  • the same with CoreAudio/ALSA/JACK

./uv -r`` ``coreaudio 192.0.43.10 # use default CoreAudio device (OS X) ./uv -r`` ``alsa 192.0.43.10 # use ALSA (Linux) ./uv -r`` ``jack:system:playback 192.0.43.10 # playback received audio with JACK Audio Connection Kit

  • receive video with deltacast card, audio with ALSA PulseAudio plugin

./uv -d deltacast -r`` ``alsa:pulse

  • you can also use Decklink as a playback driver. The difference compared to "-r embedded" is that here is DeckLink used solely for audio playback (useful when you want to use Decklink's XLR outputs). Please note that in this setup you cannot use the same decklink device for video playback. If you want so, use "-d decklink -r embedded" option.

./uv -r`` ``decklink:0

to get list of available playback devices issue

./uv`` ``-r`` ``help

Other options used when playing received audio are:

  • --audio-channel-map - can remap audio channels, mix/split them etc. For more info issue 'uv --audio-channel-map help'
  • --audio-scale - scale audio signal, either by a constant value or adaptively, pleas see 'uv --audio-scale help' for details

Other examples

  • send and receive only audio, use Portaudio sound device nr. 3 for both input and output (you can list available devices with -r/-s help paramaters);

./uv -r`` ``portaudio:3`` ``-s`` ``portaudio:3 

Using echo-cancelling microphones (Chat 150)

The echo-cancelling must be used as both sender and receiver and this must be passed to ultragrid via the -s/-r parameters.

uv -s`` ``alsa:plughw:CARD=C150`` ``-r`` ``alsa:plughw:CARD=C150 

This should be sufficient for most setups. Echo cancelling microphones are always one channel, therefore is here specified a plughw device, which enables all SW conversions (eg. from 2 channels to 1).

Alternatively, you may want to use one channel directly, by specifying this explicitly:

uv -s alsa:hw:CARD=C150 -r alsa:hw:CARD=C150 --audio-capture-channels`` ``1`` ``--audio-channel-map`` ``0:0`` ``--audio-scale`` ``none 

--audio-capture-channels tells that we want to capture and send only one channel (default is 1).

--audio-channel-map is here to instruct that we need to receive only one channel (received channel 0 is mapped to played channel 0). Other channels are dropped. This is for situation when we receive more than one channel, otherwise it can be omitted.

--audio-scale none tells that we do not want to scale received audio channel. The automatic scaling is enabled when we use --audio-channel-map option. You should remove this option if you know you will receive 2 channels and you want to mix them together - this would be --audio-channel-map 0:0,1:0.

Multi-channel setup

To capture more than one channel, use option:

--audio-capture-channels with requested number of input channels

By default, receiver receives all captured channels, if this is not desired behavior, you can select channels that you want to play with following option:

--audio-channel-map

Syntax is following:

source1_chan:dest1_chan[,source2_chan:dest2_chan...]

eg.

--audio-channel-map 4:0,5:1

Plays only channel 4 and 5 (indexed from zero) as channel 0 and 1. All other received channels are dropped.

JACK transport

You can JACK as a source on a sender and sink on a receiver.

Note: For JACK as a normal audio driver (output through JACK at receiver, input at sender side) please refer to audio section and use JACK in a similar way to other audio drivers like CoreAudio or ALSA.

Usage:

  • sender (DVS, JACK source) -- this commands take sound from SDI/portaudio and send it via JACK server and specified port

./bin/uv -t`` ``dvs:37:UYVY`` ``-s`` ``embedded`` ``-j`` ``po=system:playback ./bin/uv -t dvs:37:UYVY -s`` ``portaudio`` ``-j`` ``po # if port name ommited, UG chooses from what is offered by JACK server

  • receiver (Quicktime, JACK sink) - this command takes sound capture via JACK (eg. netjack) and passes it to quicktime driver

./bin/uv -d`` ``quicktime:65561`` ``-r`` ``embedded`` ``-j`` ``pi[=system:caputre]

Echo cancellation

Important: Echo cancellation is currently broken therefore following examples won't work! Basic usage:

uv --echo-cancellation ...

Toggles on acoustic echo cancellation. You need to have only one channel in both sides to use this. To set egress audio channels you can use --audio-capture-channels option.

If you are receiving more than one channel, you can mix them with --audio-channel-map. Typical usage is the following - receiving stereo audio, sending one channel echo-cancelled audio:

uv --echo-cancellation --audio-capture-channels`` ``1`` ``--audio-channel-map`` ``0:0,1:0 -r alsa -s alsa

Notes

ALSA

If you experience problems eg. with wrong sample format or channel sound, try to use a plugdev ALSA device, which has all SW conversions enabled

Clone this wiki locally