2024-01-25 14:12:00 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, aacSupport ? true
|
|
|
|
, alsa-lib
|
|
|
|
, autoreconfHook
|
|
|
|
, bluez
|
|
|
|
, dbus
|
|
|
|
, fdk_aac
|
|
|
|
, fetchFromGitHub
|
|
|
|
, gitUpdater
|
|
|
|
, glib
|
|
|
|
, libbsd
|
|
|
|
, ncurses
|
|
|
|
, pkg-config
|
|
|
|
, readline
|
|
|
|
, sbc
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "bluez-alsa";
|
2023-08-22 20:05:09 +00:00
|
|
|
version = "4.1.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Arkq";
|
|
|
|
repo = "bluez-alsa";
|
2024-01-25 14:12:00 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
|
|
|
hash = "sha256-oGaYiSkOhqfjUl+mHTs3gqFcxli3cgkRtT6tbjy3ht0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
|
|
|
pkg-config
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2024-01-25 14:12:00 +00:00
|
|
|
alsa-lib
|
|
|
|
bluez
|
|
|
|
glib
|
|
|
|
sbc
|
|
|
|
dbus
|
|
|
|
readline
|
|
|
|
libbsd
|
|
|
|
ncurses
|
|
|
|
] ++ lib.optionals aacSupport [
|
|
|
|
fdk_aac
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configureFlags = [
|
2024-01-25 14:12:00 +00:00
|
|
|
(lib.enableFeature aacSupport "aac")
|
|
|
|
(lib.enableFeature true "hcitop")
|
|
|
|
(lib.enableFeature true "rfcomm")
|
|
|
|
(lib.withFeatureAs true "alsaplugindir" "${placeholder "out"}/lib/alsa-lib")
|
|
|
|
(lib.withFeatureAs true "dbusconfdir" "${placeholder "out"}/share/dbus-1/system.d")
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
passthru.updateScript = gitUpdater { };
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://github.com/Arkq/bluez-alsa";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Bluez 5 Bluetooth Audio ALSA Backend";
|
|
|
|
longDescription = ''
|
|
|
|
Bluez-ALSA (BlueALSA) is an ALSA backend for Bluez 5 audio interface.
|
|
|
|
Bluez-ALSA registers all Bluetooth devices with audio profiles in Bluez
|
|
|
|
under a virtual ALSA PCM device called `bluealsa` that supports both
|
|
|
|
playback and capture.
|
|
|
|
|
|
|
|
Some backstory: Bluez 5 removed built-in support for ALSA in favor of a
|
|
|
|
generic interface for 3rd party appliations. Thereafter, PulseAudio
|
|
|
|
implemented a backend for that interface and became the only way to get
|
|
|
|
Bluetooth audio with Bluez 5. Users prefering ALSA stayed on Bluez 4.
|
|
|
|
However, Bluez 4 eventually became deprecated.
|
|
|
|
|
|
|
|
This package is a rebirth of a direct interface between ALSA and Bluez 5,
|
|
|
|
that, unlike PulseAudio, provides KISS near-metal-like experience. It is
|
|
|
|
not possible to run BluezALSA and PulseAudio Bluetooth at the same time
|
|
|
|
due to limitations in Bluez, but it is possible to run PulseAudio over
|
|
|
|
BluezALSA if you disable `bluetooth-discover` and `bluez5-discover`
|
|
|
|
modules in PA and configure it to play/capture sound over `bluealsa` PCM.
|
|
|
|
'';
|
2024-01-25 14:12:00 +00:00
|
|
|
license = with lib.licenses; [ mit ];
|
|
|
|
mainProgram = "bluealsa";
|
|
|
|
maintainers = with lib.maintainers; [ AndersonTorres oxij ];
|
|
|
|
platforms = lib.platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2024-01-25 14:12:00 +00:00
|
|
|
})
|
|
|
|
# TODO: aptxSupport
|