Subject: bug#756: bluealsa only comes with systemd service and as such is unusable on devuan

From: Klaus Ethgen <[email-masked]>
Date: Mon, 3 Apr 2023 15:52:17 +0100

Package: bluez-alsa-utils
Version: 4.0.0-2
Severity: grave

I want to use my bluetooth headset but I don't use pötterware like
pulseaudio.

bluez is a dropin replacement for this but I was unable to use it. Now I
see that the bluealsa daemon is only start with a systemd service and
not by udev or init. So this is unusable on devuan.

Please create starup files to that package independent of systemd.

-- System Information:
Distributor ID:	Devuan
Description:	Devuan GNU/Linux 5 (daedalus/ceres)
Release:	5
Codename:	daedalus ceres
Architecture: x86_64

Kernel: Linux 6.1.0-7-amd64 (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
LSM: AppArmor: enabled

Versions of packages bluez-alsa-utils depends on:
ii  libasound2               1.2.8-1+b1
ii  libasound2-plugin-bluez  4.0.0-2
ii  libbluetooth3            5.66-1
ii  libc6                    2.36-8
ii  libdbus-1-3              1.14.6-1devuan1
ii  libglib2.0-0             2.74.6-1
ii  libldacbt-abr2           2.0.2.3+git20200429+ed310a0-4
ii  libldacbt-enc2           2.0.2.3+git20200429+ed310a0-4
ii  libsbc1                  2.0-1

bluez-alsa-utils recommends no packages.

bluez-alsa-utils suggests no packages.

-- no debconf information
Gruß
   Klaus
-- 
Klaus Ethgen                                       http://www.ethgen.ch/
pub  4096R/4E20AF1C 2011-05-16            Klaus Ethgen <[email-masked]>
Fingerprint: 85D4 CA42 952C 949B 1753  62B3 79D0 B06F 4E20 AF1C

---

From: Mark Hindley <[email-masked]>
Date: Mon, 3 Apr 2023 16:13:34 +0100

Control: tags -1 debian

Klaus,

> Package: bluez-alsa-utils

Thanks for this.

> not by udev or init. So this is unusable on devuan.

Or non-systemd Debian.

In the first instance, I think we should try to get non-systemd startup included
in Debian.

Do you have an initscript or udev rules that works? Can you write one?

Thanks,

Mark

---

From: Mark Hindley <[email-masked]>
Date: Mon, 3 Apr 2023 16:20:06 +0100

> Do you have an initscript or udev rules that works? Can you write one?

A quick look at the package suggests that legacy DBus activation might work as
well.

Mark

---

From: Mark Hindley <[email-masked]>
Date: Mon, 3 Apr 2023 16:43:22 +0100

Klaus,

> A quick look at the package suggests that legacy DBus activation might work as

Does adding /usr/share/dbus-1/system-services/org.bluealsa.service containing

[D-BUS Service]
Name=org.bluealsa
Exec=/usr/bin/bluealsa -p a2dp-source -p a2dp-sink
User=root

and reloading the system dbus fix this?

Mark

---

From: Klaus Ethgen <[email-masked]>
Date: Mon, 3 Apr 2023 16:57:05 +0100

Hi,

> and reloading the system dbus fix this?

I'll give it a try. But I guess that it does not work as bluetooth
daemon have to been started AFTER bluealsa.

Regards
   Klaus

---

From: Mark Hindley <[email-masked]>
Date: Fri, 14 Apr 2023 07:45:13 +0100

Control: tags -1 moreinfo

Klaus,

> daemon have to been started AFTER bluealsa.

Did this help?

Mark

---

From: Klaus Ethgen <[email-masked]>
Date: Mon, 24 Apr 2023 13:28:45 +0100

Hi,

> and reloading the system dbus fix this?

No, doesn't work.

First, the profile hsp-ag must be in the activated list. But then, with
that service, it doesn't work but manually started works. (There is also
no such thing as a2dp-sink but it does not harm to have it in line.)

I found other thinks in the system-services. They all have
SystemService=... but I don't know what to include here.

However, when I start it *manually*, there is the following devices:
~> bluealsa-aplay -L
bluealsa:SRV=org.bluealsa,DEV=00:16:94:17:D1:0B,PROFILE=sco
    PXC 550, trusted audio-headset, playback
    SCO (CVSD): S16_LE 1 channel 8000 Hz
bluealsa:SRV=org.bluealsa,DEV=00:16:94:17:D1:0B,PROFILE=sco
    PXC 550, trusted audio-headset, capture
    SCO (CVSD): S16_LE 1 channel 8000 Hz
bluealsa:SRV=org.bluealsa,DEV=00:16:94:17:D1:0B,PROFILE=a2dp
    PXC 550, trusted audio-headset, playback
    A2DP (SBC): S16_LE 2 channels 48000 Hz
~> bluealsa-aplay -l
**** List of PLAYBACK Bluetooth Devices ****
hci0: 00:16:94:17:D1:0B [PXC 550], trusted audio-headset
  SCO (CVSD): S16_LE 1 channel 8000 Hz
  A2DP (SBC): S16_LE 2 channels 48000 Hz
**** List of CAPTURE Bluetooth Devices ****
hci0: 00:16:94:17:D1:0B [PXC 550], trusted audio-headset
  SCO (CVSD): S16_LE 1 channel 8000 Hz

So, there seems to be no other method as to start it as a daemon.

Regards
   Klaus

---

From: Klaus Ethgen <[email-masked]>
Date: Mon, 24 Apr 2023 14:21:59 +0100

Hi,

> Do you have an initscript or udev rules that works? Can you write one?

#! /bin/sh /lib/init/init-d-script
### BEGIN INIT INFO
# Provides: bluealsa
# Required-Start:    $local_fs $syslog $remote_fs dbus
# Required-Stop:     $local_fs $syslog $remote_fs
# X-Start-Before:    bluetooth
# X-Stop-After:      bluetooth
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start bluealsa daemons
### END INIT INFO

DAEMON=/usr/bin/bluealsa
DAEMON_ARGS="--profile=hsp-ag --profile=a2dp-source --profile=a2dp-sink --syslog"
PIDFILE=/run/bluealsa.pid
START_ARGS="--background --make-pidfile"

Regards
   Klaus

---

From: Mark Hindley <[email-masked]>
Date: Mon, 24 Apr 2023 18:56:57 +0100

Control: tags -1 patch debian upstream

> > Do you have an initscript or udev rules that works? Can you write one?

Great.

I suggest that you forward this to either/both Debian and/or upstream requesting
inclusion and with a generous offer to provide ongoing support.

Mark