Comments (6)
I've fixed nasty bug which has caused infinite read loop (100% CPU). And right now the bluealsa-aplay will terminate when the phone has been disconnected.
HOWEVER, this fix does not resolve your problem completely. Right now, I'm not able to detect whether the phone has been disconnected unless streaming has occurred.
connect phone -> start bluealsa-aplay -> disconnect phone (without playing audio) -> bluealsa-aplay is still running
This disconnection "feature" will be possible in the future, alongside with the "real bluetooth speaker" functionality (accepting any MAC address).
from bluez-alsa.
Looking forward to this "This disconnection "feature" will be possible in the future, alongside with the "real bluetooth speaker" functionality (accepting any MAC address)."
Is the other fix in the git now?
Been monitoring the DBus signals but they only give me "connected, active and idle", not much use for using them as triggers for other things. Strangely last night I could see a org.bluez.MediaPlayer1 bus, its signals gave me "playing, paused", everything. They changed immediately with the music off the iphone as well. Very useful, but that DBus interface has disappeared ( bluealsa-aplay still plays O.K) so not sure what happened.
from bluez-alsa.
Been monitoring the DBus signals but they only give me "connected, active and idle", not much use for using them as triggers for other things
Use PropertiesChanged
signal on org.bluez.Device1
and look for the Connected
property. On disconnect clean up, stop stream etc.
trangely last night I could see a org.bluez.MediaPlayer1 bus, its signals gave me "playing, paused", everything.
The org.bluez.MediaPlayer1
interface is created on successful device connection when all the prerequisites like bluealsa and device support (some phone don't support it) are in place.
edit: very simple python script below to handle connect and disconnect.
from gi.repository import Gio, GLib
def on_properties_changed(proxy, changed, invalidated):
changed_properties = changed.unpack()
if "Connected" in changed_properties:
if changed_properties["Connected"]:
print("Configure and start my program")
else:
print("Kill my program and cleanup")
proxy = Gio.DBusProxy.new_for_bus_sync(
Gio.BusType.SYSTEM,
Gio.DBusProxyFlags.NONE,
None,
"org.bluez",
"/org/bluez/hci0/dev_CC_61_E5_1A_39_B5",
"org.bluez.Device1",
None)
proxy.connect("g-properties-changed", on_properties_changed)
loop = GLib.MainLoop()
loop.run()
from bluez-alsa.
OK, based on Arkq's comment "This disconnection "feature" will be possible in the future, alongside with the "real bluetooth speaker" functionality (accepting any MAC address).", ultimately the "real bluetooth speaker" is actually what I'm after and trying to do. Based on that I'll wait this #issue is closed for me.
Thanks for your help.
Cheers.
from bluez-alsa.
@George-ou812 Bare in mind, that the "future" means few months (not days). This project is not a "Bluetooth speaker", but more likely pulseaudio alternative for Bluetooth Audio on Linux. Hence, this feature has very low priority for me. After all, it is possible to accomplish it already with a little bit of scripting (e.g. Python code provide by @infirit).
from bluez-alsa.
@arkq, appreciate your timescale's, "pulseaudio alternative for Bluetooth Audio on Linux" is perfect for me, pa is taking up far too much resources on my board just for BT. Look forward to see this sometime, keep up the good work!
from bluez-alsa.
Related Issues (20)
- v4.1.1 fails to build on on Debian buster i386 HOT 8
- No sound from Onkyo receiver HOT 90
- Potential server lockup in PCM drain HOT 2
- Sink producing no audio with aptX codec HOT 2
- allow build with different dbus name HOT 2
- 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
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.