The officially official Devuan Forum!

You are not logged in.

#1 2021-10-23 21:37:47

devadmin
Member
Registered: 2021-09-26
Posts: 30  

alsa & bluetooth

Does anybody know how to marry bluetooth and alsa?

Offline

#2 2021-10-24 15:11:50

Ogis1975
Member
Registered: 2017-04-21
Posts: 307  
Website

Re: alsa & bluetooth

devadmin wrote:

Does anybody know how to marry bluetooth and alsa?

Check this  https://wiki.debian.org/Bluetooth/Alsa


What economists call over-production is but a production that is above the purchasing power of the worker, who is reduced to poverty by capital and state.
            ----+- Peter Kropotkin -+----

Offline

#3 2021-10-25 15:51:12

devadmin
Member
Registered: 2021-09-26
Posts: 30  

Re: alsa & bluetooth

Ogis1975 wrote:

It does not work. This package is not in repo. Tried to install it from devuan ceres repo and from debian sid repo, got the same result n blueman Connection Failed: No audio endpoints registered

Tried to reinstall all other packages like bluetoth, bluez blueman from ceres or sid - did not work.

The output of bluealsa-aplay -L

bluealsa-aplay: W: Couldn't get BlueALSA PCM list: The name org.bluealsa was not provided by any .service files

Offline

#4 2021-10-26 11:44:12

Ogis1975
Member
Registered: 2017-04-21
Posts: 307  
Website

Re: alsa & bluetooth


What economists call over-production is but a production that is above the purchasing power of the worker, who is reduced to poverty by capital and state.
            ----+- Peter Kropotkin -+----

Offline

#5 2021-10-26 14:06:19

dzz
Member
From: Exmouth, South West England
Registered: 2016-12-01
Posts: 47  

Re: alsa & bluetooth

Worth a go here as my trusy old Vaio netbook has **** sound (and I don't want pulseaudio).

I got bluealsa working but it was not so simple. For a start packages bluez-alsa-utils libasound2-plugin-bluez (you need both) have only a systemd service file, no sysv script. I needed bluetooth daemon running first and a custom ~/.asoundrc

pcm.SoundCoreMini {
        type bluealsa
        device "XX:XX:XX:XX:XX:XX"
        profile "a2dp"
        hint { show on description "Sound Core Mini"}
}

Having already installed blueman I could use those tools to get the device ID. The device can then be manipulated using blueman-manager.

I repackaged it with a custom init script but havent got that quite right as yet. It won't detach from the shell and hangs on bootup. But I can start it manually after disabling the init daemon.

Running chimaera you *might* get away with just a few lib deps from ceres. The original packages will break beowulf. My crude "backport" rebuild from source can run on beowulf.

Here's the offending custom init script, if anyone wants to debug it. More later (if) I get time to revisit this. Or maybe it's better not to have this start automatically..

#!/bin/sh
### BEGIN INIT INFO
# Provides: bluez-alsa

# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6

# Required-Start:	$syslog $local_fs $remote_fs bluetooth 
# Required-Stop:	$syslog $local_fs $remote_fs 
# Short-Description: Bluealsa daemon
### END INIT INFO

. /lib/lsb/init-functions
prog=bluez-alsa
if test -f -/etc/default/bluez-alsa; then
	. -/etc/default/bluez-alsa 
fi

PIDFILE=/var/run/$prog.pid
DESC="Bluealsa daemon"
start() {
	log_daemon_msg "Starting $DESC" "$prog"
	start_daemon -p $PIDFILE /usr/bin/bluealsa $OPTIONS
	if [ $? -ne 0 ]; then
		log_end_msg 1
		exit 1
	fi
	if [ $? -eq 0 ]; then
		log_end_msg 0
	fi
	exit 0
}

stop() {
	log_daemon_msg "Stopping $DESC" "$prog"
	killproc -p $PIDFILE /usr/bin/bluealsa
	if [ $? -ne 0 ]; then
		log_end_msg 1
		exit 1
	fi
	if [ $? -eq 0 ]; then
		log_end_msg 0
	fi
}

force_reload() {
	stop
	start

}

case "$1" in
	start)
		start
		;;
	stop)
		stop
		;;
	force-reload)
		force_reload
		;;
	restart)
		stop
		start
		;;

	*)
		echo "$Usage: $prog {start|stop|force-reload|restart}"
		exit 2
esac

My installed bluetooth-related packages:

root@vaio:~# dpkg -l|grep blue
ii  blueman                                  2.0.8-1+deb10u1                     amd64        Graphical bluetooth manager
ii  bluez                                    5.50-1.2~deb10u2                    amd64        Bluetooth tools and daemons
ii  bluez-alsa-utils                         3.0.0-2                             amd64        Bluetooth Audio ALSA Backend (utils)
ii  bluez-firmware                           1.2-4                               all          Firmware for Bluetooth devices
ii  bluez-obexd                              5.50-1.2~deb10u2                    amd64        bluez obex daemon
ii  libasound2-plugin-bluez:amd64            3.0.0-2                             amd64        Bluetooth Audio ALSA Backend (plugins)
ii  libbluetooth-dev:amd64                   5.50-1.2~deb10u2                    amd64        Development files for using the BlueZ Linux Bluetooth library
ii  libbluetooth3:amd64                      5.50-1.2~deb10u2                    amd64        Library to use the BlueZ Linux Bluetooth stack
ii  libpam-blue                              0.9.0-3                             amd64        PAM module for local authenticaction with bluetooth devices

EDIT: example use:

:~$ mpv --audio-device=alsa/SoundCoreMini 'Sweet Georgia Brown 1.m4a'

Or in VLC, pick  it from the audio device GUI.

Cheers all (and thanks for chimaera), D

Last edited by dzz (2021-10-26 14:14:42)

Offline

#6 2021-10-26 15:38:34

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: alsa & bluetooth

dzz wrote:

I repackaged it with a custom init script but havent got that quite right as yet. It won't detach from the shell and hangs on bootup. But I can start it manually after disabling the init daemon.

Looks like it's a dbus service so it probably won't work unless you can hook it into that somehow with sysvinit (systemd listens to the bus automatically). But this is just a guess; I don't use Bluetooth.

dzz wrote:

Here's the offending custom init script, if anyone wants to debug it.

Looks fine to me but you don't have to test for the exit status after starting the daemon — just use the conditional instead, like this:

start() {
	log_daemon_msg "Starting $DESC" "$prog"
	if start_daemon -p $PIDFILE /usr/bin/bluealsa $OPTIONS ; then
		log_end_msg 0
	else
		log_end_msg 1
	fi
}

Oh, and $Usage is referenced but not assigned but I think that's a typo :-)


Brianna Ghey — Rest In Power

Offline

#7 2021-10-26 17:30:58

dzz
Member
From: Exmouth, South West England
Registered: 2016-12-01
Posts: 47  

Re: alsa & bluetooth

Thanks HoaS!

Looks like it's a dbus service so it probably won't work unless you can hook it into that somehow with sysvinit (systemd listens to the bus automatically). But this is just a guess.

It does here, maybe the dbus bits are built-in. That init script does work from a root shell after boot (although still will not detach, that was the issue)

Now using a simple manual /usr/local/bin start script with sudo permission so it only runs on demand, in preference.

Cable the speaker to the old vaio? The cable is always either lost or broken!

Offline

Board footer