-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does this project supersede the need for a USB audio card recommended by LedFx? #22
Comments
You were able to get this working with the built in audio card? I tried getting it to work just because people have been asking, but I couldn't get it working. I'm using a Schiit Modi for all my audio anyways. Can you share how you did it so I can put it in the examples section? I'd guess they updated the drivers or LedFx, and the LedFx doc isn't updated. If it's working, it's working. You don't need an external card. |
Hi, Sorry for a delay, but I stumbled upon extra challenges when trying to set up LedFX with a BT streaming. In the original post I only tried Spotify connect, which was easier to set up. Yes, I just used the built-in audio card, but note that I'm not interested in using an actual microphone (which Pis don't have). I want LedFX to use my BT audio as input. I guess if you want an actual microphone, you need to buy something like this. I made a small personal note on how to make this setup work and I'm more than happy to share it. Let me paste it here for now. DISCLAIMER: I know very little about sound on Linux and everything in the guide below is based on the knowledge I acquired in the process of building this project. It's possible that my understanding of some concepts (especially ALSA's loopback) is wrong, so take it with a grain of salt and correct me wherever applicable. Software
How it worksNote that I'm using a BT USB dongle as the built-in BT has quality issues especially when you use Wi-Fi at the same time to stream to WLED. SetupBluetoothbluez-alsa Follow this very well written wiki to locally build bluez-alsa. Use the $ sudo systemctl enable --now bluealsa A2DP A2DP allows your phone to stream audio via BT. In order to establish the A2DP connection between your phone and Pi, you need an agent that handles pairing and authorization of your device. Follow this gist which is mostly up to date. One change I needed to do is comment out the Testing Double check that ALSA loopbackWe'll need to create an ALSA loopback interface, so that Load ALSA loopback module. $ sudo modprobe snd-aloop Now, when you run
Which subdevice to use? There's usually 8 subdevices per loopback device. If one of the loopback devices shows 7/8 subdevices, make sure to test which ones are working. SnapcastDownload Snapserver Change the source in
Restart snapserver with Lastly, make sure you point bluealsa-aplay to the loopback sink with $ bluealsa-aplay --pcm=hw:3,1 IMPORTANT: The first application opening one of the subdevices will force the second application to use the same set of parameters: sample rate, format, number of channels. Ideally, specify the same parameters on both snapserver and bluealsa-aplay. Otherwise, you might get errors from bluealsa-aplay about invalid arguments. Couldn't open ALSA playback PCM: Set HW params: Set sampling rate: Invalid argument: 44100 Either specify the same rate in Snapclient $ snapclient --player alsa -s Headphones
# or
$ snapclient --player alsa -s 1 To use those settings for systemd's snapclient, edit
LedFXTime to start LedFXDocker. If you're running both the snapserver and the ledfx docker on the same machine, use the host network mode in docker-compose.yml:
Start the container with At this point you should be hearing sound from your Rasbperry Pi's audio interface and see the WLED lights run the show. Bonus: SpotifySnapcast supports spotify connect. Make sure you have librespot (easily installed via raspotify) installed on your system and simply change snapserver's source to:
Restart snapserver and you should now see the Snapcast cast device on your Spotify client. |
Hi,
First of all, thank you for creating this project. It's awesome and I managed to get it up and running fairly quickly. This is not really an issue, but more of a post with questions.
On the official page of https://ledfx.readthedocs.io/en/latest/installing.html#raspberry-pi-installation, they say I need a USB audio card for a raspberry pi.
I am actually running your container on raspberry pi 3 and it works with the built-in audio card. Is the main reason for this that you integrated snapcast into this repository and did some magic to direct the audio to LedFx with use of snapcast (basically the 50 hours of work you mention in the README :))? I haven't tried just running LedFx without your container so I'm not sure if USB audio card is necessary there too, but I assume yes given the documentation.
If the answer to the above is yes, then I'm curious if your work would ever be upstreamed to LedFx to make it work on a stock RPi without extra audio cards. Don't get me wrong, I support your project, but it would be even better if it was used in the original LedFx for the sake of simplicity and lower maintenance.
No call for action here, mere curiosity. Thank you again for this amazing contribution.
The text was updated successfully, but these errors were encountered: