CESNET / UltraGrid

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

CRASH: Cannot get maximum auudio channels! #354

Closed alatteri closed 8 months ago

alatteri commented 8 months ago

[2023-11-02 14:56:24] [DeckLink display] Using device UltraStudio HD Mini [2023-11-02 14:56:24] Cannot get maximum auudio channels! [2023-11-02 14:56:24] [DeckLink display] bmdDeckLinkConfigFieldFlickerRemoval set to: false [2023-11-02 14:56:24] [DeckLink display] bmdDeckLinkConfigLowLatencyVideoOutput set to: true [2023-11-02 14:56:24] [DeckLink display] bmdDeckLinkConfigOutput1080pAsPsF set to: false [2023-11-02 14:56:24] [DeckLink display] Audio output set to: analog [2023-11-02 14:56:24] Audio receiving started. [2023-11-02 14:56:24] Control socket listening on port 38297 [2023-11-02 14:56:24] [key control] Stdin is not a TTY - disabling keyboard control. [2023-11-02 14:56:24] [video dec.] New incoming video format detected: 2048x1080 @24.00p, codec H.265 [2023-11-02 14:56:24] [lavd] Setting thread count to 0, type: slice [2023-11-02 14:56:24] [lavd] Using decoder: hevc [2023-11-02 14:56:24] New incoming audio format detected: 48000 Hz, 8 channels, 32 bits per sample, codec Opus [2023-11-02 14:56:24] [lavcd aud.] Using audio decoder: opus [2023-11-02 14:56:24] [lavcd aud.] Using audio decoder: opus [2023-11-02 14:56:24] [lavcd aud.] Using audio decoder: opus [2023-11-02 14:56:24] [lavcd aud.] Using audio decoder: opus [2023-11-02 14:56:24] [lavcd aud.] Using audio decoder: opus [2023-11-02 14:56:24] [lavcd aud.] Using audio decoder: opus [2023-11-02 14:56:24] [lavcd aud.] Using audio decoder: opus [2023-11-02 14:56:24] [lavcd aud.] Using audio decoder: opus [2023-11-02 14:56:24] uv: src/video_display/decklink.cpp:1675: bool display_decklink_reconfigure_audio(void*, int, int, int): Assertion `channels >= 2 && channels != 4 && channels <= 64 && is_power_of_two(channels)' failed. [2023-11-02 14:56:24] Backtrace: [2023-11-02 14:56:24] uv(+0x56b34)[0x55cf6a5c4b34] [2023-11-02 14:56:24] /lib/x86_64-linux-gnu/libc.so.6(+0x42910)[0x7f3b49a42910] [2023-11-02 14:56:24] /lib/x86_64-linux-gnu/libc.so.6(pthread_kill+0x11b)[0x7f3b49a9999b] [2023-11-02 14:56:24] /lib/x86_64-linux-gnu/libc.so.6(raise+0x16)[0x7f3b49a42866] [2023-11-02 14:56:24] /lib/x86_64-linux-gnu/libc.so.6(abort+0xd7)[0x7f3b49a268b7] [2023-11-02 14:56:24] /lib/x86_64-linux-gnu/libc.so.6(+0x267db)[0x7f3b49a267db] [2023-11-02 14:56:24] /lib/x86_64-linux-gnu/libc.so.6(+0x39186)[0x7f3b49a39186] [2023-11-02 14:56:24] uv(+0x161101)[0x55cf6a6cf101] [2023-11-02 14:56:24] uv(+0x8c3e9)[0x55cf6a5fa3e9] [2023-11-02 14:56:24] /lib/x86_64-linux-gnu/libc.so.6(+0x97ada)[0x7f3b49a97ada] [2023-11-02 14:56:24] /lib/x86_64-linux-gnu/libc.so.6(+0x12847c)[0x7f3b49b2847c] [2023-11-02 14:56:24] [2023-11-02 14:56:24] UltraGrid has crashed (ABRT - Aborted). [2023-11-02 14:56:24]

alatteri commented 8 months ago

also... typo. Cannot get maximum auudio channels!

alatteri commented 8 months ago

Strange, a similar thing happens with AAC. This host started as Ubuntu 22.04, then 23.04 and now 23.10. I'm gonna wipe the OS on this machine and try gain. Will get back to you in a day or so.

2023-11-02 14:59:03] [DeckLink display] Using device UltraStudio HD Mini [2023-11-02 14:59:03] Cannot get maximum auudio channels! [2023-11-02 14:59:03] [DeckLink display] bmdDeckLinkConfigFieldFlickerRemoval set to: false [2023-11-02 14:59:03] [DeckLink display] bmdDeckLinkConfigLowLatencyVideoOutput set to: true [2023-11-02 14:59:03] [DeckLink display] bmdDeckLinkConfigOutput1080pAsPsF set to: false [2023-11-02 14:59:03] [DeckLink display] Audio output set to: analog [2023-11-02 14:59:03] Audio receiving started. [2023-11-02 14:59:03] Control socket listening on port 38787 [2023-11-02 14:59:03] [key control] Stdin is not a TTY - disabling keyboard control. [2023-11-02 14:59:03] [video dec.] New incoming video format detected: 2048x1080 @24.00p, codec H.265 [2023-11-02 14:59:03] [lavd] Setting thread count to 0, type: slice [2023-11-02 14:59:03] [lavd] Using decoder: hevc [2023-11-02 14:59:03] New incoming audio format detected: 48000 Hz, 8 channels, 32 bits per sample, codec AAC [2023-11-02 14:59:03] [lavcd aud.] Using audio decoder: aac [2023-11-02 14:59:03] [lavcd aud.] Using audio decoder: aac [2023-11-02 14:59:03] [lavcd aud.] Using audio decoder: aac [2023-11-02 14:59:03] [lavcd aud.] Using audio decoder: aac [2023-11-02 14:59:03] [lavcd aud.] Using audio decoder: aac [2023-11-02 14:59:03] [lavcd aud.] Using audio decoder: aac [2023-11-02 14:59:03] [lavcd aud.] Using audio decoder: aac [2023-11-02 14:59:03] [lavcd aud.] Using audio decoder: aac [2023-11-02 14:59:03] [lavcd aud.] error sending decoded frame -Error while decoding frame (rc == -1094995529): Invalid data found when processing input. [2023-11-02 14:59:03] [lavcd aud.] error sending decoded frame -Error while decoding frame (rc == -1094995529): Invalid data found when processing input. [2023-11-02 14:59:03] [lavcd aud.] error sending decoded frame -Error while decoding frame (rc == -1094995529): Invalid data found when processing input. [2023-11-02 14:59:03] [lavcd aud.] error sending decoded frame -Error while decoding frame (rc == -1094995529): Invalid data found when processing input.

alatteri commented 8 months ago

OK... definitely something with local OS install. I'm gonna close this and open a ticket just for the typo.

MartinPulec commented 8 months ago

That is actually a bit strange. 2 things:

  1. I've tested with UltraStudio HD Mini and it returned maximum of 16 channels for me
  2. even if it fails, I hoped that it doesn't alter the output value, which doesn't seem to be true - it looks like to be set to a value 1 or less 0¹ (BMD supports just 2, 8, 16, 32 or 64 channels) is set

Anyways, I've made some improvements – the maximal value is set only if query succeeds, value is reported to user (in verbose) and its value validated if the query succeeds. Please let me know if you find something out more (eg. when the query still doesn't succeed – it shouldn't crash now, at least not on this, but I'd like to know the reported error /now printed/).

¹ UPDATE 2023-11-06: 0 channels is reported/returned, which is actually correct, since UltraStudio HD Mini doesn't have any analog output channels

alatteri commented 8 months ago

Switched to a NUC13, fresh Ubuntu Server 23.10, BMD 12.7 Still getting the warning, but it does work even so.

[2023-11-03 11:45:52] -d decklink:synchronized  -r analog --audio-channel-map 6:0,7:1 --audio-scale none -P 5004 --param use-hw-accel,resampler=soxr,decoder-use-codec=R12L
[2023-11-03 11:45:52] UltraGrid 1.8+ (tags/continuous rev 8b233cd6 built Nov  3 2023 10:48:13)

[2023-11-03 11:45:52] [DeckLink display] Using device UltraStudio HD Mini
[2023-11-03 11:45:52] [DeckLink display] bmdDeckLinkConfigFieldFlickerRemoval set to: false
[2023-11-03 11:45:52] [DeckLink display] bmdDeckLinkConfigLowLatencyVideoOutput set to: true
[2023-11-03 11:45:52] [DeckLink display] bmdDeckLinkConfigOutput1080pAsPsF set to: false
[2023-11-03 11:45:52] [DeckLink display] Cannot get maximum audio channels: Unspecified failure (0x80000008)
[2023-11-03 11:45:52] [DeckLink display] Using audio output: analog
[2023-11-03 11:46:29] New incoming audio format detected: 48000 Hz, 8 channels, 32 bits per sample, codec Opus
[2023-11-03 11:46:29] [lavcd aud.] Using audio decoder: opus
[2023-11-03 11:46:29] [lavcd aud.] Using audio decoder: opus
[2023-11-03 11:46:29] [lavcd aud.] Using audio decoder: opus
[2023-11-03 11:46:29] [lavcd aud.] Using audio decoder: opus
[2023-11-03 11:46:29] [lavcd aud.] Using audio decoder: opus
[2023-11-03 11:46:29] [lavcd aud.] Using audio decoder: opus
[2023-11-03 11:46:29] [lavcd aud.] Using audio decoder: opus
[2023-11-03 11:46:29] [lavcd aud.] Using audio decoder: opus
[2023-11-03 11:46:29] Audio reconfiguration succeeded (2 channels, 4 Bps, 48000 Hz, codec: PCM).
MartinPulec commented 8 months ago

minimal working example: uv -d decklink -r analog; seems to be specific for UltraStudio HD Mini (or at least not all BMD devices)

MartinPulec commented 8 months ago

Got it! After physical investigation of UltraStudio HD Mini, I've concluded that the device has no analog outputs, only inputs. So the query on number of analog channels is pointless.

In theory, we could query BMDDeckLinkMaximumAudioChannels always (instead of BMDDeckLinkMaximumAnalogAudioOutputChannels), because supposedly the first is almost always higher than the second and the SDK should permit the higher value. But the SDK manual states:

so I conclude that correct is to ask for analog channels if user wants analog audio output.