Skip to content

Commit

Permalink
ALSA PCM plugin hw compatibility modes silence
Browse files Browse the repository at this point in the history
  • Loading branch information
borine committed Dec 20, 2024
1 parent b1d3f9a commit c9decb5
Show file tree
Hide file tree
Showing 4 changed files with 337 additions and 78 deletions.
2 changes: 2 additions & 0 deletions .github/spellcheck-wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ CRC
CTL
CTLs
CVSD
ADC
DRC
ELD
eSCO
Expand Down Expand Up @@ -113,6 +114,7 @@ renderer
scalable
signedness
stdin
sys
syslog
tmp
tty
Expand Down
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ unreleased
- channel map and volume control for surround sound (5.1, 7.1) audio
- native A2DP volume control by default (dropped --a2dp-volume option)
- fix configuration for Android 13 A2DP Opus codec
- improved ALSA PCM support for A2DP-sink, HFP-HF and HSP-HS

bluez-alsa v4.3.1 (2024-08-30)
==============================
Expand Down
29 changes: 20 additions & 9 deletions doc/bluealsa-plugins.7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ PCM Parameters

HWCOMPAT
Modifies the behavior of the plugin on ``a2dp-sink``, ``hfp-hf`` and
``hsp-hs`` nodes in order to align better with the behavior of the ALSA
``hw`` plugin. This is a string option which takes the values **none** or
**busy**.
``hsp-hs`` nodes in order to align better with the behaviour of the ALSA
``hw`` plugin. This is a string option which takes the values **none**,
**busy** or **silence**.
See `Transport acquisition`_ in the **NOTES** section below for more
information.

Expand Down Expand Up @@ -137,7 +137,7 @@ own configuration (e.g. in ~/.asoundrc.conf) for example:
defaults.bluealsa.codec "cvsd"
defaults.bluealsa.volume "50+"
defaults.bluealsa.softvol off
defaults.bluealsa.hwcompat "busy"
defaults.bluealsa.hwcompat "silence"
defaults.bluealsa.delay 5000
defaults.bluealsa.service "org.bluealsa.source"

Expand Down Expand Up @@ -187,7 +187,7 @@ configuration node has the following fields:
[codec STR] # Preferred codec
[volume STR] # Initial volume for this PCM
[softvol BOOLEAN] # Enable/disable BlueALSA's software volume
[hwcompat STR] # HW compatibility mode (none or busy)
[hwcompat STR] # HW compatibility mode (none, busy or silence)
[delay INT] # Extra delay (frames) to be reported (default 0)
[service STR] # DBus name of service (default org.bluealsa)
}
Expand Down Expand Up @@ -569,9 +569,9 @@ only the HFP-AG node can change the HFP codec.
Transport acquisition
---------------------

The audio connection of a profile is not established immediately that a device
connects. The A2DP source device, or HFP/HSP gateway device, must first
"acquire" the profile transport.
The audio connection of a Bluetooth profile is not established immediately that
a device connects. The A2DP source device, or HFP/HSP gateway device, must
first "acquire" the profile transport.

When the BlueALSA PCM plugin is used on a source A2DP or gateway HFP/HSP node,
then **bluealsad(8)** will automatically acquire the transport and begin audio
Expand All @@ -583,7 +583,7 @@ does not define any state that can be directly mapped to this situation, so
the BlueALSA PCM plugin offers a choice of behaviors to suit various
application requirements. The choice is selected using the parameter
**hwcompat** (**HWCOMPAT** argument to the pre-defined `bluealsa` PCM) which
takes the following values:
takes one of the following values:

- none

Expand Down Expand Up @@ -616,6 +616,17 @@ takes the following values:
temporarily, which may cause issues for some applications as noted for the
**none** value above.

- silence

Inserts silence for capture streams, or simply drops frames for playback
streams, whenever the transport is not acquired. Short intervals of silence
may also be inserted into capture streams if there is a break in the
incoming stream (for example as a result Bluetooth link instability). By
this means a continuous stream is maintained as far as the application is
concerned. This is analogous to a soundcard device with no speakers or
microphone plugged in: only silence is captured and playback succeeds but
produces no sound.

PCM drain and non-blocking operation
------------------------------------

Expand Down
Loading

0 comments on commit c9decb5

Please sign in to comment.