Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I need help to troubleshoot this: xrdp with audio in a NixOS container #101

Closed
lucasew opened this issue Aug 4, 2023 · 3 comments
Closed

Comments

@lucasew
Copy link

lucasew commented Aug 4, 2023

NixOS has a feature where you can define declarative containers that run using systemd-nspawn.

Right now I am able to run xfce and access it using RDP. The RDP port is exposed on the host and right now I am able to do basically anything but listen to stuff.

The way how it's now working (Nix package and container) the session starts, asks for login and the desktop works fine. The module of this repo appears in audio sources and sinks fine, bars wiggle, almost no problem. Except that my client doesn't play anything, not even garbled noise that happens when sync is not right or something like that, just complete silence.

One hypothesis that I though is that is something about /dev/snd not available then I passed it as a volume and still same problem.

I also though that it for some reason may be a chromium issue and tested with firefox but same problem.

Microphone never leaves zero, even though I configure the client to use that. It may be a config that is not allowed.

The host system is a Desktop ready system but I am only exposing /home to /var/lib/something so it shouldn't cause any interference.

I am testing with Remmina (making sure that Advanced > Audio output mode is set to local) and Microsoft Remote Desktop on an Android phone.

You guys may know a detail I am missing.

image

@matt335672
Copy link
Member

Best place to start is to get some logging out of pulseaudio.

Try something like the following;-

pacmd set-log-target file:$HOME/pa.log
pacmd set-log-level 4

Then try reloading the drivers and playing sounds. See if you get anything useful in ~/pa.log.

@lucasew
Copy link
Author

lucasew commented Aug 4, 2023

I only enabled the logs then inspected what is going on.

Pulseaudio was spamming a lot this sink_process_msg line but in a few places this trying to connect error happened.

image

image

@lucasew
Copy link
Author

lucasew commented Aug 4, 2023

I found the issue.

The way xrdp is packaged in nixpkgs it hardcodes the sesman.ini location to /nix/store/somewhere/sesman.ini but it seems that it didn't find it. There is an option in NixOS that you can create symlinks on /etc, creating one pointing /etc/xrdp/sesman.ini to that sesman.ini inside the nix store make those socket files appear in /tmp/.xrdp and by consequence the pulseaudio module was able to talk with Remmina running on my machine.

Tested it with some random youtube video and it's working nice.

And yes, this is rickroll running in chromium in XFCE running in a nspawn container (NixOS integrated containers) with port forwarded XRDP, all running on my PC accessed over tailscale from my laptop using Remmina.

And the resolution changes dinamically according to the screen of the client.

Glorious. It's just slow over the Internet but it's a matter of tuning settings and stuff. Audio is working, I am happy and looking into giving more finish on the code and upstream this to nixpkgs so the next NixOS users can use xrdp with audio out of the box if they are using pulseaudio, even on NixOS containers.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants