general/other no audio in a debootstrap chroot env

hey there, everyone i followed the linuxulator docs to setup the debootstrap env and have mounted everything fine in the fstab but after setting up xorg and gui stuff, whenever i run a gui app that has sound inside the chroot the app launches fine but there is no audio with the following logs in the terminal

ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5703:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM default
libGL error: failed to open /dev/dri/card0: Permission denied
libGL error: failed to open /dev/dri/card0: Permission denied
libGL error: failed to load driver: crocus


any help would be really appreciated, thanks
 
I don't remember how i did it at the time i tried to run linux app in a linux jail but i think you should make your host and guest (linux jail) use the same pulseaudio socket (?). IIRC, i was exporting a variable in guest according to host's pactl info and then running the app i am trying to get sound from. maybe it was $PULSE_SERVER.

pulseaudio(1)

Code:
       $PULSE_SERVER: the server string specifying the server to connect to
       when a client asks for a sound server connection and doesn't explicitly
       ask for a specific server. The server string is a list of server
       addresses separated by whitespace which are tried in turn. A server
       address consists of an optional address type specifier (unix:, tcp:,
       tcp4:, tcp6:), followed by a path or host address. A host address may
       include an optional port number. A server address may be prefixed by a
       string enclosed in {}. In this case the following server address is
       ignored unless the prefix string equals the local hostname or the
       machine id (/etc/machine-id).
 
hi mate

from memory the /tmp directory should be mounted from the host to the chroot

then all you have to do is this

on freebsd

Code:
~/.config/pulse/default.pa

Code:
#!/usr/local/bin/pulseaudio -nF

# include default.pa and override
.include /usr/local/etc/pulse/default.pa

# pulseaudio socket
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix socket=/tmp/pulseaudio.socket

in the chroot

Code:
~/.config/pulse/client.conf

Code:
default-server = /tmp/pulseaudio.socket

then start pulseuaudio on freebsd

Code:
pulseaudio --start --daemonize 2>/dev/null
 
hi mate

from memory the /tmp directory should be mounted from the host to the chroot
i have done that as per the linuxulator docs
all the chroot related mounts in /etc/fstab are

devfs /compat/audio/dev devfs rw,late 0 0
tmpfs /compat/audio/dev/shm tmpfs rw,late,size=1g,mode=1777 0 0
fdescfs /compat/audio/dev/fd fdescfs rw,late,linrdlnk 0 0
linprocfs /compat/audio/proc linprocfs rw,late 0 0
linsysfs /compat/audio/sys linsysfs rw,late 0 0
/tmp /compat/audio/tmp nullfs rw,late 0 0
/home /compat/audio/home nullfs rw,late 0 0

where /compat/audio is the chroot env

then all you have to do is this

on freebsd

Code:
~/.config/pulse/default.pa
this file doesn't exist on my system but /usr/local/bin/pulseaudio does and the .config/pulse dir has some other files as well
so should i create this file manually?
Code:
#!/usr/local/bin/pulseaudio -nF

# include default.pa and override
.include /usr/local/etc/pulse/default.pa

# pulseaudio socket
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix socket=/tmp/pulseaudio.socket
sorry if it is a noob question that i shouldn't ask but i am not familiar with pulseaudio so i need to ask are these shell commands or some script lines?
 
hi mate

use mkdir to create the pulse directory in your home/.config
if it doesnt exist

Code:
mkdir -p ~/.config/pulse/

create the default.pa if it doesnt exist

Code:
~/.config/pulse/default.pa

add the following code

Code:
#!/usr/local/bin/pulseaudio -nF

# include default.pa and override
.include /usr/local/etc/pulse/default.pa

# pulseaudio socket
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix socket=/tmp/pulseaudio.socket
 
Back
Top