CESNET / UltraGrid

UltraGrid low-latency audio and video network transmission system
http://www.ultragrid.cz
Other
485 stars 55 forks source link

Decklink audio out being forced to 2 channels only. #360

Closed alatteri closed 7 months ago

alatteri commented 8 months ago

Hello,

When using Decklink out, seem UG is forcing 2 channels even if the input is 8.

uv -d decklink synchronized -r analog -P 5004 --param use-hw-accel,resampler=soxr,decoder-use-codec=R12L

[2023-11-13 16:51:57] [DeckLink display] Using device UltraStudio 4K Mini
[2023-11-13 16:51:57] [DeckLink display] bmdDeckLinkConfigFieldFlickerRemoval set to: false
[2023-11-13 16:51:57] [DeckLink display] bmdDeckLinkConfigLowLatencyVideoOutput set to: true
[2023-11-13 16:51:57] [DeckLink display] bmdDeckLinkConfigOutput1080pAsPsF set to: false
[2023-11-13 16:51:57] [DeckLink display] Using audio output: analog
[2023-11-13 16:51:57] Audio receiving started.
[2023-11-13 16:51:57] Control socket listening on port 44391
[2023-11-13 16:51:57] [key control] Stdin is not a TTY - disabling keyboard control.
[2023-11-13 16:52:34] SSRC 0x3d9ba3f7: 128/128 packets received (100.0000%), 0 lost, max loss 0
[2023-11-13 16:52:34] [video dec.] New incoming video format detected: 2048x1080 @23.98p, codec H.265
[2023-11-13 16:52:34] [lavd] Setting thread count to 0, type: slice
[2023-11-13 16:52:34] [lavd] Using decoder: hevc
[2023-11-13 16:52:34] [lavd] Waiting for first SPS/VPS NALU...
[2023-11-13 16:52:34] New incoming audio format detected: 48000 Hz, 8 channels, 32 bits per sample, codec Opus
[2023-11-13 16:52:34] [lavcd aud.] Using audio decoder: opus
[2023-11-13 16:52:34] [lavcd aud.] Using audio decoder: opus
[2023-11-13 16:52:34] [lavcd aud.] Using audio decoder: opus
[2023-11-13 16:52:34] [lavcd aud.] Using audio decoder: opus
[2023-11-13 16:52:34] [lavcd aud.] Using audio decoder: opus
[2023-11-13 16:52:34] [lavcd aud.] Using audio decoder: opus
[2023-11-13 16:52:34] [lavcd aud.] Using audio decoder: opus
[2023-11-13 16:52:34] [lavcd aud.] Using audio decoder: opus
[2023-11-13 16:52:34] Audio reconfiguration succeeded (2 channels, 4 Bps, 48000 Hz, codec: PCM).
mikekoetter commented 8 months ago

I thought I saw somewhere that the Opus codec only officially supported 2 channels.

alatteri commented 8 months ago

Each channel is treated as its own. I think it is related to a commit around here: c610aae for this issue. https://github.com/CESNET/UltraGrid/issues/354

MartinPulec commented 7 months ago

This behavior is correct in my opinion – UltraStudio 4K Mini has only 2 analog output channels as also indicated in tech specs.

alatteri commented 7 months ago

How do I get 5.1 out the SDI/HDMI? That exact command used to work fine not that long ago.

uv -d decklink:synchronized -r decklink -P 5004 --param use-hw-accel,resampler=soxr,decoder-use-codec=R12L
[DeckLink audio play.] Audio-only DeckLink output, if also video is needed, use "-d decklink -r analog" instead.

or should this be -r embedded? I won't be able to confirm this until tomorrow, but in the logs at least I now see:

New incoming audio format detected: 48000 Hz, 8 channels, 32 bits per sample, codec Opus
[lavcd aud.] Using audio decoder: opus
Audio reconfiguration succeeded (8 channels, 4 Bps, 48000 Hz, codec: PCM).
MartinPulec commented 7 months ago

or should this be -r embedded?

Yes, currently different value is queried according to output specification, see this. It is true that it worked also with analog for 8 channels in the past, because there was hard-coded maximal channel count (32 or something) and DeckLinks play audio over all outputs (similarly for the video); but I believe that now it is more correct – analog should be used when really analog is required.

[DeckLink audio play.] Audio-only DeckLink output, if also video is needed, use "-d decklink -r analog" instead.

Well, I'll fix this hint, but it is just the hint to prevent incorrect usage. ¹

¹ this message is no longer in current UG code – both analog and embedded is suggested now

alatteri commented 7 months ago

thank you. Perfect.