Audio Never Seems To Work

#1
Hey all, I've been using Caspar for a long time with various setups and I feel like I've never gotten the audio output to work properly. Is there a setup step I'm missing? I usually use system sound output, or embeded, but I consistently get crackling or out of time audio. I have tried changing my decklink cards (always happens even on screen consumer) and updated audio drivers, etc. The whole thing is confounding. I can't get any video to play out properly with audio. I had been building out this machine to do both templates and video though, and while VLC is always there, it would be nice to be able to do BOTH on a caspar build. This has happened on other builds too, what am I getting wrong, is audio just garbage in this system? I'm so frustrated.

T

Re: Audio Never Seems To Work

#2
Here's what the diag screen looks like when video is playing. Buffering all over the place on a machine that should be WAY overpowered for this purpose. Any ideas? This is a thing that has plagued my experience with caspar for a long time. I wish I knew how to make this work so that I can realize the promise of the caspar system. At the moment the best I can do is non audio templates.

It's making me crazy.
Attachments
diag-shot.png

Re: Audio Never Seems To Work

#5
I gave it a shot. Now in the log i get:

[2017-12-03 20:26:30.189] [74604] [info] Sent message to 127.0.0.1:202 PLAY OK\r\n
[2017-12-03 20:26:30.199] [11732] [info] [frame_muxer] simple 1920x1080p59.94
[2017-12-03 20:26:30.269] [71436] [warning] [buffer] Performance warning. Buffer mapping blocked: 0.021

Is this a straight up performance issue? I have an i7 with 32GB and a GTX1060, I can't imagine it. Is it a Win 10 issue?

2.1.0 B2

Best,
Tracy

Re: Audio Never Seems To Work

#8
tracypeterson wrote:
04 Dec 2017, 05:41
No, I can't play a direct audio file over SDI embedded or using the system audio consumer. Same net effect.
Just to understand, you can play a simple audio file without errors using vlc/another player to system audio? That same file stutters when played via caspar? (have you tried several different audio files, preferable with different encoding?)

(I have found that CasparCG isn't nearly as forgiving of data errors and format anomalies as most other players.)

Re: Audio Never Seems To Work

#10
Had problems with video file with audio. It plays fine if framerate of output screen = framerate of a video. If there is a difference, audio stops before video ends and console shows audio buffering errors. Videofile is 100% correct. VLC plays it correctly. Same data but separated video and audio is ok.

i7 6800K, 32GB RAM, SSD RAID, GTX 1070 , Win10 Pro -> screen output from nvidia card, audio from motherboard jack output.

Re: Audio Never Seems To Work

#11
I've seen (and heard) the same thing. CasparCG will do some framerate conversion of video, but from what I can tell it won't match timestamps between A and V when it does (IIRC that's already a feature request). For instance, if you have 24p video with sound and try to play it out at 30p, they'll get out of sync quickly because it's spitting out v frames 25% faster. I assume it works the same if the output rate is slower than the content's rate. (CasparCG also doesn't honor the telecine flag in mgep streams.)

When VLC is playing to the computer screen, it can magically adjust the displayed video to match the intended rate and real time, but you can't do that to a fixed-rate output without frame processing (add/remove/interpolate).

As I mentioned earlier, try playing an MP3 out the Decklink. That ought to work. If it does, this points back to the video encoding- not that it's "wrong" but just that CasparCG can't deal with what it's getting; it's fairly picky about what it gets.

Re: Audio Never Seems To Work

#13
Here's the startup logs:

[2018-01-17 13:31:24.158] [44772] [info] ############################################################################
[2018-01-17 13:31:24.160] [44772] [info] CasparCG Server is distributed by the Swedish Broadcasting Corporation (SVT)
[2018-01-17 13:31:24.160] [44772] [info] under the GNU General Public License GPLv3 or higher.
[2018-01-17 13:31:24.160] [44772] [info] Please see LICENSE.TXT for details.
[2018-01-17 13:31:24.160] [44772] [info] http://www.casparcg.com/
[2018-01-17 13:31:24.160] [44772] [info] ############################################################################
[2018-01-17 13:31:24.160] [44772] [info] Starting CasparCG Video and Graphics Playout Server 2.0.7.e9fc25a Stable
[2018-01-17 13:31:24.160] [44772] [info] on Windows 10 Pro
[2018-01-17 13:31:24.160] [44772] [info] Intel(R) Core(TM) i7-6800K CPU @ 3.40GHz Physical Threads: 12
[2018-01-17 13:31:24.160] [44772] [info] MS-7885
[2018-01-17 13:31:24.253] [44772] [info] Decklink 10.9.9
[2018-01-17 13:31:24.298] [44772] [info] - DeckLink Quad 2 [1]
[2018-01-17 13:31:24.298] [44772] [info] - DeckLink Quad 2 [2]
[2018-01-17 13:31:24.298] [44772] [info] - DeckLink Quad 2 [3]
[2018-01-17 13:31:24.298] [44772] [info] - DeckLink Quad 2 [4]
[2018-01-17 13:31:24.298] [44772] [info] - DeckLink Quad 2 [5]
[2018-01-17 13:31:24.298] [44772] [info] - DeckLink Quad 2 [6]
[2018-01-17 13:31:24.298] [44772] [info] - DeckLink Quad 2 [7]
[2018-01-17 13:31:24.298] [44772] [info] - DeckLink Quad 2 [8]
[2018-01-17 13:31:24.301] [44772] [info] Bluefish Not found
[2018-01-17 13:31:24.303] [44772] [info] FreeImage 3.15.4
[2018-01-17 13:31:24.303] [44772] [info] FFMPEG-avcodec 55.52.102
[2018-01-17 13:31:24.303] [44772] [info] FFMPEG-avformat 55.33.100
[2018-01-17 13:31:24.303] [44772] [info] FFMPEG-avfilter 4.2.100
[2018-01-17 13:31:24.303] [44772] [info] FFMPEG-avutil 52.66.100
[2018-01-17 13:31:24.303] [44772] [info] FFMPEG-swscale 2.5.102
[2018-01-17 13:31:24.303] [44772] [info] Flash 18.0.0.203
[2018-01-17 13:31:24.309] [44772] [info] flash[cg20.fth.pal|0] Initialized.
[2018-01-17 13:31:24.309] [44772] [info] flash[cg20.fth.pal|0] Invoking info-command: <invoke name="GetInfo" returntype="xml"><arguments></arguments></invoke>
[2018-01-17 13:31:24.447] [47628] [debug] flash-player[cg20.fth.pal|1024x576] [command] <invoke name="OnCommand" returntype="xml"><arguments><string>Command recieved @GetInfo@?@</string></arguments></invoke>
[2018-01-17 13:31:24.580] [47628] [info] flash-player[cg20.fth.pal|1024x576] Initialized.
[2018-01-17 13:31:24.583] [47628] [debug] flash-player[cg20.fth.pal|1024x576] [command] <invoke name="OnCommand" returntype="xml"><arguments><string>Command recieved @GetInfo@?@</string></arguments></invoke>
[2018-01-17 13:31:24.664] [44772] [trace] Template-Host 2.0.4.3803 RC
[2018-01-17 13:31:24.666] [44772] [info] NewTek iVGA unavailable (Processing.AirSend.x86.dll)
[2018-01-17 13:31:24.666] [44772] [info] casparcg.config:
-----------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<paths>
<media-path>media\</media-path>
<log-path>log\</log-path>
<data-path>data\</data-path>
<template-path>templates\</template-path>
<thumbnails-path>thumbnails\</thumbnails-path>
</paths>
<channels>
<channel>
<video-mode>1080p5994</video-mode>
<consumers>
<screen>
<device>1</device>
<stretch>uniform_to_fill</stretch>
</screen>
<system-audio/>
</consumers>
</channel>
</channels>
<controllers>
<tcp>
<port>5250</port>
<protocol>AMCP</protocol>
</tcp>
</controllers>
</configuration>
-----------------------------------------
[2018-01-17 13:31:24.666] [44772] [info] Initialized html module.
[2018-01-17 13:31:24.668] [44772] [info] Initializing OpenGL Device.
[2018-01-17 13:31:24.821] [43940] [info] OpenGL 4.6.0 NVIDIA 390.65 NVIDIA Corporation
[2018-01-17 13:31:24.824] [43940] [info] Successfully initialized OpenGL Device.
[2018-01-17 13:31:24.838] [44772] [info] Initialized ffmpeg module.
[2018-01-17 13:31:24.840] [44772] [info] Initialized bluefish module.
[2018-01-17 13:31:24.854] [44772] [info] Initialized decklink module.
[2018-01-17 13:31:24.854] [44772] [info] Initialized oal module.
[2018-01-17 13:31:24.854] [44772] [info] Initialized newtek module.
[2018-01-17 13:31:24.854] [44772] [info] Initialized ogl module.
[2018-01-17 13:31:24.854] [44772] [info] Initialized flash module.
[2018-01-17 13:31:24.854] [44772] [info] Initialized image module.
[2018-01-17 13:31:25.666] [43940] [info] [shader] Blend-modes are disabled.
[2018-01-17 13:31:25.669] [44772] [info] video_channel[1|1080p5994] Successfully Initialized.
[2018-01-17 13:31:25.678] [44772] [info]
+---------------+
| filter_buffer |default--[1920x1080 1:1 bgra]--filter_buffersink:default
| (buffer) |
+---------------+

+-------------------+
filter_buffer:default--[1920x1080 1:1 bgra]--default| filter_buffersink |
| (buffersink) |
+-------------------+


[2018-01-17 13:31:25.678] [44772] [info] Screen consumer [1|1080p5994] Successfully Initialized.
[2018-01-17 13:31:25.678] [48984] [info] output[1] Screen consumer [1|1080p5994] Added.
[2018-01-17 13:31:25.888] [44772] [info] oal[1|1080p5994] Sucessfully Initialized.
[2018-01-17 13:31:25.904] [48984] [info] output[1] oal[1|1080p5994] Added.
[2018-01-17 13:31:25.904] [44772] [info] Initialized channels.
[2018-01-17 13:31:25.906] [44772] [info] Initialized thumbnail generator.
[2018-01-17 13:31:25.906] [44772] [info] WinSock2 Initialized.
[2018-01-17 13:31:25.907] [44772] [info] Listener successfully initialized
[2018-01-17 13:31:25.907] [44772] [info] Initialized controllers.
[2018-01-17 13:31:25.907] [44772] [info] Initialized osc.
[2018-01-17 13:31:25.907] [44772] [info] Started initial media information retrieval.
[2018-01-17 13:31:25.931] [47100] [info] Screen consumer [1|1080p5994] Successfully Initialized.
[2018-01-17 13:31:26.037] [47628] [info] flash-player[cg20.fth.pal|1024x576] Uninitialized.
[2018-01-17 13:31:26.049] [48632] [info] flash[cg20.fth.pal|5000] Uninitialized.
[2018-01-17 13:31:26.472] [46276] [info] Initial media information retrieval finished.

Re: Audio Never Seems To Work

#14
The issue would seem related to incompatible encoding, as you only see this issue with mp3. Try to encode with libmp3lame.

I see you are still running 2.0.7, there have been a few audio related fixes in the beta 2 version of 2.1.0 (download from https://casparcg.com/download.html) so perhaps you could try that as well.
Also, the ffmpeg producer is currently being rewritten against a much updated version of ffmpeg, it might be worth waiting until that is available for testing.
CasparCG enthusiast and broadcast geek

Re: Audio Never Seems To Work

#15
I've started testing 2.1b2 and it's actually a more consistent issue. I've been scanning github trying to find clues as to how this thing is cobbled together. I can play any of these things just fine using ffmpeg or VLC. I'm not sure I understand what you mean about encoding mp3, the mp3 was just a test to see if the error happens even without video, that it is an issue not related to video framerate, which it appears not to be.
cron