MediaPlayer Segfault with null defaultAudioOutput
-
I have custom board with CM4 and MAX98357A for sound.
Sound system - ALSA (without PulseAudio. I have problems with it)
I use dev.xml (Qt 6.7.0) manifest in boot2qt distro.
I have app that consist of many QML files. Its under active development. App works fine without SoundEffect. After start I can see GUI after 5 sec. Switching menu( each menu in separate file and activated by Loader in QML) - less second.When I add SoundEffect to my app it dramatically slow down. Loading app before GUI shown - 20 sec. Switching menu - near 5 sec.
I use +- 20 SoundEffect, with different sound files source in my code. Is it correct practice or I must use one SoundEffect and change source var on it?
-
I also try switch from SoundEffect to MediaPlayer but get SEGFAULTS
MediaPlayer { id: lostLinkSound source: "qrc:/qml/Component/Sound/lost_link_"+trans.currentLanguage+".wav" audioOutput: AudioOutput {} }
Log for error
gdb ./Ferti GNU gdb (GDB) 13.2 Copyright (C) 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "arm-poky-linux-gnueabi". Type "show configuration" for configuration details. For bug reporting instructions, please see: <https://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./Ferti... (gdb) r Starting program: /usr/lib/Ferti [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/libthread_db.so.1". [New Thread 0xb2b202c0 (LWP 29448)] [New Thread 0xb188b2c0 (LWP 29449)] [Detaching after vfork from child process 29450] [Detaching after vfork from child process 29455] [New Thread 0xb0d822c0 (LWP 29456)] [New Thread 0xaed3a2c0 (LWP 29457)] Thread 1 "Ferti" received signal SIGSEGV, Segmentation fault. 0xaef219b0 in gst_device_create_element () from /lib/libgstreamer-1.0.so.0
-
More info and tests
root@b2qt-raspberrypi4:/usr/lib# aplay -L null Discard all samples (playback) or generate zero samples (capture) sysdefault:CARD=MAX98357A MAX98357A, bcm2835-i2s-HiFi HiFi-0 Default Audio Device root@b2qt-raspberrypi4:/usr/lib# aplay -l **** List of PLAYBACK Hardware Devices **** card 0: MAX98357A [MAX98357A], device 0: bcm2835-i2s-HiFi HiFi-0 [bcm2835-i2s-HiFi HiFi-0] Subdevices: 1/1 Subdevice #0: subdevice #0 root@b2qt-raspberrypi4:/usr/lib#
I add in my code.
MediaDevices { id: mediaDevices Component.onCompleted: { console.log("Outputs Audio devices List: " + audioOutputs) console.log("Outputs Audio devices (defaults): " + defaultAudioOutput) } }
In log I see
qml: Outputs Audio devices List: QAudioDevice(default, , true, Output),QAudioDevice(sysdefault:CARD=MAX98357A, MAX98357A, bcm2835-i2s-HiFi HiFi-0 Default Audio Device, false, Output) qml: Outputs Audio devices (defaults): QAudioDevice(default, , true, Output)
And when I add
MediaPlayer { id: playMessage source: "" audioOutput: AudioOutput { id: playerOutput device: mediaDevices.defaultAudioOutput } }
it SEGFAULTS
-
Hi,
The segmentation fault seem to have occurred in libgstreamer. Can you check that GStreamer is working properly ?
-
@SGaist
I hear sound only when manually specify output audio device (without parameters I get no sound, but see how time is changing 0:00:12.0 / 0:01:00.0 )gst-play-1.0 BabyElephantWalk60.wav --audiosink='alsasink device=hw:0,0'
p.s.
my asound.confpcm.speakerbonnet { type hw card 0 } pcm.dmixer { type dmix ipc_key 1024 ipc_perm 0666 slave { pcm "speakerbonnet" period_time 0 period_size 1024 buffer_size 8192 rate 44100 channels 2 } } ctl.dmixer { type hw card 0 } pcm.softvol { type softvol slave.pcm "dmixer" control.name "PCM" control.card 0 } ctl.softvol { type hw card 0 } pcm.!default { type plug slave.pcm "softvol" }
-
Looks like there's an issue on your system. Are you sure it's properly configured ?
-
Are you sure alsa is properly configured for your hardware ?