Bug 486468 - Phonon-vlc with pipewire output crashes when Phonon::AudioOutput::setVolume is called without media
Summary: Phonon-vlc with pipewire output crashes when Phonon::AudioOutput::setVolume i...
Status: REPORTED
Alias: None
Product: Phonon
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
: 486140 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-05-02 18:57 UTC by Jérôme Villafruela
Modified: 2024-05-08 16:49 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Result of amarok --debug (79.69 KB, text/plain)
2024-05-08 15:47 UTC, Jérôme Villafruela
Details
Result of amarok --debug-audio (7.83 KB, text/plain)
2024-05-08 15:47 UTC, Jérôme Villafruela
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jérôme Villafruela 2024-05-02 18:57:29 UTC
SUMMARY

amarok crashes at startup on Fedora 40

STEPS TO REPRODUCE
1.  dnf install amarok
2.  launch amarok 

OBSERVED RESULT
Messages on console then crash.

EXPECTED RESULT

Application launch

SOFTWARE/OS VERSIONS

Operating System: Fedora Linux 40
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0
Kernel Version: 6.8.7-300.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 8 × AMD Ryzen 3 3300X 4-Core Processor
Memory: 15.5 Gio of RAM
Graphics Processor: AMD Radeon Pro WX 2100
Manufacturer: ASUS

ADDITIONAL INFORMATION

Messages at startup 

$ LANG=C amarok
QObject::connect: No such signal Phonon::VLC::MediaObject::angleChanged(int)
QObject::connect: No such signal Phonon::VLC::MediaObject::availableAnglesChanged(int)
Got ERROR: "Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist" errno: 2000
QObject::connect(Playlist::Model, Playlist::ProxyBase): invalid nullptr parameter
QObject::connect(Playlist::Model, Playlist::ProxyBase): invalid nullptr parameter
QObject::connect(Playlist::Model, Playlist::ProxyBase): invalid nullptr parameter
QObject::connect(Playlist::Model, Playlist::ProxyBase): invalid nullptr parameter
QWidget::insertAction: Attempt to insert null action
QWidget::insertAction: Attempt to insert null action
KCrash: Application 'amarok' crashing...
The Wayland connection experienced a fatal error: Bad file descriptor


$ gdb amarok
GNU gdb (Fedora Linux) 14.2-1.fc40
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 "x86_64-redhat-linux-gnu".
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 amarok...

This GDB supports auto-downloading debuginfo from the following URLs:
  <https://debuginfod.fedoraproject.org/>
Enable debuginfod for this session? (y or [n]) y
Debuginfod has been enabled.
To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit.
Reading symbols from /home/jerome/.cache/debuginfod_client/541716f6d68e128a9e1c16b4bfba7af24e3b7135/debuginfo...
(gdb) run
Starting program: /usr/bin/amarok
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffe14006c0 (LWP 19315)]
[New Thread 0x7fffe0a006c0 (LWP 19316)]
[New Thread 0x7fffdb2006c0 (LWP 19317)]
[New Thread 0x7fffd3e006c0 (LWP 19318)]
[New Thread 0x7fffd34006c0 (LWP 19319)]
[New Thread 0x7fffd2a006c0 (LWP 19320)]
[New Thread 0x7fffd20006c0 (LWP 19321)]
[New Thread 0x7fffd16006c0 (LWP 19322)]
[New Thread 0x7fffd0c006c0 (LWP 19323)]
[New Thread 0x7fffc4c006c0 (LWP 19324)]
[New Thread 0x7fffbfe006c0 (LWP 19325)]
[New Thread 0x7fffbf4006c0 (LWP 19326)]
[New Thread 0x7fffbea006c0 (LWP 19327)]
[New Thread 0x7fffbe0006c0 (LWP 19328)]
[New Thread 0x7fffbd6006c0 (LWP 19329)]
[Thread 0x7fffbd6006c0 (LWP 19329) exited]
[Thread 0x7fffbe0006c0 (LWP 19328) exited]
[Thread 0x7fffbea006c0 (LWP 19327) exited]
[Thread 0x7fffbf4006c0 (LWP 19326) exited]
[Thread 0x7fffbfe006c0 (LWP 19325) exited]
[Thread 0x7fffc4c006c0 (LWP 19324) exited]
[New Thread 0x7fffc4c006c0 (LWP 19330)]
[New Thread 0x7fffbfe006c0 (LWP 19331)]
[New Thread 0x7fffbf4006c0 (LWP 19332)]
[New Thread 0x7fffbea006c0 (LWP 19333)]
[New Thread 0x7fffbe0006c0 (LWP 19334)]
[New Thread 0x7fffbd6006c0 (LWP 19335)]
[New Thread 0x7fffbcc006c0 (LWP 19336)]
[New Thread 0x7fffa7e006c0 (LWP 19337)]
QObject::connect: No such signal Phonon::VLC::MediaObject::angleChanged(int)
QObject::connect: No such signal Phonon::VLC::MediaObject::availableAnglesChanged(int)
[New Thread 0x7fffd0c5d6c0 (LWP 19338)]
[New Thread 0x7fff9b8006c0 (LWP 19339)]
Got ERROR: "Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist" errno: 2000
[New Thread 0x7fff9ae006c0 (LWP 19340)]
[New Thread 0x7fff9a4006c0 (LWP 19341)]
[New Thread 0x7fff99a006c0 (LWP 19342)]
[New Thread 0x7fff990006c0 (LWP 19343)]
[New Thread 0x7fff8fe006c0 (LWP 19344)]
[New Thread 0x7fff8f4006c0 (LWP 19345)]
[New Thread 0x7fff8ea006c0 (LWP 19346)]
[New Thread 0x7fff8e0006c0 (LWP 19347)]
[New Thread 0x7fff8d6006c0 (LWP 19348)]
[New Thread 0x7fff8cc006c0 (LWP 19349)]
[New Thread 0x7fff83e006c0 (LWP 19350)]
[New Thread 0x7fff834006c0 (LWP 19351)]
[New Thread 0x7fff82a006c0 (LWP 19352)]
[New Thread 0x7fff820006c0 (LWP 19353)]
[New Thread 0x7fff816006c0 (LWP 19354)]
[New Thread 0x7fff80c006c0 (LWP 19355)]
[New Thread 0x7fff77e006c0 (LWP 19356)]
[New Thread 0x7fff774006c0 (LWP 19357)]
QObject::connect(Playlist::Model, Playlist::ProxyBase): invalid nullptr parameter
QObject::connect(Playlist::Model, Playlist::ProxyBase): invalid nullptr parameter
QObject::connect(Playlist::Model, Playlist::ProxyBase): invalid nullptr parameter
QObject::connect(Playlist::Model, Playlist::ProxyBase): invalid nullptr parameter
[New Thread 0x7fff76a006c0 (LWP 19358)]
[New Thread 0x7fff760006c0 (LWP 19359)]
QWidget::insertAction: Attempt to insert null action
QWidget::insertAction: Attempt to insert null action

Thread 1 "amarok" received signal SIGSEGV, Segmentation fault.
vlc_pw_lock (ctx=0x8000000300080005) at modules/audio_output/vlc_pipewire.c:76
76          pw_thread_loop_lock(ctx->loop);
(gdb) backtrace
#0  vlc_pw_lock (ctx=0x8000000300080005) at modules/audio_output/vlc_pipewire.c:76
#1  0x00007fffdb20da56 in vlc_pw_stream_set_volume (s=0x555555b43fb0, vol=0.709999979)
    at modules/audio_output/pipewire.c:377
#2  0x00007fffdb20dba0 in VolumeSet (aout=<optimized out>, volume=<optimized out>)
    at modules/audio_output/pipewire.c:658
#3  0x00007fffdb2709b9 in aout_OutputVolumeSet (vol=<optimized out>, aout=0x5555556a7ac0)
    at audio_output/output.c:659
#4  aout_OutputUnlock (aout=0x5555556a7ac0) at audio_output/output.c:704
#5  0x00007fffdb276f48 in aout_VolumeSet (aout=aout@entry=0x5555556a7ac0, vol=vol@entry=0.709999979)
    at audio_output/output.c:748
#6  0x00007fffda9edb6b in libvlc_audio_set_volume (mp=<optimized out>, volume=<optimized out>)
    at /usr/src/debug/vlc-3.0.20-12.fc40.x86_64/lib/audio.c:368
#7  0x00007fffdb30a509 in Phonon::VLC::MediaPlayer::setVolumeInternal (this=<optimized out>)
    at /usr/src/debug/phonon-backend-vlc-0.12.0-3.fc40.x86_64/src/mediaplayer.cpp:395
#8  Phonon::VLC::MediaPlayer::setAudioVolume (volume=71, this=<optimized out>)
    at /usr/src/debug/phonon-backend-vlc-0.12.0-3.fc40.x86_64/src/mediaplayer.cpp:380
#9  Phonon::VLC::AudioOutput::applyVolume (this=<optimized out>)
    at /usr/src/debug/phonon-backend-vlc-0.12.0-3.fc40.x86_64/src/audio/audiooutput.cpp:216
#10 0x00007ffff761761f in Phonon::AudioOutput::setVolume (this=<optimized out>, volume=0.80000000000000004)
    at /usr/src/debug/phonon-4.12.0-5.fc40.x86_64/phonon/audiooutput.cpp:170
#11 0x00007ffff7c48744 in EngineController::setVolume (this=this@entry=0x5555558a8980, percent=80)
    at /usr/src/debug/amarok-2.9.71^git20240330.7ec45dd-1.fc40.x86_64/src/EngineController.cpp:684
#12 0x00007ffff7c504ca in App::continueInit (this=this@entry=0x7fffffffd9a0)
    at /usr/src/debug/amarok-2.9.71^git20240330.7ec45dd-1.fc40.x86_64/src/App.cpp:487
#13 0x000055555555c8e1 in main (argc=<optimized out>, argv=<optimized out>)
    at /usr/src/debug/amarok-2.9.71^git20240330.7ec45dd-1.fc40.x86_64/src/main.cpp:388
(gdb)
Comment 1 Tuomas Nurmi 2024-05-02 21:03:52 UTC
Thank you for your report! Looking at the backtrace, the fact that the crash happens very early during initialization suggests there might be something problematic with how phonon-vlc backend interacts with pipewire. This might be a long shot, but could you try if similar crashes happen when starting up e.g. Dragon player? (which also uses phonon for audio playback)
Comment 2 Jérôme Villafruela 2024-05-03 17:28:36 UTC
(In reply to Tuomas Nurmi from comment #1)

Thanks for you quick response. Dragon Player starts fine with these messages :

$ dragon
qt.core.qobject.connect: QObject::connect: No such signal Phonon::VLC::MediaObject::angleChanged(int)
qt.core.qobject.connect: QObject::connect: No such signal Phonon::VLC::MediaObject::availableAnglesChanged(int)
qt.core.qobject.connect: QObject::connect: No such signal Phonon::VLC::MediaObject::angleChanged(int)
qt.core.qobject.connect: QObject::connect: No such signal Phonon::VLC::MediaObject::availableAnglesChanged(int)
Comment 3 Tuomas Nurmi 2024-05-04 17:03:07 UTC
(In reply to Jérôme Villafruela from comment #2)
> (In reply to Tuomas Nurmi from comment #1)
> 
> Thanks for you quick response. Dragon Player starts fine with these messages

Okay, thank you for testing. I haven't encountered this myself, and it doesn't seem to affect every Fedora user, either. I'll probably try installing a Fedora system myself and see if I could reproduce this somehow sometime later.
Comment 4 Jérôme Villafruela 2024-05-06 11:47:36 UTC
I made some tests on another machine (Lenovo ThinkCentre M710q)

- On Fedora 39 (amarok v2.9.70) : OK
- On a fresh install of Fedora 40  : crash  (iso used : Fedora-KDE-Live-x86_64-40-1.14.iso )
- After updating the Fedora 40 : crash
Comment 5 Tuomas Nurmi 2024-05-06 21:06:01 UTC
*** Bug 486140 has been marked as a duplicate of this bug. ***
Comment 6 Tuomas Nurmi 2024-05-06 21:41:59 UTC
Ok, I installed Fedora 40 in VirtualBox.
Installed Amarok 2.9.71 from default installation source. Tried starting it: No crash, I was able to play music normally. Phonon-vlc backend (Qt5) seemed to be in use. I'm not that familiar with pipewire, but I figured I could try starting wireplumber. That caused Amarok to get stuck during startup, although didn't crash (and that seemed to make everything else using sound get stuck during startup, too). Was fixed after a reboot. Tried installing Helvum. Amarok was displayed there as connected to output channels, everything looked quite normal.

No success in finding the root cause of the crash yet.

A useful note: To get proper debugging output from `amarok --debug` on Fedora, one should edit /usr/share/qt5/qtlogging.ini to read something like
[Rules]
*.debug=true
qt.qpa.xcb.xcberror.warning=false
qt.*=false
kf.*=false
Comment 7 Jérôme Villafruela 2024-05-08 15:47:01 UTC
Created attachment 169318 [details]
Result of amarok --debug

With debug enabled in qtlogging.ini as indicated by Tuomas (comment #6)
Comment 8 Jérôme Villafruela 2024-05-08 15:47:56 UTC
Created attachment 169319 [details]
Result of amarok --debug-audio

With debug enabled in qtlogging.ini as indicated by Tuomas (comment #6)
Comment 9 Tuomas Nurmi 2024-05-08 16:11:02 UTC
Thank you for the new debug outputs!
I just managed to find how to reproduce this in my VirtualBox Fedora 40:
If I run phononsettings, select "Show additional devices" (or what ever that may be in English), and make PipeWire Sound Server the primary audio output device, Amarok crashes on startup, corresponding to your experience.
Not sure if this is actually a bug in Phonon, but I'll see if the crash can be avoided with changing Amarok's code now that I can reproduce this. Good.
Comment 10 Tuomas Nurmi 2024-05-08 16:46:47 UTC
Managed to crash dragonplayer, too, so this is pretty clearly a phonon bug. Editing bug metadata.

Crash seems to happen often/always when Phonon::AudioOutput::setVolume is called while no media is loaded. 

Reproducible at least on Fedora 40, phononsettings -> select "Show additional devices" (or what ever that may be in English), and make PipeWire Sound Server the primary audio output device -> try starting up amarok or dragon a couple of times

Backtrace from crashing dragonplayer run through gdb, took about 5 tries to get it crash.
Starting program: /usr/bin/dragon 
[Thread debugging using libthread_db enabled]                                                                          
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffe34006c0 (LWP 18422)]                                                                                
[New Thread 0x7fffe1c006c0 (LWP 18423)]                                                                                
[New Thread 0x7fffe12006c0 (LWP 18424)]
[New Thread 0x7fffdbe006c0 (LWP 18425)]
[New Thread 0x7fffdb4006c0 (LWP 18426)]                                                                                
[New Thread 0x7fffdaa006c0 (LWP 18427)]
[New Thread 0x7fffda0006c0 (LWP 18428)]                                                                                
[New Thread 0x7fffd96006c0 (LWP 18429)]
[New Thread 0x7fffd8c006c0 (LWP 18430)]
MESA: error: ZINK: failed to choose pdev                                                                               
libEGL warning: egl: failed to create dri2 screen
[New Thread 0x7fffcd8006c0 (LWP 18431)]                                                                                
[New Thread 0x7fffcce006c0 (LWP 18432)]
[New Thread 0x7fffc3e006c0 (LWP 18433)]
[New Thread 0x7fffc34006c0 (LWP 18434)]
[New Thread 0x7fffc2a006c0 (LWP 18435)]
[New Thread 0x7fffc20006c0 (LWP 18436)]
[New Thread 0x7fffc16006c0 (LWP 18437)]
[New Thread 0x7fffc0c006c0 (LWP 18438)]                                                                                
[New Thread 0x7fffb7e006c0 (LWP 18439)]
[New Thread 0x7fffb74006c0 (LWP 18440)]
[New Thread 0x7fffb6a006c0 (LWP 18441)]                                                                                
[New Thread 0x7fffb60006c0 (LWP 18442)]
qt.core.qobject.connect: QObject::connect: No such signal Phonon::VLC::MediaObject::angleChanged(int)
qt.core.qobject.connect: QObject::connect: No such signal Phonon::VLC::MediaObject::availableAnglesChanged(int)
qt.core.qobject.connect: QObject::connect: No such signal Phonon::VLC::MediaObject::angleChanged(int)
qt.core.qobject.connect: QObject::connect: No such signal Phonon::VLC::MediaObject::availableAnglesChanged(int)

Thread 1 "dragon" received signal SIGSEGV, Segmentation fault.
___pthread_mutex_lock (mutex=mutex@entry=0x28) at pthread_mutex_lock.c:80
80        unsigned int type = PTHREAD_MUTEX_TYPE_ELISION (mutex);                                                      
(gdb) bt
#0  ___pthread_mutex_lock (mutex=mutex@entry=0x28) at pthread_mutex_lock.c:80
#1  0x00007fffdbfc3957 in do_lock.isra.0 (this=this@entry=0x0) at ../src/pipewire/thread-loop.c:53
#2  0x00007fffdbfc3a05 in pw_thread_loop_lock (loop=0x0) at ../src/pipewire/thread-loop.c:371
#3  0x00007fffe016e97c in vlc_pw_lock (ctx=<optimized out>) at modules/audio_output/vlc_pipewire.c:76
#4  0x00007fffe016ea56 in vlc_pw_stream_set_volume (s=0x7ffff55f6b20 <main_arena+96>, vol=0.180000007)
    at modules/audio_output/pipewire.c:377
#5  0x00007fffe016eba0 in VolumeSet (aout=<optimized out>, volume=<optimized out>)
    at modules/audio_output/pipewire.c:658
#6  0x00007fffe031f9b9 in aout_OutputVolumeSet (vol=<optimized out>, aout=0x55555736d6c0) at audio_output/output.c:659
#7  aout_OutputUnlock (aout=0x55555736d6c0) at audio_output/output.c:704
#8  0x00007fffe0325f48 in aout_VolumeSet (aout=aout@entry=0x55555736d6c0, vol=vol@entry=0.180000007)
    at audio_output/output.c:748
#9  0x00007fffe02afb6b in libvlc_audio_set_volume (mp=<optimized out>, volume=<optimized out>)
    at /usr/src/debug/vlc-3.0.20-12.fc40.x86_64/lib/audio.c:368
#10 0x00007fffe03bc749 in Phonon::VLC::MediaPlayer::setVolumeInternal (this=<optimized out>)
    at /usr/src/debug/phonon-backend-vlc-0.12.0-3.fc40.x86_64/src/mediaplayer.cpp:395
#11 Phonon::VLC::MediaPlayer::setAudioVolume (volume=18, this=<optimized out>)
    at /usr/src/debug/phonon-backend-vlc-0.12.0-3.fc40.x86_64/src/mediaplayer.cpp:380
#12 Phonon::VLC::AudioOutput::applyVolume (this=<optimized out>)
    at /usr/src/debug/phonon-backend-vlc-0.12.0-3.fc40.x86_64/src/audio/audiooutput.cpp:216
#13 0x00007ffff7e2ff35 in Phonon::AudioOutput::setVolume (this=<optimized out>, volume=0.31698053201323556)
    at /usr/src/debug/phonon-4.12.0-5.fc40.x86_64/phonon/audiooutput.cpp:170
#14 0x000055555558bdf8 in Dragon::VideoWindow::VideoWindow (this=<optimized out>, parent=0x555555841b40)
    at /usr/src/debug/dragon-24.02.2-1.fc40.x86_64/src/app/videoWindow.cpp:142
#15 Dragon::MainWindow::MainWindow (this=0x555555841b40, this=<optimized out>)
    at /usr/src/debug/dragon-24.02.2-1.fc40.x86_64/src/app/mainWindow.cpp:101
#16 0x00005555555804c5 in Dragon::PlayerApplication::newInstance (this=0x7fffffffdc30, playDisc=false, uris=...)
    at /usr/src/debug/dragon-24.02.2-1.fc40.x86_64/src/app/playerApplication.cpp:58
#17 0x0000555555570c8d in main (argc=<optimized out>, argv=<optimized out>)
    at /usr/src/debug/dragon-24.02.2-1.fc40.x86_64/src/app/main.cpp:77
(gdb)