Menu ▾ ▴

#83 Linux: LibreOffice PPT/PPTX rendering through ExternalRenderer with NDI support

Next release
open
nobody
None
1
2026-09-28
2026-09-28
Krzysiek
No

This patch adds Linux support for PowerPoint / LibreOffice Impress presentations
using LibreOffice UNO and OpenSong's existing ExternalRenderer protocol.

Base revision: SVN r1825.

The main goal is to render presentation slides inside OpenSong instead of
displaying a separate LibreOffice Impress slideshow window.

Because the rendered presentation becomes part of OpenSong's normal picture
pipeline, PPT/PPTX slides can also be sent through OpenSong's NDI output.

Implementation

The patch adds:

  • LibreOfficeHost.xojo_code
    TCP client used by OpenSong to communicate with the LibreOffice helper.

  • LibreOfficePresentation.xojo_code
    Linux implementation of the iPresentation interface.

  • PresentationFactory changes
    Linux presentation objects are created through LibreOfficePresentation.

  • PresentWindow changes
    Presentation slides carrying an "externalrenderid" are rendered through
    ExternalRenderer instead of using an external Impress slideshow window.

  • opensong-libreoffice-host.py
    Provides presentation metadata/control through LibreOffice UNO.

  • opensong-external-renderer.py
    Implements the OpenSong ExternalRenderer protocol for presentations.

Rendering architecture

PPT/PPTX
|
LibreOffice -> PDF
|
pdftoppm -> PNG
|
OpenSong ExternalRenderer
|
PreviewPicture / CurrentPicture
|
Presentation output + NDI

The LibreOffice helper uses:

127.0.0.1:2002 LibreOffice UNO
127.0.0.1:2003 OpenSong LibreOffice helper

The ExternalRenderer listens on:

127.0.0.1:8083

PREPARE

During ExternalRenderer PREPARE:

  1. presentation groups are located in the OpenSong set XML
  2. PPT/PPTX is converted to PDF using LibreOffice
  3. all PDF pages are pre-rendered to PNG using pdftoppm
  4. an "externalrenderid" is assigned to each presentation slide
  5. PNG images are cached and loaded into memory
  6. the modified XML is returned to OpenSong

Pre-rendering all pages during PREPARE avoids running pdftoppm on every slide
change. After preparation, RENDER only returns the already generated image.

Requirements

Linux packages:

libreoffice
python3
python3-uno
poppler-utils

A separate LibreOffice user profile can be used for the headless UNO instance,
so it does not interfere with a user's normal LibreOffice session.

ExternalRenderer timeout

The first PREPARE may take several seconds because LibreOffice has to convert
the presentation and all pages are rendered.

The existing 3000 ms timeout may therefore be too short for the first load.
A timeout of approximately 15000 ms or higher is recommended, depending on the
presentation size and machine speed.

Crash fix

During testing a Linux segmentation fault occurred when leaving presentation
mode.

The problem was caused by re-entrant GUI event processing in the synchronous
LibreOffice TCP request path during presentation cleanup/destruction.

Removing App.DoEvents from this request path and using socket Poll directly
prevents the crash.

Testing

Tested successfully on Linux with current OpenSong trunk r1825.

Tested scenarios:

  • loading a multi-slide PPTX presentation
  • correct slide count and slide selection
  • presentation output on the second display
  • NDI output
  • sequential slide changes
  • returning to previously rendered slides
  • leaving presentation mode
  • entering presentation mode again
  • OpenSong remaining running after presentation cleanup
  • helper services starting after a system reboot

The patch was also applied with:

patch -p0 --dry-run

against a clean SVN export of r1825 and applied without rejected hunks.

The implementation intentionally uses OpenSong's existing ExternalRenderer
protocol rather than introducing a separate presentation output path.

The Python rendering backend is kept separate from the Xojo code so it can be
changed or extended independently from OpenSong's ExternalRenderer protocol.

I can provide additional test logs or adjust the integration/layout if the
maintainers prefer the helper scripts to live in a different location in the
source tree.

1 Attachments

Discussion

Anonymous
Anonymous

Add attachments
Cancel