FEATURE -> Live Streaming ALSA device?
I'm not sure if this is already possible, but I'd like to be able to live stream to FM from applications like raspotify and/or snapcast.
I imagine that the botwave local client would appear as an alsa device. Is this feasible now or is there an alternative approach.
Hey, I’ve already thought about this, but it’s not implemented at the moment.
In theory, the local client could expose an ALSA device, but the current client-server protocol doesn’t support this kind of audio streaming yet. I’d also prefer to avoid features that only work for a single component. Backend compatibility (bw_custom) would also need to be verified, even though it should be supported.
I might try to work on this in the next week or two, but I can’t guarantee anything.
I've got some time to check it a bit more, but i don't have much knowledge in alsa things, at it seem to be kinda annoying to use (less than pulseaudio tho). I have a question that you might be able to reply: how can i tell what card to use ? My pi doesn't seem to have a default one, especially as root (the script runs as root). So like do i just ask the end-user to input the capture card to capture from, and they setup themselves a loopback card or something like that ? Or is there eventually a better solution ?
I'm no ALSA expert either, but for my purposes (streaming audio via my network to an FM radio), having botwave appear to the system as an ALSA audio output card for playback would be ideal. I think this may be useful for other sound playback applications.
Ok thanks, i'll check if I'm able to do that 🙂
I've done some tests and i've come to something that seems to work (at least for me) on the local client. It creates an alsa loopback card and listens from it. It's still in a very experimental state and the final update will take some more time to come since i have to adapt the protocol, but the base is there. Could you give me feedback and tell me if this was what you thought ?
To update:
# if you already had an installation, backup your important files
curl -sSL https://botwave.dpip.lol/uninstall | sudo bash # skip this if you didnt install it
curl -sSL https://raw.githubusercontent.com/dpipstudio/botwave/refs/heads/livestream-test/scripts/install.sh | sudo bash -s -- -l --alsa
# update: ^^^^^ this command does not work anymore (does install from main branch)
sudo reboot # reboot to setup the audio card
then to use it, run sudo bw-local and use the live command. once done, select in your other app like raspotify or whatever the sound card BotWave
Edit: finally, implementing it in server-client was pretty easy. I'm waiting on your feedback to release it
wow, great! I've got a lot of unexpected obligations but will try to get some time with it this weekend. Otherwise, after the 5th.
Perfect thanks !
Hi ! Did you have a chance to try the ALSA live streaming test yet ? No rush at all, take your time !
Finally got a chance to try it out today.
Good news: I was able to use aplay to play a WAV file and configure raspotify to work too! Thanks!
Two quick questions:
- I can't seem to get botwave to work on some frequencies. 90.0 seems to be fine as do some other frequencies, like 92.4. But 92.5 doesn't. Are there some limitations in the software or hardware or is this just about my local radio environment?
- Do you have advice on the best way to boot the system and have bw-local run the live command immediately and keep it running?
Glad it works !
For the 92.5, it should also work ? The supported range is from 88 to 108mhz iirc. I'll check if it also doesn't work for me.
As for the automation, you can do these commands:
sudo bw-nandl l_onready.hdl
# put the live command at the end, save, and exit
sudo bw-autorun local
# to remove, do bw-autorun --uninstall botwave
Little update: it works just as fine on 92.5 as on other freqs for me. its probably in your local environment, maybe from another device interference or idk
thanks for the sanity check, could be the radio itself too.