diff -pruN 3.0.5-1/debian/changelog 3.0.5-1ubuntu1/debian/changelog
--- 3.0.5-1/debian/changelog	2021-09-30 07:16:58.000000000 +0000
+++ 3.0.5-1ubuntu1/debian/changelog	2022-03-31 02:49:21.000000000 +0000
@@ -1,3 +1,9 @@
+ukui-session-manager (3.0.5-1ubuntu1) jammy; urgency=medium
+
+  * d/patches: add 01-fix-crash-while-play-music.patch. (LP: #1967040)
+
+ -- handsome_feng <jianfengli@ubuntukylin.com>  Thu, 31 Mar 2022 10:49:21 +0800
+
 ukui-session-manager (3.0.5-1) unstable; urgency=medium
 
   * New upstream bugfix release. (LP: #1945570)
diff -pruN 3.0.5-1/debian/patches/01-fix-crash-while-play-music.patch 3.0.5-1ubuntu1/debian/patches/01-fix-crash-while-play-music.patch
--- 3.0.5-1/debian/patches/01-fix-crash-while-play-music.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0.5-1ubuntu1/debian/patches/01-fix-crash-while-play-music.patch	2022-03-31 02:22:40.000000000 +0000
@@ -0,0 +1,230 @@
+Index: ukui-session-manager/tools/main.cpp
+===================================================================
+--- ukui-session-manager.orig/tools/main.cpp
++++ ukui-session-manager/tools/main.cpp
+@@ -43,6 +43,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <pwd.h>
++
+ //#include <ukui-log4qt.h>
+ 
+ #ifdef signals
+@@ -172,8 +173,7 @@ int check_lock()
+     return 0;
+ }
+ 
+-bool playShutdownMusic(UkuiPower &powermanager, int num, int cc, QTimer *up_to_time,
+-                       QSoundEffect *soundplayer)
++bool playShutdownMusic(UkuiPower &powermanager, int num, int cc, QTimer *up_to_time)
+ {
+     if (cc == 1) {
+         if (num == 1 || num == 5 || num == 6) {
+@@ -226,21 +226,29 @@ bool playShutdownMusic(UkuiPower &powerm
+         // up_to_time and soundplayer can not be define out of this if().
+         // otherwise run ukui-session-tools --suspend with segmente error.
+         // because they will be delate at the end of the playShutdownMusic().
++        QObject::connect(up_to_time, &QTimer::timeout, [&]() {
++            powermanager.doAction(UkuiPower::Action(action));
++            exit(0);
++        });
++        QString xdg_session_type = qgetenv("XDG_SESSION_TYPE");
+         if (num == 5 || num == 6) {
+-            soundplayer->setSource(QUrl::fromLocalFile("/usr/share/ukui/ukui-session-manager/shutdown.wav"));
++            if (xdg_session_type == "wayland") {
++                QProcess::startDetached("paplay --volume=23456 /usr/share/ukui/ukui-session-manager/shutdown.wav");
++            } else {
++                QProcess::startDetached("aplay /usr/share/ukui/ukui-session-manager/shutdown.wav");
++            }
++            up_to_time->start(1200);
+         } else if (num == 4) {
+-            soundplayer->setSource(QUrl::fromLocalFile("/usr/share/ukui/ukui-session-manager/logout.wav"));
++            if (xdg_session_type == "wayland") {
++                QProcess::startDetached("paplay --volume=23456 /usr/share/ukui/ukui-session-manager/logout.wav");
++            } else {
++                QProcess::startDetached("aplay /usr/share/ukui/ukui-session-manager/logout.wav");
++            }
++            up_to_time->start(1200);
+         } else {
+             qDebug() << "error num";
+             return false;
+         }
+-        // timeout set.
+-        QObject::connect(up_to_time, &QTimer::timeout, [&]() {
+-            powermanager.doAction(UkuiPower::Action(action));
+-            exit(0);
+-        });
+-        soundplayer->play();
+-        up_to_time->start(1200);
+     } else {
+         powermanager.doAction(UkuiPower::Action(action));
+         exit(0);
+@@ -297,8 +305,6 @@ int main(int argc, char *argv[])
+     // define in the main() avoid scope error.
+     QTimer *up_to_time = new QTimer();
+     up_to_time->setSingleShot(true);
+-    QSoundEffect *soundplayer = new QSoundEffect();
+-    soundplayer->setVolume(0.4);
+ 
+     QGSettings *gs = new QGSettings("org.ukui.session", "/org/ukui/desktop/session/");
+     gs->set("win-key-release", true);
+@@ -348,36 +354,36 @@ int main(int argc, char *argv[])
+     parser.process(a);
+ 
+     if (parser.isSet(switchuserOption)) {
+-        flag = playShutdownMusic(powermanager, 0, cc, up_to_time, soundplayer);
++        flag = playShutdownMusic(powermanager, 0, cc, up_to_time);
+     }
+     if (parser.isSet(hibernateOption)) {
+-        flag = playShutdownMusic(powermanager, 1, cc, up_to_time, soundplayer);
++        flag = playShutdownMusic(powermanager, 1, cc, up_to_time);
+     }
+     if (parser.isSet(suspendOption)) {
+-        flag = playShutdownMusic(powermanager, 2, cc, up_to_time, soundplayer);
++        flag = playShutdownMusic(powermanager, 2, cc, up_to_time);
+     }
+     if (parser.isSet(logoutOption)) {
+-        flag = playShutdownMusic(powermanager, 4, cc, up_to_time, soundplayer);
++        flag = playShutdownMusic(powermanager, 4, cc, up_to_time);
+     }
+     if (parser.isSet(rebootOption)) {
+         if (w->getLoginedUsers().count() > 1) {
+             if (messageboxCheck())
+-                flag = playShutdownMusic(powermanager, 5, cc, up_to_time, soundplayer);
++                flag = playShutdownMusic(powermanager, 5, cc, up_to_time);
+             else {
+                 return 0;
+             }
+         } else
+-            flag = playShutdownMusic(powermanager, 5, cc, up_to_time, soundplayer);
++            flag = playShutdownMusic(powermanager, 5, cc, up_to_time);
+     }
+     if (parser.isSet(shutdownOption)) {
+         if (w->getLoginedUsers().count() > 1) {
+             if (messageboxCheck())
+-                flag = playShutdownMusic(powermanager, 6, cc, up_to_time, soundplayer);
++                flag = playShutdownMusic(powermanager, 6, cc, up_to_time);
+             else {
+                 return 0;
+             }
+         } else
+-            flag = playShutdownMusic(powermanager, 6, cc, up_to_time, soundplayer);
++            flag = playShutdownMusic(powermanager, 6, cc, up_to_time);
+     }
+     if (parser.isSet(windowOption)) {
+         flag        = false;
+@@ -394,7 +400,7 @@ int main(int argc, char *argv[])
+         w->showFullScreen();
+         w->repaint();
+         QObject::connect(w, &MainWindow::signalTostart, [&]() {
+-            playShutdownMusic(powermanager, w->defaultnum, cc, up_to_time, soundplayer);
++            playShutdownMusic(powermanager, w->defaultnum, cc, up_to_time);
+         });
+     }
+ 
+Index: ukui-session-manager/ukui-session/main.cpp
+===================================================================
+--- ukui-session-manager.orig/ukui-session/main.cpp
++++ ukui-session-manager/ukui-session/main.cpp
+@@ -26,8 +26,8 @@
+ #include <QDateTime>
+ #include <QDebug>
+ #include <QTimer>
+-#include <QMediaPlayer>
+-#include <QSoundEffect>
++//#include <QMediaPlayer>
++//#include <QSoundEffect>
+ #include <QFileInfo>
+ #include <QScreen>
+ #include <QProcess>
+Index: ukui-session-manager/ukui-session/modulemanager.cpp
+===================================================================
+--- ukui-session-manager.orig/ukui-session/modulemanager.cpp
++++ ukui-session-manager/ukui-session/modulemanager.cpp
+@@ -54,33 +54,29 @@ void ModuleManager::playBootMusic(bool a
+             free(gset);
+             return;
+         }
+-        player = new QMediaPlayer;
+-        connect(player,SIGNAL(stateChanged(QMediaPlayer::State)),this,SLOT(stateChanged(QMediaPlayer::State)));
+-        player->setVolume(40);
+-        if(arg){
++        QString xdg_session_type = qgetenv("XDG_SESSION_TYPE");
++        if (arg) {
+             play_music = gset->get("startup-music").toBool();
+             if (play_music) {
+-                player->setMedia(QUrl::fromLocalFile("/usr/share/ukui/ukui-session-manager/startup.wav"));
+-                player->play();
++                if (xdg_session_type == "wayland") {
++                    QProcess::startDetached("paplay --volume=23456 /usr/share/ukui/ukui-session-manager/startup.wav");
++                } else {
++                    QProcess::startDetached("aplay  /usr/share/ukui/ukui-session-manager/startup.wav");
++                }
+             }
+-        }else{
++        } else {
+             play_music = gset->get("weakup-music").toBool();
+             if (play_music) {
+-                player->setMedia(QUrl::fromLocalFile("/usr/share/ukui/ukui-session-manager/weakup.wav"));
+-                player->play();
++                if (xdg_session_type == "wayland") {
++                    QProcess::startDetached("paplay --volume=23456 /usr/share/ukui/ukui-session-manager/weakup.wav");
++                } else {
++                    QProcess::startDetached("aplay /usr/share/ukui/ukui-session-manager/weakup.wav");
++                }
+             }
+         }
+     }
+ }
+ 
+-void ModuleManager::stateChanged(QMediaPlayer::State state){
+-    qDebug()<<"Player state: "<<state;
+-    if(state == QMediaPlayer::StoppedState){
+-        player->deleteLater();
+-        qDebug()<<"delete player";
+-    }
+-}
+-
+ ModuleManager::ModuleManager( QObject* parent)
+     : QObject(parent),
+       isPanelStarted(false),
+Index: ukui-session-manager/ukui-session/modulemanager.h
+===================================================================
+--- ukui-session-manager.orig/ukui-session/modulemanager.h
++++ ukui-session-manager/ukui-session/modulemanager.h
+@@ -30,7 +30,6 @@
+ #include <QVector>
+ #include <QMap>
+ #include <QTimer>
+-#include <QMediaPlayer>
+ #include <QDBusInterface>
+ 
+ class XdgDesktopFile;
+@@ -68,7 +67,6 @@ public slots:
+     void timerUpdate();
+     void timeup();
+     void weakup(bool arg);
+-    void stateChanged(QMediaPlayer::State state);
+ 
+ Q_SIGNALS:
+     void moduleStateChanged(QString moduleName, bool state);
+@@ -86,7 +84,6 @@ private:
+     bool start_module_Timer(QTimer *timer,int i);
+     bool isPanelStarted, isDesktopStarted, isWMStarted ,isCompsiteStarted;
+ 
+-    QMediaPlayer *player;
+     bool runUsd = true;
+     bool runWm = true;
+     bool runPanel = true;
+Index: ukui-session-manager/ukui-session/sessionapplication.cpp
+===================================================================
+--- ukui-session-manager.orig/ukui-session/sessionapplication.cpp
++++ ukui-session-manager/ukui-session/sessionapplication.cpp
+@@ -24,7 +24,6 @@
+ #include "idlewatcher.h"
+ 
+ #include <QDebug>
+-#include <QMediaPlayer>
+ #include <QDesktopWidget>
+ #include "../tools/ukuipower.h"
+ #include <QProcess>
diff -pruN 3.0.5-1/debian/patches/series 3.0.5-1ubuntu1/debian/patches/series
--- 3.0.5-1/debian/patches/series	1970-01-01 00:00:00.000000000 +0000
+++ 3.0.5-1ubuntu1/debian/patches/series	2022-03-31 02:20:50.000000000 +0000
@@ -0,0 +1 @@
+01-fix-crash-while-play-music.patch
