GithubHelp home page GithubHelp logo

Comments (14)

arkq avatar arkq commented on June 4, 2024

Hi,

Is there a way to automatically connect to any address?

Currently it is not possible. It has crossed my mind, though :) It will be possible (in the future) for sure, with the bluealsa-aplay.

Is there any way for the volume to be adjusted via the phone/tablet?

To be honest, I don't know (I'm not able to check it right now). I think, that it should be possible. If not via the bluealsa itself, it could be done via some scripting. It is possible, that upon connecting BT device, BlueZ registers new input device (if BT device supports such a feature), which could be used to control volume.

EDIT:
With a little bit of hacking, you could try to listen for a D-Bus signal indicating device connection (A2DP connection establishment, to be exact), which could trigger aplay setup. It might be a little bit of scripting, however it could be possible.

from bluez-alsa.

George-ou812 avatar George-ou812 commented on June 4, 2024

Rats! Would have been perfect solution and finally rid of pa which eats 32% of my resources. I imagine a lot of the RPI people would like this feature too.

from bluez-alsa.

arkq avatar arkq commented on June 4, 2024

Checkout fresh master snapshot. If you are lucky (your phone/tablet is correctly recognized by the BlueZ) you should be able to control volume.

from bluez-alsa.

George-ou812 avatar George-ou812 commented on June 4, 2024

Just on the DBus monitoring idea, do you have the DBus interface address org.x.x ?
Any additional information of the specifics of listening for the A2DP connection establishment?

from bluez-alsa.

infirit avatar infirit commented on June 4, 2024

You can, the name is org.bluez then you have several options. Either watch for new devices with interface org.bluez.Device1 or proxy org.freedesktop.DBus.ObjectManager on path / and listen to the InterfaceAdded signal. Gio (GLib) has nice high level classes for this which we use in blueman.

Then inspect the UUIDs property on interface org.bluez.Device1 and look for the uuid that corresponds to A2DP.

from bluez-alsa.

George-ou812 avatar George-ou812 commented on June 4, 2024

Yea, could add that to simple-agent and run bluealsa-play with the appropriate connected mac perhaps.

from bluez-alsa.

infirit avatar infirit commented on June 4, 2024

simple-agent is bluez4 and replaced with bluetoothctl in version 5.

If you are up for some hacking, you could create your own agent and have it handle pin codes for a select set of macs. For inspiration look https://github.com/blueman-project/blueman/blob/master/blueman/main/applet/BluezAgent.py but skip making it the default.

from bluez-alsa.

George-ou812 avatar George-ou812 commented on June 4, 2024

Bluez5-5.43 is shipped with simple-agent and works well with pulseaudio. On my embedded Linux I can automatically pair, trust ( I pin functionality added ) any mobile / tablet and play music exactly like an off-the-shelf BT speaker does with no user intervention speaker side. My issues are pulse eats 32% of my resources and pulse also plays games with my other music renders that need non-pcm access to the sound card, hence why blue-alsa is great.
Look at this all last night I'm wondering if it's going to be possible to do the same with blue-alsa?
For example, blue-alsa needs a hci0 mac in order to start, For a BT a2dp device to show on my iphone I need bluetoothd, blue-alsa and a python agent. A chicken-n-egg situation, blue-alsa needs a hci0 mac to start and tell bluez its capabilities BUT I need to be able to change the mac to the current connected device automatically to play music.

@infirit, my set-up already does this, I can see all the trust devices within the BT directories in my file system ( with PA ). My problem is changing blue-alsa's mac on the fly with one of those stored and still keeping blue-alsa alive so a phone/tablet can see an a2dp device in the first place. Hope this makes sense?

from bluez-alsa.

arkq avatar arkq commented on June 4, 2024

@George-ou812 You do not have to kill/restart bluealsa server, in fact it is not advised. The only thing you have to do, it is to start bluealsa-aplay (or arecord|aplay) with a correct MAC address.

from bluez-alsa.

George-ou812 avatar George-ou812 commented on June 4, 2024

Yea, that's the problem! Passing the mac to bluealsa without human intervention...
If I start bluealsa my phone will find an a2dp device, connect and render via arecord. If I pair another phone I have to change the HCI device in asound.conf by hand otherwide it complains about no transport.

from bluez-alsa.

infirit avatar infirit commented on June 4, 2024

Bluez5-5.43 is shipped with simple-agent

Oh, you're right, I thought they dropped it.

Maybe you can post the asoundrc content and what you change and related error messages.

from bluez-alsa.

George-ou812 avatar George-ou812 commented on June 4, 2024

Latest master build has fixed the volume on iphone4! I'll investigate using bluealsa-aplay and see if I can associate a mac dynamically somehow after connection but before "play". Does bluealsa-aplay actually render directly to hardware or has it just hidden "arecord | aplay" internally?

from bluez-alsa.

arkq avatar arkq commented on June 4, 2024

Yes, bluealsa-aplay omits unnecessary calls to the bluealsa PCM plugin. It reads audio directly from the bluealsa server and writes it to the PCM output device.

from bluez-alsa.

George-ou812 avatar George-ou812 commented on June 4, 2024

Excellent! Great job. This issue's done for me now. Thanks.

from bluez-alsa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.