TobKra96 / music_led_strip_control

Audio visualization for LED strips in real-time with web interface on a raspberry pi.
https://tobkra96.github.io/music_led_strip_control/
MIT License
297 stars 64 forks source link

MLSC Not Recieving Audio From ALSA Loopback #130

Closed carlyd95 closed 3 years ago

carlyd95 commented 3 years ago

Background: I am wanting to use my pi as a AD2P sink and stream audio from my phone to the pi to an ALSA multi that goes to USB sound card for my speakers and a loopback so that MLSC can catch the other side of the loopback.

I create the loopback using: sudo modprobe snd-aloop

running play -l I get:

* 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: Device [USB Audio Device], device 0: USB Audio [USB Audio] Subdevices: 0/1 Subdevice #0: subdevice #0

I have configured my asound.conf as below:

pcm.loopin { type plug slave.pcm "plughw:Loopback,0,0" }

pcm.loopout { type plug slave.pcm "plughw:Loopback,1,0" }

pcm.both { type plug slave.pcm "multi" }

pcm.multi { type route; slave.pcm { type multi; slaves.a.pcm "hw:1,0"; slaves.b.pcm "loopin"; slaves.a.channels 2; slaves.b.channels 2; bindings.0.slave a; bindings.0.channel 0; bindings.1.slave a; bindings.1.channel 1; bindings.2.slave b; bindings.2.channel 0; bindings.3.slave b; bindings.3.channel 1; }

ttable.0.0 1; ttable.1.1 1; ttable.0.2 1; ttable.1.3 1; }

In MLSC I use audio input 4:

Input Device id 0 - Loopback: PCM (hw:0,0) Input Device id 1 - Loopback: PCM (hw:0,1) Input Device id 2 - USB Audio Device: - (hw:1,0) Input Device id 3 - loopin Input Device id 4 - loopout

I am playing music to the multi via the "both" ppm plug for "multi" and it is playing out of hw:1,0 (a USB sound card) and the loopback, however MLSC is not getting audio from from the loopback via "loopout" for some reason.

I know that the audio is in fact playing to multi and correctly making it to the loopback as I have recorded its output to confirm so

Any ideas would be greatly appreciated!

Please let me know of any other relevant details I could share to aid in diagnosing this issue. Thank you. :D

carlyd95 commented 3 years ago

welp, it is working, I guess the default audio sample rate was just too much for my pi to handle. After lowering it, it is now working. I suppose this is a disadvantage of the microphone-less method I am using.