系统可以是Ubuntu或者Debian,ARM、X86均可
Ubuntu20.04 -> pulseaudio 13.99 ✓
Debian11 -> pulseaudio 14.2 ✓
Ubuntu22.04 -> pulseaudio 15.99 ✗
Ubuntu不能高于20.04,低版本理论可行
更新! Pulseaudio官方给了一键脚本,我在Ubuntu23上试验成功,应该是没有版本限制了
脚本在此 -> Build on Debian or Ubuntu · neutrinolabs/pulseaudio-module-xrdp Wiki
如果用脚本安装并root登录桌面,必须执行文章下面debug红字部分,否则root没声音!!!
参考 甲骨文ARM Gnome桌面配置
先配置源
手动配置Pulseaudio
apt update;apt upgrade -y; apt-get install software-properties-common -y apt-get install git libpulse-dev autoconf m4 intltool dpkg-dev libtool libsndfile-dev libcap-dev libjson-c-dev make gcc curl wget -y apt-get build-dep pulseaudio -y apt source pulseaudio 权限报错,请删除“pulseaudio-13.99.1”文件夹 rm -rf pulseaudio-13.99.1 chmod 777 pulseaudio* apt source pulseaudio cd pulseaudio-13.99.1 环境不同,自行解决依赖关系 ./configure cd ../ git clone https://github.com/neutrinolabs/pulseaudio-module-xrdp.git cd pulseaudio-module-xrdp ./bootstrap ./configure PULSE_DIR="/root/pulseaudio-13.99.1" make 先执行 pulseaudio 如果提示命令不存在,参考下面的额外步骤手动安装 如果命令存在,按ctrl+c结束,回到正常步骤 额外步骤 cd ~;cd pulseaudio-13.99.1 额外步骤 make 额外步骤 make install 最后 cd ../;cd pulseaudio-module-xrdp 然后继续执行下面几步 cd src/.libs install -t "/var/lib/xrdp-pulseaudio-installer" -D -m 644 *.so install -t "/usr/lib/pulse-13.99.1/modules" -D -m 644 *.so reboot
配置完成后,远程桌面这两个勾上,使用非root账户登陆服务器,可以识别到声卡<伪输出>
重启pulseaudio,声卡变成<xrdp sink>,这样就有声音了
pulseaudio -k //这里卡住按ctrl+c强行结束 killall pulseaudio //这里卡住按ctrl+c强行结束 pulseaudio &
非ubuntu系统可以安装pavucontrol音频管理器
下面是debug部分
1.执行 pulseaudio & ,声卡变成<xrdp sink>,点击测试没有声音,终端输出 [xrdp-sink] module-xrdp-sink.c: sink_process_msg: not running,这是因为模块module-xrdp-sink 没有加载
解决方法:在文件 /etc/pulse/default.pa 末尾另起一行,添加 load-module module-xrdp-sink 保存重启
2.root用户需要执行以下命令,将root添加到pulse组
gpasswd -a root pulse
gpasswd -a root pulse-access
同时去除pulseaudio对root的限制
cd /lib/systemd/user/
编辑如下三个文件
pulseaudio.service
pulseaudio.socket
pulseaudio-x11.service (如无则无)
将其中的 ConditionUser=!root 这一行注释掉,也就是行前加#
pulseaudio自启动方法 (普通用户无需执行,root用户先尝试上面两步,如不行再配置自启动)
vim /voice.sh //在根目录新建voice.sh #! /bin/bash sleep 10s su root -c "pulseaudio -k" su root -c "pulseaudio &" //按esc,再输入:wq回车,保存文件
执行 chmod 777 /voice.sh 赋权
重启以root身份登录就可以了,非root用户确保要有执行voice.sh的权限
源有问题可以参考我的sources.list
deb http://ports.ubuntu.com/ focal-security main restricted deb http://ports.ubuntu.com/ focal main restricted deb http://ports.ubuntu.com/ focal-updates main restricted deb http://ports.ubuntu.com/ focal universe deb http://ports.ubuntu.com/ focal-updates universe deb http://ports.ubuntu.com/ focal multiverse deb http://ports.ubuntu.com/ focal-updates multiverse deb http://ports.ubuntu.com/ focal-backports main restricted universe multiverse deb http://archive.canonical.com/ubuntu focal partner deb-src http://archive.canonical.com/ubuntu focal partner deb http://ports.ubuntu.com/ubuntu-ports focal-security main restricted deb-src http://ports.ubuntu.com/ubuntu-ports focal-security main universe restricted multiverse deb http://ports.ubuntu.com/ubuntu-ports focal-security universe deb http://ports.ubuntu.com/ubuntu-ports focal-security multiverse deb http://ports.ubuntu.com/ubuntu-ports/ focal main universe restricted multiverse deb-src http://ports.ubuntu.com/ubuntu-ports/ focal main universe restricted multiverse
官方源,还有报错就换这个
deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse deb http://archive.canonical.com/ubuntu focal partner deb-src http://archive.canonical.com/ubuntu focal partner
已有 4014 位网友参与,快来吐槽:
发表评论