LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   No sound with Firejail + PulseAudio 9 (https://www.linuxquestions.org/questions/slackware-14/no-sound-with-firejail-pulseaudio-9-a-4175623566/)

drgibbon 02-12-2018 01:07 AM

No sound with Firejail + PulseAudio 9
 
I'm wondering if anyone has working audio on Slackware 14.2 using Firejail and PulseAudio 9? I always get a connection refused error, for example:

Code:

could not open audio device (Connection refused)
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

The PulseAudio issues with Firejail are known problems, but it's supposed to be fixed in PulseAudio 9. Also, I've tried the recommended fix of putting "enable-shm = no" in ~/.config/pulse/client.conf but it doesn't seem to make any difference.

v3g4n 02-12-2018 03:10 PM

Hi drgibbon, I currently have working audio on Slackware 14.2 while using firejail and pulseaudio 9. I recently did a fresh install though, but I remember also running into that problem before the reinstall. I also tried the fix you mentioned and it did not work for me either. My old install was LUKs with LVM, but my current install is just a standard install. Can't imagine that would have anything to do with it though.

v3g4n 02-13-2018 06:34 PM

For the heck of it I did a fresh install with full disk LUKS & LVM and I still am getting sound in Firefox through firejail with Pulseaudio 9 so it's definitely not that.

drgibbon 02-14-2018 06:54 AM

Quote:

Originally Posted by v3g4n (Post 5819576)
For the heck of it I did a fresh install with full disk LUKS & LVM and I still am getting sound in Firefox through firejail with Pulseaudio 9 so it's definitely not that.

Thanks for testing that, I'm actually running LUKS/LVM on both my Slackware systems, so it's nice to know that LUKS isn't the problem. Since I have this problem on more than one machine, I don't suppose that the issue is hardware related, but I can't think of what else might be causing it.

bateleur 03-13-2018 09:10 AM

I am no expert, but some sound problems seem to be related with the firejail profile you use. If your firejail profile doesn't have access to ~/.config/pulse/client.conf then whatever you put in there, will likely have no effect. So maybe you should test with putting the options in /etc/pulse/client.conf, since all firejail profiles are supposed to have read access to /etc. If you are a bit paranoid with that and use the --private-etc option, then use it with --private-etc=pulse, but make sure that pulse is configured in /etc/pulse

From my own experience, I only get sound out of Firefox 52 with firejail 0.9.52 on Slackware 14.2 if I use it with the icecat profile:

firejail --profile=/etc/firejail/icecat.profile firefox gives me sound.

firejail firefox gives me no sound.

That problem started with a recent upgrade of firejail (apparently for firefox, firejail expects pulse to be running, maybe related to this? [0]), so you could try downgrading firejail to a previous version, e.g. firejail LTS (0.9.38).

[0] https://www.linuxquestions.org/quest...116/page2.html

drgibbon 03-14-2018 08:51 AM

Thanks bateleur, I've tried setting the recommended fixes in /etc/pulse/ (both "enable-shm = no" in client.conf and "enable-memfd = yes" in daemon.conf). I've also tried a bunch of different firejail config permutations (going one by one and commenting out sections), but I'm never able to get audio in any programs. Had a go with the Icecat profile and Firefox too, but still no sound. It's got me stumped.

bateleur 03-14-2018 08:38 PM

Strange... I hate to ask this, but you do have sound without firejail, right? Because I have more or less disabled pulse on my machine, but as a result sound is muted when I login and I tend to forget that and then I start wondering why I don't have sound with firejail. On the other hand, v3g4n has donde a clean install and has sound with firejail, so maybe you could try reinstalling pulse and retry using firejail with pulse's settings from a default Slackware install?

Anyway, I am a bit of a pulse-"hater", so I have disabled it as much as possible (as I have already mentioned), but I do get sound with firejail:

client.conf:

Code:

autospawn = no
daemon-binary = /bin/false

daemon.conf:

Code:

exit-idle-time = 0
flat-volumes = yes

default.pa

Code:

.fail
    # Set tsched=0 here if you experience glitchy playback. This will
    # revert back to interrupt-based scheduling and should fix it.
    #
    # Replace the device= part if you want pulse to use a specific device
    # such as "dmix" and "dsnoop" so it doesn't lock an hw: device.
   
    # INPUT/RECORD
    load-module module-alsa-source device=dsnoop
   
    # OUTPUT/PLAYBACK
    load-module module-alsa-sink device=dmix
   
    # Accept clients -- very important
    load-module module-native-protocol-unix

.nofail
.ifexists module-x11-publish.so
    # Publish to X11 so the clients know how to connect to Pulse. Will
    # clear itself on unload.
    load-module module-x11-publish
.endif

Also check with alsamixer if any channel is muted (unmute it by pressing m) and/or if the correct sound device is selected.

Edit: Forgot to add: empty asound.conf, custom ~/.asoundrc and rc.alsa / rc.pulseaudio non-executable (for my settings)

See: https://docs.slackware.com/howtos:mu...io_non-default

drgibbon 03-14-2018 11:34 PM

I do have working sound outside of firejail, so the problem is definitely localised there. Running alsamixer is fine from the normal command line, but I can't even open it with firejail running:
Code:

bash-4.3$ firejail bash
Reading profile /etc/firejail/default.profile
Reading profile /etc/firejail/disable-common.inc
Reading profile /etc/firejail/disable-passwdmgr.inc
Reading profile /etc/firejail/disable-programs.inc

** Note: you can use --noprofile to disable default.profile **

Parent pid 27403, child pid 27404
Child process initialized in 35.45 ms

bash-4.3$ alsamixer
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

cannot open mixer: Connection refused

It even fails when running without a profile, so it's something more fundamental than the firejail profile options:
Code:

bash-4.3$ firejail --noprofile bash
Parent pid 27604, child pid 27605
Child process initialized in 5061167022080.00 ms
bash-4.3$ alsamixer
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

cannot open mixer: Connection refused

bash-4.3$ groups
users lp wheel floppy audio video cdrom plugdev power netdev scanner vboxusers

I will have a go at making pulse the non-default audio manager.

drgibbon 06-04-2018 10:10 PM

To update this, I found out that the Firejail/Pulseaudio problem is only present when I'm running awesomewm. If I log in to Xfce or KDE then I can use audio under firejail no problem. Obviously those desktops are doing something with regards to sound, I just don't know what it is!

drgibbon 06-05-2018 01:42 AM

For what it's worth, the same problem exists in Fluxbox (from runlevel 3 and startx), so it doesn't appear to be caused by awesomewm itself.

drgibbon 07-24-2018 09:17 PM

Someone on IRC suggested that this might have something to do with D-Bus?

orbea 07-24-2018 10:15 PM

I don't have pulseaudio or firejail, but if its related to dbus adding this to your ~/.xinitrc might help.

Code:

eval `dbus-launch --sh-syntax --exit-with-session`

drgibbon 07-24-2018 11:35 PM

Thanks, unfortunately it doesn't seem to help.

drgibbon 03-12-2019 12:52 AM

Old problem, but one that seems to persist in -current (with PulseAudio 12). For me the fix was just to run my window manager inside an Xfce session. I did it by editing /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml

changing:
Code:

<property name="Client0_Command" type="array">
<value type="string" value="xfwm4"/>

to:
Code:

<property name="Client0_Command" type="array">
<value type="string" value="awesome"/>

(I also stopped the xfce4-panel from running on session start). This fixes the firejail audio problem and it generally seems to work well.

drgibbon 03-12-2019 01:53 AM

I take it back, that setup can't even recover after screen blanking/screensaver is active. The search continues.


All times are GMT -5. The time now is 12:08 PM.