Remove xvfb and use SDL env variable instead

It turns out that xvfb and Windows don't really work together, even if it's inside of a docker.
This commit is contained in:
Lorenzo Carletti 2021-12-30 22:08:25 +01:00
parent 025d617b02
commit 56788421aa
3 changed files with 3 additions and 20 deletions

View File

@ -49,8 +49,8 @@ RUN cd mgba && mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr
FROM builder AS tester
USER root
RUN apt-get update && \
apt-get install -y --no-install-recommends xvfb pulseaudio alsa-utils libsdl2-dev \
libzip-dev libavcodec-dev libavfilter-dev x11-utils && \
apt-get install -y --no-install-recommends pulseaudio alsa-utils libsdl2-dev \
libzip-dev libavcodec-dev libavfilter-dev && \
apt-get autoremove -y && apt-get clean
WORKDIR /opt/src
USER m2gba

View File

@ -1,9 +1,7 @@
#!/bin/pwsh
"Starting Dummy services"
Xvfb :1 -screen 0 1024x768x16 &
$Env:DISPLAY = ":1.0"
bash /home/m2gba/src/docker-scripts/xvfb_ready.sh
$Env:SDL_VIDEODRIVER = "dummy"
pulseaudio -D --exit-idle-time=-1
pactl load-module module-null-sink sink_name=SpeakerOutput sink_properties=device.description="Dummy_Output"

View File

@ -1,15 +0,0 @@
#!/bin/bash
# Wait for Xvfb
MAX_ATTEMPTS=120 # About 60 seconds
COUNT=0
echo -n "Waiting for Xvfb to be ready..."
while ! xdpyinfo -display "${DISPLAY}" >/dev/null 2>&1; do
echo -n "."
sleep 0.50s
COUNT=$(( COUNT + 1 ))
if [ "${COUNT}" -ge "${MAX_ATTEMPTS}" ]; then
echo " Gave up waiting for X server on ${DISPLAY}"
exit 1
fi
done
echo " Done - Xvfb is ready!"