question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PulseAudio instead of ALSA

See original GitHub issue

PulseAudio works in userspace and it doesn’t require a kernel module. It makes Jibri work nicely within Docker with Xorg and IceWM manually started, without passing any host devices.

part of my script for patching Jibri

# application
sed -i -e 's/alsa/pulse/g' \
  src/main/kotlin/org/jitsi/jibri/capture/ffmpeg/executor/Commands.kt
sed -i -e 's/hw:0,1,0/default/g' \
  src/main/kotlin/org/jitsi/jibri/capture/ffmpeg/executor/Commands.kt

# test
sed -i -e 's/alsa/pulse/g' \
  src/test/kotlin/org/jitsi/jibri/capture/ffmpeg/FfmpegCapturerTest.kt

part of my script for creating a virtual sink, based on this answer https://stackoverflow.com/questions/43312975/record-sound-on-ubuntu-docker-image#43368617

apt-get -y install pulseaudio socat
pulseaudio -D --exit-idle-time=-1
pacmd load-module module-virtual-sink sink_name=v1
pacmd set-default-sink v1
pacmd set-default-source v1.monitor

It would be great if you consider using PulseAudio instead of ALSA or make it configurable.

Additionally. It isn’t relevant to this particular issue and I’m not sure whether it’s a bug. 6.X versions don’t report a correct status to Jitsi from the stable repository. After connecting it immediately goes offline. 5.1 version works though.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
mishurovcommented, Nov 2, 2018

Yet another issue connected to Docker and quite possibly it was the cause of my previous issue. Chrome doesn’t work within a docker container without the --no-sandbox flag, it seems a common issue.

I was fixing it by creating a script which overrides the chrome executable. E.g. echo '/usr/bin/google-chrome --no-sandbox $@/' > /usr/local/bin/google-chrome

And it appears to be wrong. The problem is that since Selenium runs my script instead of the original executable, it can’t kill chrome’s process correctly, it throws an exception and Jibri becomes unavailable, and there’re also unhandled chrome processes remain hanging around in the system.

I’ve added the --no-sandbox to src/main/kotlin/org/jitsi/jibri/selenium/JibriSelenium.kt, and now it works fine.

Thus, I think, if you allow to add extra arguments for Chrome through the json, it will make life easier as well.

0reactions
mishurovcommented, Nov 2, 2018

@bbaldino, ok, thank you for the explanation. I’m not in power to set priorities in the project we working on. When Jibri comes to the question, I’ll create a bug on that with more detailed data if the problem arises again.

UPD: Jicofo 1.0-443-1 from the unstable repository and a compiled (and patched for pulse) Jibri from current master b6b7b9c424e1cde150b6698037747a50295e425b doesn’t have this problem. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do ALSA and PulseAudio relate? - Super User
PulseAudio is a software mixer, on top of the userland (like you'd run an app). When it runs, it uses Alsa - without...
Read more >
[SOLVED] How to use ALSA without pulseaudio
According to the ALSA archwiki local users can use sound without being added to the audio group.
Read more >
Noob's Guide to Linux Audio: ALSA, OSS, and Pulse Audio ...
The job of PulseAudio is to pass sound data between your applications and your hardware, directing sounds coming from ALSA to various output...
Read more >
ELI5: ALSA vs PulseAudio : r/linuxquestions - Reddit
Pulseaudio is a sound server, and sits on-top of ALSA and provides a layer of abstraction that allows for more advanced functionality than...
Read more >
How to Properly Replace Pulseaudio with ALSA ... - LinuxG.net
How to Properly Replace Pulseaudio with ALSA on Crunchbang Linux and Debian Squeeze · Remove all pulseaudio packages: · Get rid of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found