TransWikia.com

Clone sound from Chromium to ALSA Loopback and also speakers

Super User Asked by Rohlik on December 16, 2021

I have working setup on my RPi3 B+ with Raspbian where is sound from Chromium browser send directly to ALSA Loopback device (enabled by modprobe snd-aloop as kernel module) by this Chromium’s parameter: --alsa-output-device='plug:front'. Whole command:

/usr/lib/chromium-browser/chromium-browser --ignore-autoplay-restrictions --disk-cache-size=50000000 --kiosk --disable-extensions --noerrdialogs --allow-insecure-localhost --enable-gpu-rasterization --enable-zero-copy --enable-native-gpu-memory-buffers --alsa-output-device='plug:front' https://youtu.be/nW--BbY6Z5E

PS: plug:front was taken from aplay -L output.

This sound is successfully recorded/captured from Loopback capture device hw:0,1 by Darkice which is live audio streamer. Here is just related part of /etc/darkice.cfg:

[input]
device          = hw:0,1    # soundcard device for the audio input
sampleRate      = 44100     # other settings have crackling audo, esp. 44100
bitsPerSample   = 16        # bits per sample. try 16
channel         = 2         # channels. 1 = mono, 2 = stereo

But I also need this sound be played by external speakers which are connected to line-out (jack).
How Can be this done? Can you help me? How I can clone sound output?

# uname -a
Linux rpi3 4.19.114-v7+ #1303 SMP Tue Apr 7 15:44:16 BST 2020 armv7l GNU/Linux

# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
  Subdevices: 7/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 0: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 1: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 7/7
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
card 1: ALSA [bcm2835 ALSA], device 1: bcm2835 IEC958/HDMI [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: ALSA [bcm2835 ALSA], device 2: bcm2835 IEC958/HDMI1 [bcm2835 IEC958/HDMI1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

# cat /proc/asound/cards
 0 [Loopback       ]: Loopback - Loopback
                      Loopback 1
 1 [ALSA           ]: bcm2835_alsa - bcm2835 ALSA
                      bcm2835 ALSA

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP