I managed to setup bluetooth A2DP connection to my bluetooth speakers using bluealsa and added the configuration to mpd.
And I’m able to use the speakers with third party mpd controllers where I can select the added sink.
mpd.conf:
audio_output {
type "alsa"
name "bluealsa"
device "bluealsa"
mixer_type "software"
}
I tried to add it also to volumio 2 gui but with no success right now.
What I tried ist to add the card to /volumio/app/plugins/audio_interfaces/alsa_controller/cards.json
cards.json is just to set “prettynames” for devices. What you need here is a plugin.
Take a look here, we can guide you if you need help: volumio.github.io/docs/Plugin_S … rview.html
It seems as I won’t be able to dynamically update the content of UIConfig Page without extending the websocket core plugin, right?
Are there any other option how I can add such a list of bluetooth devices to the plugin?
Or should I start to implement it as core plugin. E.g. by extending the alsa_controller with bluetooth sections which are visible when a bluetooth device is available?
You need to create your own plugin I believe, this way you could set playback to the bluetooth audio. Or, create a fake soundcard with snd_aloop to reroute the sound to bt. This way you can select the audio device accordingly
What I tried and worked well is to add the bluetooth device (if it’s a a2dp speaker) to mpd. conf
like this:
audio_output {
type "alsa"
name "bluealsa"
device "bluealsa"
mixer_type "software"
}
Pro: this solution it should use lesser CPU than an snd_aloop
Con: it also needs to extend the mpd.conf.tmpl by this section and requires a restart of mpd after changeing the device
I gave a look at your code, and, congratulations, you made everything in a perfect Volumio style. Also, very good the integration on the UI.
I suggest this approach:
Instead of merging the Volumio 2 backend commit, we can create a plugin out of it (which you basically already did)
We merge the UI part, so we can invoke it when the plugin is installed
This is because we try to keep Volumio2 base code as essential as possible, allowing to install more stuff only if people really needs it. What do you think? We can do it together.
for me it would also be OK to move it to a plugin.
The only thing I’m not aware about that is how to move the stuff implement the user interface / web sockets part to a third party plugin?
I build an plugin and added the callMethods to UI. Initial query of BT devices is sent to plugin and an answer is generated.
But how can I receive the push anwsers of such a methods?
In the API Docs a pushMethod is mentioned but I can’t find an example of it in the code.
great work!
I’ve been fiddling around with bluetooth for some time now and finally managed to test your “git” version.
A couple of things are not working for me (eg. invalid .asounrc is created; /n at the end instead of \n I guess; connecting not working; …).
Should I continue to test and post my findigs here, or wait for a more mature plugin status?
the content of the repository is a hard integration into volumio what is not the desired solution of this project.
Currently I’ll rewrite the hard integration to a plugin. and got stuck a little on the return of the device list over the callMethod call.
But I keep trying to find a solution and post a new working plugin version.
I’ll plan to publish it in the plugin repository but I can’t give a time estimation right now because I just move and the workspace is not restored completely.