Timer based audio emulation issue

About Qemu-system-ppc, a PPC Mac emulator for Windows, macOS and Linux that can run Mac OS 9.0 up to Mac OS X 10.5

Moderators: Cat_7, Ronald P. Regensburg

Post Reply
psk6
Space Cadet
Posts: 6
Joined: Fri Feb 12, 2021 10:42 am

Timer based audio emulation issue

Post by psk6 »

Hello. I'm having a problem with qemu-screamer. I don't know how to fix it and I'd like to know if any of you have the same issue.

I'm using a Raspberry Pi 3b+ with Raspberry Pi OS Lite (2021.01.11). I downloaded all required libraries to build it and a few extra (git libsdl1.2-dev libsdl2-dev libglib2.0-dev libfdt-dev libpixman-1-dev zlib1g-dev meson xorg xscreensaver).

Then got the source from it's repository (git clone -b screamer https://github.com/mcayland/qemu qemu-screamer), configured it (./configure --target-list=ppc-softmmu --enable-sdl) and finally compiled it (make). There were no issues at all (I downloaded and compile the source several times with the same problem that is commented later on)

To test it I start Xorg and here is the problem:

If I run it with these to commands:
export QEMU_AUDIO_DRV=pa
qemu-system-ppc -M mac99,via=pmu -m 512 -sdl --drive file=/usb/Disk1.img,format=raw,media=disk (The hard disk is in a USB memory mounted in /usb)

I get this error:
audio: warning: Using timer based audio emulation
Aborted

And it doesn't work. The funny thing is that if I run qemu with sudo It works fine, MacOS 9.2.1 works a bit slow but without audio.

Does anyone know how to fix this?

Thanks.
psk6
Space Cadet
Posts: 6
Joined: Fri Feb 12, 2021 10:42 am

Re: Timer based audio emulation issue

Post by psk6 »

I get rid of the message, although still no audio on MacOS 9.2.1.

Acording to the Rappberry pi OS 2020-12-02 Changelog:
* PulseAudio now included and running by default

That seems to be true only for the full version, not for the lite ("apt-get install pulseaudio" fixed it)
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Timer based audio emulation issue

Post by Cat_7 »

Hi,

Can you check whether the pa daemon is actually running on your device after installation?

Was the pulseaudio backend recognised when you configured the source code?
Does the sound control panel/output tab in Mac OS show the spatializer audio device?

Best,
Cat_7
psk6
Space Cadet
Posts: 6
Joined: Fri Feb 12, 2021 10:42 am

Re: Timer based audio emulation issue

Post by psk6 »

I deleted everything, download the source code once more, configure and compile it and I'm back to step one:

audio: warning: Using timer based audio emulation
Aborted

According to "ps aux | grep pulseaudio" and "pactl info" pulse audio is up and running. "libpulse-dev" is installed and the Audio Driver finds both pa and oss:


Using './build' as the directory for build output
cross containers no
The Meson build system
Version: 0.55.3
Source dir: /home/pi/qemu-screamer
Build dir: /home/pi/qemu-screamer/build
Build type: native build
Project name: qemu
Project version: 5.2.50
C compiler for the host machine: cc (gcc 8.3.0 "cc (Raspbian 8.3.0-6+rpi1) 8.3.0")
C linker for the host machine: cc ld.bfd 2.31.1
Host machine cpu family: arm
Host machine cpu: armv7l
../meson.build:10: WARNING: Module unstable-keyval has no backwards or forwards compatibility and might not exist in future releases.
Program sh found: YES
Program python3 found: YES (/usr/bin/python3)
C++ compiler for the host machine: c++ (gcc 8.3.0 "c++ (Raspbian 8.3.0-6+rpi1) 8.3.0")
C++ linker for the host machine: c++ ld.bfd 2.31.1
Program cgcc found: NO
Library m found: YES
Library util found: YES
Run-time dependency appleframeworks found: NO (tried framework)
Found pkg-config: /usr/bin/pkg-config (0.29)
Run-time dependency pixman-1 found: YES 0.36.0
Library aio found: NO
Run-time dependency zlib found: YES 1.2.11
Run-time dependency libnfs found: NO (tried pkgconfig)
Run-time dependency libseccomp found: NO (tried pkgconfig)
Has header "cap-ng.h" : NO
Run-time dependency xkbcommon found: YES 0.8.2
Library rt found: YES
Run-time dependency libiscsi found: NO (tried pkgconfig)
Run-time dependency libzstd found: NO (tried pkgconfig)
Run-time dependency libcurl found: NO (tried pkgconfig)
Run-time dependency libudev found: YES 241
Library mpathpersist found: NO
Run-time dependency ncursesw found: NO (tried pkgconfig)
Has header "curses.h" : NO
Message: Trying with /usr/include/ncursesw
Has header "curses.h" : NO
Has header "brlapi.h" : NO
Run-time dependency sdl2 found: YES 2.0.9
Run-time dependency sdl2_image found: NO (tried pkgconfig)
Library rados found: NO
Has header "rbd/librbd.h" : NO
Run-time dependency glusterfs-api found: NO (tried pkgconfig)
Has header "bzlib.h" : NO
Has header "lzfse.h" : NO
Run-time dependency libpng found: YES 1.6.36
Run-time dependency libjpeg found: NO (tried pkgconfig)
Has header "sasl/sasl.h" : NO
Has header "snappy-c.h" : NO
Has header "lzo/lzo1x.h" : NO
Run-time dependency u2f-emu found: NO (tried pkgconfig)
Run-time dependency libkeyutils found: NO (tried pkgconfig)
Checking for function "gettid" : NO
Run-time dependency fuse3 found: NO (tried pkgconfig)
Has header "linux/btrfs.h" : YES
Has header "libdrm/drm.h" : NO
Has header "pty.h" : YES
Has header "sys/ioccom.h" : NO
Has header "sys/kcov.h" : NO
Has header "sys/signal.h" : YES
Program scripts/minikconf.py found: YES
Configuring ppc-softmmu-config-target.h using configuration
Configuring ppc-softmmu-config-devices.mak with command
Reading depfile: /home/pi/qemu-screamer/build/meson-private/ppc-softmmu-config-devices.mak.d
Configuring ppc-softmmu-config-devices.h using configuration
Run-time dependency capstone found: NO (tried pkgconfig)
Configuring capstone-defs.h using configuration
Run-time dependency slirp found: NO (tried pkgconfig)
Configuring libslirp-version.h using configuration
Library fdt found: YES
Configuring config-host.h using configuration
Program scripts/hxtool found: YES
Program scripts/shaderinclude.pl found: YES
Program scripts/qapi-gen.py found: YES
Program scripts/qemu-version.sh found: YES

|Executing subproject libvhost-user method meson
|
|Project name: libvhost-user
|Project version: undefined
|C compiler for the host machine: cc (gcc 8.3.0 "cc (Raspbian 8.3.0-6+rpi1) 8.3.0")
|C linker for the host machine: cc ld.bfd 2.31.1
|Dependency glib-2.0 found: YES 5.2.50 (overridden)
|Build targets in project: 11
|Subproject libvhost-user finished.

Run-time dependency threads found: YES
Program keycodemapdb/tools/keymap-gen found: YES
Program scripts/decodetree.py found: YES
Program ../scripts/modules/module_block.py found: YES
Program ../scripts/block-coroutine-wrapper.py found: YES
Program nm found: YES
Program scripts/undefsym.py found: YES
Program scripts/feature_to_c.sh found: YES
Configuring 50-edk2-i386-secure.json using configuration
Configuring 50-edk2-x86_64-secure.json using configuration
Configuring 60-edk2-aarch64.json using configuration
Configuring 60-edk2-arm.json using configuration
Configuring 60-edk2-i386.json using configuration
Configuring 60-edk2-x86_64.json using configuration
Program qemu-keymap found: NO
Program sphinx-build-3 sphinx-build found: NO
Program python3 found: YES (/usr/bin/python3)
Configuring common.env using configuration
Program diff found: YES
Program dbus-daemon found: YES
Program initrd-stress.sh found: YES
Build targets in project: 378

qemu 5.2.50

Install prefix: /usr/local
BIOS directory: share/qemu
firmware path: /usr/local/share/qemu-firmware
binary directory: bin
library directory: lib
module directory: lib/qemu
libexec directory: libexec
include directory: include
config directory: /usr/local/etc
local state directory: /usr/local/var
Manual directory: share/man
Doc directory: /usr/local/share/doc
Build directory: /home/pi/qemu-screamer/build
Source path: /home/pi/qemu-screamer
GIT binary: git
GIT submodules: ui/keycodemapdb tests/fp/berkeley-testfloat-3 tests/fp/berkeley-softfloat-3 meson dtc capstone slirp
C compiler: cc
Host C compiler: cc
C++ compiler: c++
ARFLAGS: rv
CFLAGS: -O2 -g
CXXFLAGS: -O2 -g
QEMU_CFLAGS: -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-declaration -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wimplicit-fallthrough=2 -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-psabi -fstack-protector-strong
QEMU_LDFLAGS: -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -fstack-protector-strong
make: make
python: /usr/bin/python3 (version: 3.7)
sphinx-build: NO
genisoimage:
slirp support: internal
smbd: "/usr/sbin/smbd"
module support: NO
host CPU: arm
host endianness: little
target list: ppc-softmmu
gprof enabled: NO
sparse enabled: NO
strip binaries: YES
profiler: NO
link-time optimization (LTO): NO
static build: NO
SDL support: YES
SDL image support: NO
GTK support: NO
GTK GL support: NO
pixman: YES
VTE support: NO
TLS priority: "NORMAL"
GNUTLS support: NO
libgcrypt: NO
nettle: NO
libtasn1: NO
PAM: NO
iconv support: YES
curses support: NO
virgl support: NO
curl support: NO
mingw32 support: NO
Audio drivers: pa oss
Block whitelist (rw):
Block whitelist (ro):
VirtFS support: NO
build virtiofs daemon: NO
Multipath support: NO
VNC support: YES
VNC SASL support: NO
VNC JPEG support: NO
VNC PNG support: YES
xen support: NO
brlapi support: NO
Documentation: NO
PIE: YES
vde support: NO
netmap support: NO
Linux AIO support: NO
Linux io_uring support: NO
ATTR/XATTR support: YES
Install blobs: YES
KVM support: NO
HAX support: NO
HVF support: NO
WHPX support: NO
TCG support: YES
TCG debug enabled: NO
TCG interpreter: NO
malloc trim support: YES
RDMA support: NO
PVRDMA support: NO
fdt support: internal
membarrier: NO
preadv support: YES
fdatasync: YES
madvise: YES
posix_madvise: YES
posix_memalign: YES
libcap-ng support: NO
vhost-kernel support: YES
vhost-net support: YES
vhost-crypto support: YES
vhost-scsi support: YES
vhost-vsock support: YES
vhost-user support: YES
vhost-user-blk server support: YES
vhost-user-fs support: YES
vhost-vdpa support: YES
Trace backends: log
spice support: NO
rbd support: NO
xfsctl support: NO
smartcard support: NO
U2F support: NO
libusb: NO
usb net redir: NO
OpenGL support: NO
OpenGL dmabufs: NO
libiscsi support: NO
libnfs support: NO
build guest agent: YES
seccomp support: NO
CFI support: NO
CFI debug support: NO
coroutine backend: ucontext
coroutine pool: YES
debug stack usage: NO
mutex debugging: NO
crypto afalg: NO
GlusterFS support: NO
gcov: NO
TPM support: YES
libssh support: NO
QOM debugging: YES
Live block migration: YES
lzo support: NO
snappy support: NO
bzip2 support: NO
lzfse support: NO
zstd support: NO
NUMA host support: NO
libxml2: NO
memory allocator: system
avx2 optimization: NO
avx512f optimization: NO
replication support: YES
bochs support: YES
cloop support: YES
dmg support: YES
qcow v1 support: YES
vdi support: YES
vvfat support: YES
qed support: YES
parallels support: YES
sheepdog support: NO
capstone: internal
libpmem support: NO
libdaxctl support: NO
libudev: YES
default devices: YES
plugin support: NO
fuzzing support: NO
gdb: /usr/bin/gdb
thread sanitizer: NO
rng-none: NO
Linux keyring: YES
FUSE exports: NO
FUSE lseek: NO

Subprojects
libvhost-user: YES

Found ninja-1.8.2 at /usr/bin/ninja



I have no idea what's going on.
psk6
Space Cadet
Posts: 6
Joined: Fri Feb 12, 2021 10:42 am

Re: Timer based audio emulation issue

Post by psk6 »

OK. Now I have sound on Raspberry Pi OS Lite. To compile:

./configure --target-list=ppc-softmmu --enable-sdl --audio-drv-list=sdl

And to run it:

export QEMU_AUDIO_DRV=sdl
qemu-system-ppc -M mac99,via=pmu -m 256 -sdl ...

The only issue is that the audio is output though the 3.5mm jack, despite that I never changed the audio settings, but at least it works.
psk6
Space Cadet
Posts: 6
Joined: Fri Feb 12, 2021 10:42 am

Re: Timer based audio emulation issue

Post by psk6 »

After solving other issues (starting it in fullscreen caused the mouse and keyboard not to be detected) I finally managed to get a raspberry pi 4 to automatically start Qemu-screamer on boot and... It isn't worth it: It's too slow (the pi 4 is overclocked at 2 GHz) and the audio has issues:

I tried to play a .wav file on QuickTime 5 and the audio plays 5-10 seconds ok, it's gone for 2-5 seconds, then it comes back (the playback doesn't stop, it simply doesn't sound) and repeats the cycle. So I removed all quicktime files (the extensionsm, the control panel and its folder) and tried with 4.1 to see if it was quicktime related and does the same thing.
User avatar
adespoton
Forum All-Star
Posts: 4226
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Timer based audio emulation issue

Post by adespoton »

psk6 wrote: Thu Feb 25, 2021 10:20 am After solving other issues (starting it in fullscreen caused the mouse and keyboard not to be detected) I finally managed to get a raspberry pi 4 to automatically start Qemu-screamer on boot and... It isn't worth it: It's too slow (the pi 4 is overclocked at 2 GHz) and the audio has issues:

I tried to play a .wav file on QuickTime 5 and the audio plays 5-10 seconds ok, it's gone for 2-5 seconds, then it comes back (the playback doesn't stop, it simply doesn't sound) and repeats the cycle. So I removed all quicktime files (the extensionsm, the control panel and its folder) and tried with 4.1 to see if it was quicktime related and does the same thing.
What guest OS are you running?
psk6
Space Cadet
Posts: 6
Joined: Fri Feb 12, 2021 10:42 am

Re: Timer based audio emulation issue

Post by psk6 »

Raspberry Pi OS Lite (2021.01.11)
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Timer based audio emulation issue

Post by Cat_7 »

I think adespoton asked about the guest, not the host ;-)

The guest is Mac OS 9.2. This has the best chance of producing acceptable sound. But needs the latest quicktime and itunes installed.
However, the sound builds suffer from some performance issues anyway, so if your host is not the fastest, this will result in drop-outs.

Best,
Cat_7
Post Reply