Comments (11)
Hi
Did you make make install
? If yes, please check if the 20-bluealsa.conf
file is installed in the ALSA shared configuration directory. On my system it is /usr/share/alsa/alsa.conf.d/
. If you're using some "non-standard" Linux distribution, please let me know which one it is.
Optionally you can use "static" configuration in you .asoundrc file, as follows:
pcm.minijambox {
type plug
slave.pcm {
type bluealsa
device "E0:D1:E6:0B:AF:F1"
profile "a2dp"
}
hint {
show on
description "MINIJAMBOX by Jawbone"
}
}
then connect your device and run:
aplay -D minijambox test.wav
from bluez-alsa.
Still no luck.
The shared config is there, nevertheless I tried the .asoundrc configuration you suggested but I get:
~$ aplay -D minijambox test.wav
ALSA lib bluealsa-pcm.c:701:(_snd_pcm_bluealsa_open) BlueALSA connection failed: Permission denied
aplay: main:788: audio open error: Permission denied
~$ sudo aplay -D minijambox test.wav
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM minijambox
aplay: main:788: audio open error: No such file or directory
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.
from bluez-alsa.
Abut the permission. Make sure that the directory shown below exists, and has right permissions and group:
$ ls -l /run/
drwxrwx--- 2 root audio 60 Feb 5 14:36 bluealsa
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).
from bluez-alsa.
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:
ctl.minijambox {
type bluealsa
interface "hci0"
}
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.
from bluez-alsa.
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 export LIBASOUND_THREAD_SAFE=0
to your .profile or .bashrc file.
EDIT:
I can see, that your device supports AAC encoding. Please, read "Troubleshooting" section from the README file. If you experience sound glitching, you might try run bluealsa server with the following options:
$ bluealsa --a2dp-force-audio-cd --aac-vbr-mode=2
from bluez-alsa.
Yes, beautiful, thank you!
add export LIBASOUND_THREAD_SAFE=0 to your .profile or .bashrc file.
May this have an undesired effect when set at the global level?
If you experience sound glitching
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?
from bluez-alsa.
Have a new BT speaker so been playing with this some more. I am seeing the same thing with a non static config, only a static config per #26 (comment) works.
The mixer shows up with amixer -D bluealsa
but trying to play something with aplay -D bluealsa
fails with "audio open error: No such file or directory"
ffs, now it works but before it didn't not sure why π’.
from bluez-alsa.
May this have an undesired effect when set at the global level?
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.
how do you manage you "bluetooth session"?
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.
Right now it is not possible to connect more than one application to particular bluetooth device using bluealsa. If you try to listen to spotify, and in the meantime you will want to listen to some youtube video, you will get "device busy" error. So using bluealsa as a default audio for a desktop environment might not be the best idea. Of course you can do it, but you have to know this limitation.
from bluez-alsa.
@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.
from bluez-alsa.
@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.
from bluez-alsa.
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
}
from bluez-alsa.
Related Issues (20)
- Bluealsa with Google Pixel 8 Android Version 14 (Call sounds like a robot) HOT 9
- Fedora includes a fork of libopenaptx, libfreeaptx HOT 1
- No sound on speakers with PipeWire. HOT 8
- Occasional crashes when streaming from iPhone to bluealsa HOT 10
- Buttons not working during callback recording HOT 2
- build/install: LC3Plus libraries?? HOT 2
- HSP HS profile: "arecord -d" duration is ignored HOT 1
- Routing audio to bluealsa from hw:0,1 HOT 31
- Test all deps with pkgconfig HOT 10
- arecord Unable to install hw params, record from bluetooth failed HOT 3
- Error compiling with aptx HOT 1
- Audio cut off in the beginning of the file HOT 3
- how can an SCO link be reestablished after it has been disconnected by the HF device? HOT 2
- How to pipe bluealsa PCM to fifo? HOT 18
- aplay Unable to install hw params HOT 1
- Can't get the A2DP profile to use LDAC codec HOT 11
- LDAC shows only 96KHz as sample rate | support for other sampling rates HOT 11
- Configuring asoundrc for default bluetooth ignored for Internet Browsers? HOT 2
- LE Audio support in bluez-alsa HOT 1
- Audio volume does not go to 100% on Raspberry Pi HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bluez-alsa.