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
Unable to find definition 'defaults.bluealsa.interface' #26
Comments
Hi Did you make Optionally you can use "static" configuration in you .asoundrc file, as follows:
then connect your device and run:
|
Still no luck. The shared config is there, nevertheless I tried the .asoundrc configuration you suggested but I get:
I'm installing this as an Arch package, it's a pretty standard build script. I've also cloned and make-installed it myself but to no avail. |
Abut the permission. Make sure that the directory shown below exists, and has right permissions and group:
Then, make sure that your user is added to the audio group. That should fix the permission problem. Using sudo should work as well, but you have to create .arecord file in your root's home directory (I guess). |
Right. I've added myself to audio. Now I see some progress but yet hear no sound output. Besides the configuration you suggested I've added a ctl entry to .asoundrc:
This screenshot shows the state of the mixer, bluealsa output, bluetoothctl repl and aplay output: Everything is frozen at that point, I can't even sigint aplay. |
This freeze might be caused by the alsalib bug which can be "fixed" by exporting LIBASOUND_THREAD_SAFE=0. Try to use: $ LIBASOUND_THREAD_SAFE=0 aplay -D minijambox test.wav or add EDIT:
|
Yes, beautiful, thank you!
May this have an undesired effect when set at the global level?
It seems to sound well but I took note of your advice just in case. OT: how do you manage you "bluetooth session"? Say I want to channel my audio through bluetooth for a couple of hours, then wire everything again. Some apps doesn't even have a device argument (for example, sopotify AFAIK). And in any case you will have to create launchers or alias for each app in order to set the device and put them in "bluetooth mode". So, do you temporarily change the default alsa device? |
ffs, now it works but before it didn't not sure why 😢. |
It's hard to tell. I think, that right now there will be no undesirable effects, but in the future there might be - ppl will start to make programs which will require ALSA to be thread safe. However, this bug will be fixed by that time - I hope so.
I do not. ALSA is not made to be user-friendly. That's why PulseAudio has emerged (I think). When, I'm using bluealsa, I'm also using other audio devices as well, and I'm doing it simultaneously. I choose which device should be used for every application I start (I'm not using applications which do not provide options for selecting audio device). But to answer your question more adequately, I have to say, that it might be impossible (or at least very tricky) to get the Windows™ experience out of bluealsa - aka audio device auto-selection depending on whether BT speaker/headset is connected or not. The only possible/reasonable way, which comes to my mind, is indeed the change of the default section in the .asoundrc. You could write some scripts for such actions in order to make it more automatic. PS. |
@infirit, I'll try to add some more meaningful debug error messages and in the meantime I'll try to setup bluealse from scratches on my host as well - it's easy to miss something trivial if one is using development environment all the time :D. |
@arkq Cool. After rebuilding with debug flag it started working so may have been user error 😉. Not sure what changed but I'll try to reproduce and report back. |
Ok, regarding the "bluetooth session", and given that automating bluetoothctl is a PITA, I ended up writing a simple shell library to source inside a bash session and then launch bluetooth enabled apps from there: connect() {
disconnect
export LIBASOUND_THREAD_SAFE=0 ALSA_CONFIG_PATH=/tmp/bluetoothrc
sudo systemctl restart bluetooth
sudo bluealsa &> /tmp/bluetooth.log &
sleep 0.5
echo 'power on' | bluetoothctl &> /dev/null
bluetoothctl
local device_id=$(echo quit | bluetoothctl | \
sed -nr 's/.*Device ([^ ]+).*/\1/p')
cat > "$ALSA_CONFIG_PATH" <<EOF
pcm.!default {
type plug
slave.pcm {
type bluealsa
interface "hci0"
device $device_id
profile "a2dp"
}
}
ctl.!default {
type bluealsa
interface "hci0"
}
EOF
}
disconnect() {
rm -f "$ALSA_CONFIG_PATH"
unset LIBASOUND_THREAD_SAFE ALSA_CONFIG_PATH
sudo pkill bluealsa
sudo systemctl stop bluetooth
} |
I've followed the instructions in the readme. After connecting to my bluetooth device and running
sudo bluealsa
I'm unable to make aplay work:Without sudo:
With sudo:
My .asoundrc:
My device:
The text was updated successfully, but these errors were encountered: