Screen comsumer on minimal ubuntu server installation does not receive AMCP commands

Problem statement

Hi, I’m trying to use casparcg for a graphics playout server controlled by bitfocus companion. Initially I am trying to get it to work with the screen consumer (until I see a cheap decklink on ebay). To make it as robust as possible, I want to start from a “minimized” ubuntu server installation and only install a minimal X11 session.

Summary of overall progress

I started installing the debian packages from the latest CCG release on a full ubuntu desktop installation 24.04.3 LTS. This was very easy to setup and worked great in my testing; but, being the glutton for punishment (and seeing the potential for GDM messages/password prompts/system updates/etc… to cover my graphics), I decided to install a minimized ubuntu 24.04.3 LTS server and build up from there. I am scripting the whole process and publishing it to github in the rare chance that someone else wants to try this. All of my config files and scripts are [here][GitHub - JGAustin/VideoServer at init].

I am able to get an X-session up and running. The log file shows that casparcg should be listening. The problem is, according to the log, it never receives any AMCP commands.

Summary of my Problem-solving efforts

I have tried:

  1. I have tried sending the commands from companion, netcat, socat, another computer using putty as a telnet client to port 5250, and a raw filepointer to a tcp connection that chatgpt showed me.
  2. I have verified with TCPdump that the commands are arriving.
  3. I have verified that UFW is not installed
  4. Setting the <log-level>trace</log-level> does not add any output aside from the line “Logging [trace] or higher severity to log/”.
  5. I used cat /proc/<pid>/maps | grep '.so' to compare which .so libraries the working version was using to the non-working version and installed the associated packages.

Config files

At the time of this writing my CCG config file (less the documentation comments) is:

<?xml version="1.0" encoding="utf-8"?>

<configuration>
    <!--<log-level>trace</log-level> I sometimes add this here but it doesn't change the output-->
    <paths>
        <media-path>media/</media-path>
        <log-path disable="false">log/</log-path>
        <data-path>data/</data-path>
        <template-path>template/</template-path>
    </paths>
    <lock-clear-phrase>secret</lock-clear-phrase>
    <channels>
        <channel>
            <video-mode>1080p5994</video-mode>
            <consumers>
                <screen>
                        <device>0</device>
                        <windowed>false</windowed>
                        <borderless>true</borderless>
                        <interactive>false</interactive>
                        <always-on-top>true</always-on-top>
                </screen>
                <!-- I have tried both with and without system-audio, I don't really need it -->
                <!--<system-audio />-->
            </consumers>
        </channel>
    </channels>
    <controllers>
        <tcp>
            <port>5250</port>
            <protocol>AMCP</protocol>
        </tcp>
    </controllers>
    <amcp>
        <media-server>
            <host>localhost</host>
            <port>8000</port>
        </media-server>
    </amcp>
</configuration>

log outputs:

Casparcg log file (I sent commands using printf 'PLAY 1-1 COLOR 1 0 0\r\n' | nc -N 127.0.0.1 5250 during this session. I included the last few lines from the previous startup to show that commands aren’t being received):

[2025-10-14 02:24:01.608] [info]    Initialized modules.
[2025-10-14 02:24:01.608] [info]    Screen consumer [1|1080p5994] Initialized.
[2025-10-14 02:24:01.662] [info]    oal[1|1080p5994] Initialized.
[2025-10-14 02:24:01.662] [info]    Initialized startup producers.
[2025-10-14 02:24:01.662] [info]    Initialized controllers.
[2025-10-14 02:24:01.662] [info]    Initialized osc.
[2025-10-14 02:25:35.730] [info]    ############################################################################
[2025-10-14 02:25:35.730] [info]    CasparCG Server is distributed by the Swedish Broadcasting Corporation (SVT)
[2025-10-14 02:25:35.730] [info]    under the GNU General Public License GPLv3 or higher.
[2025-10-14 02:25:35.730] [info]    Please see LICENSE.TXT for details.
[2025-10-14 02:25:35.730] [info]    http://www.casparcg.com/
[2025-10-14 02:25:35.730] [info]    ############################################################################
[2025-10-14 02:25:35.730] [info]    Starting CasparCG Video and Graphics Playout Server 2.4.3 N/A Stable
[2025-10-14 02:25:35.731] [info]    "/opt/casparcg/casparcg.config":
[2025-10-14 02:25:35.731] [info]    -----------------------------------------
[2025-10-14 02:25:35.731] [info]    <?xml version="1.0" encoding="utf-8"?>
[2025-10-14 02:25:35.731] [info]    <configuration>
[2025-10-14 02:25:35.731] [info]       <log-level>trace</log-level>
[2025-10-14 02:25:35.731] [info]       <paths>
[2025-10-14 02:25:35.731] [info]          <media-path>media/</media-path>
[2025-10-14 02:25:35.731] [info]          <log-path disable="false">log/</log-path>
[2025-10-14 02:25:35.731] [info]          <data-path>data/</data-path>
[2025-10-14 02:25:35.731] [info]          <template-path>template/</template-path>
[2025-10-14 02:25:35.731] [info]       </paths>
[2025-10-14 02:25:35.731] [info]       <lock-clear-phrase>secret</lock-clear-phrase>
[2025-10-14 02:25:35.731] [info]       <channels>
[2025-10-14 02:25:35.731] [info]          <channel>
[2025-10-14 02:25:35.731] [info]             <video-mode>1080p5994</video-mode>
[2025-10-14 02:25:35.731] [info]             <consumers>
[2025-10-14 02:25:35.731] [info]                <screen>
[2025-10-14 02:25:35.731] [info]                   <device>0</device>
[2025-10-14 02:25:35.731] [info]                   <windowed>false</windowed>
[2025-10-14 02:25:35.731] [info]                   <borderless>true</borderless>
[2025-10-14 02:25:35.731] [info]                   <interactive>false</interactive>
[2025-10-14 02:25:35.731] [info]                   <always-on-top>true</always-on-top>
[2025-10-14 02:25:35.731] [info]                </screen>
[2025-10-14 02:25:35.731] [info]             </consumers>
[2025-10-14 02:25:35.731] [info]          </channel>
[2025-10-14 02:25:35.731] [info]       </channels>
[2025-10-14 02:25:35.731] [info]       <controllers>
[2025-10-14 02:25:35.731] [info]          <tcp>
[2025-10-14 02:25:35.731] [info]             <port>5250</port>
[2025-10-14 02:25:35.731] [info]             <protocol>AMCP</protocol>
[2025-10-14 02:25:35.731] [info]          </tcp>
[2025-10-14 02:25:35.731] [info]       </controllers>
[2025-10-14 02:25:35.731] [info]       <amcp>
[2025-10-14 02:25:35.731] [info]          <media-server>
[2025-10-14 02:25:35.731] [info]             <host>localhost</host>
[2025-10-14 02:25:35.731] [info]             <port>8000</port>
[2025-10-14 02:25:35.731] [info]          </media-server>
[2025-10-14 02:25:35.731] [info]       </amcp>
[2025-10-14 02:25:35.731] [info]    </configuration>
[2025-10-14 02:25:35.731] [info]    -----------------------------------------
[2025-10-14 02:25:35.731] [info]    Initialized video modes.
[2025-10-14 02:25:36.004] [info]    Initializing OpenGL Device.
[2025-10-14 02:25:36.007] [info]    Initialized OpenGL 4.6 (Core Profile) Mesa 25.0.7-0ubuntu0.24.04.2 Intel
[2025-10-14 02:25:36.033] [info]    Initialized OpenGL Accelerated GPU Image Mixer for channel 1
[2025-10-14 02:25:36.033] [info]    video_channel[1|1080p5994] Successfully Initialized.
[2025-10-14 02:25:36.033] [info]    Initialized channels.
[2025-10-14 02:25:36.034] [info]    Initialized command repository.
[2025-10-14 02:25:36.034] [info]    Initialized image module.
[2025-10-14 02:25:36.034] [info]    Initialized ffmpeg module.
[2025-10-14 02:25:36.034] [info]    Initialized oal module.
[2025-10-14 02:25:36.034] [info]    Initialized decklink module.
[2025-10-14 02:25:36.034] [info]    Initialized screen module.
[2025-10-14 02:25:36.034] [info]    Initialized newtek module.
[2025-10-14 02:25:36.034] [info]    Initialized artnet module.
[2025-10-14 02:25:36.198] [info]    Initialized html module.
[2025-10-14 02:25:36.198] [info]    Initialized modules.
[2025-10-14 02:25:36.198] [info]    Screen consumer [1|1080p5994] Initialized.
[2025-10-14 02:25:36.198] [info]    Initialized startup producers.
[2025-10-14 02:25:36.198] [info]    Initialized controllers.
[2025-10-14 02:25:36.198] [info]    Initialized osc.
user@videoserver:~$

Other Relevant Configurations


# .xinitrc executes on x-server startup
user@videoserver:~$ cat /home/casparcg/.xinitrc
#!/usr/bin/env bash
unclutter -idle 0 -root &
xset -dpms
xset s off
exec /usr/bin/casparcg-server-2.4 /opt/casparcg/casparcg.config

# X Wrapper allows us to start an x11 session from a daemon
user@videoserver:~$ cat /etc/X11/Xwrapper.config
allowed_users=anybody
needs_root_rights=yes

# Systemd unit:
user@videoserver:~$ cat /etc/systemd/system/casparcg.service
[Unit]
Description=CasparCG headless X session
After=systemd-user-sessions.service network.target
Wants=network.target

[Service]
User=casparcg
Group=casparcg
WorkingDirectory=/opt/casparcg

# Attach to a real VT so Xorg considers this a console session
TTYPath=/dev/tty7
StandardInput=tty
TTYReset=yes
TTYVHangup=yes

Environment=DISPLAY=:0
Environment=XDG_SESSION_TYPE=x11

# Start X directly; run the user's .xinitrc
# -keeptty helps some distros when starting from a service
ExecStart=/usr/bin/xinit /home/casparcg/.xinitrc -- /usr/lib/xorg/Xorg :0 vt7 -nolisten tcp -keeptty

Restart=on-failure
RestartSec=3
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target

installed packages:

Initially installed:

  1. xserver-xorg
  2. xinit
  3. x11-xserver-utils
  4. mesa-utils
  5. openbox
  6. unclutter (to hide the mouse cursor)

Installed after comparing in-use .so libraries to working CCG:

  1. dconf-gsettings-backend
  2. gvfs-daemons
  3. gvfs-libs
  4. libcanberra-gtk3-0
  5. libcanberra-gtk3-module
  6. libcanberra0
  7. libltdl7
  8. libnss3
  9. libpipewire-0.3-0 pipewire
  10. libspa-0.2-modules
  11. libsecret-1-0
  12. libsqlite3-0
  13. libtdb1
  14. libc-bin

My Questions:

  1. Has anyone successfully run the official CasparCG 2.4.x .deb on a minimal Ubuntu 24.04 server (without a full desktop) and received AMCP replies?
  2. Are there known missing runtime dependencies or environment requirements for AMCP (e.g. DBus, X11, or HTML/CEF modules)?
  3. Could the HTML or CEF module block the AMCP event loop in a minimal environment?

I cannot answr your Linux specific question, I am. Windows guy. But have you tried to key in the AMCP commands directly into Caspas‘s console window? Does that work? Du you send your AMCP as encoded as UTF-8?

You might want to change your systemd unit to wait for network-online.target as the network.target you are using right now doesn’t really guarantee any of the interfaces are loaded.

@didikunz Interestingly enough, adding stdin/stdout FIFO pipes to test feeding commands directly into the console unblocked something and it casparcg started working through TCP before I could even try sending a command to the pipe. This tells me that whatever is hanging is due to not having a traditional console (systemd is the equivalent of a windows service, not really attached to a console).

@mint I like that suggestion. I am incorporating it. I think it will definitely save me some heartbreak on boot.

Thank yall both for the help, this gives me some more stuff to try.

When you get a hold of a decklink I would recommend looking into running without X11. That would be very interesting to hear how it goes for you.

feat: support running without x11 on linux by Julusian · Pull Request #1624 · CasparCG/server

1 Like

The solution was to add a pipe from /dev/null to the stdin of Casparcg.

It was merely changing the line

To
exec /usr/bin/casparcg-server-2.4 /opt/casparcg/casparcg.config </dev/null

I also removed the extra packages and unclutter (not giving the service account input permissions means it doesn’t render a mouse).

Thank y’all again for the help. I ordered a Decklink today, so I will update things once I receive that.

1 Like

I received the decklink. I had seen that PR, but I didn’t realize that it was April this year, thus not in the current release. Do you have any idea when the next release will be?