ORG.BLUEALSA.PCM1(7)
β¨ org.bluealsa.PCM1 β¨
okay bestie, sit down, hydrate, and get comfy because we are reading the manual page for org.bluealsa.PCM1 β the Bluetooth Audio PCM D-Bus API π it lives in section 7 of the manual, and it's basically the group chat between you and the bluealsa service. no cap, it's giving β¨interfaceβ¨.
πΈ SYNOPSIS πΈ
Service
org.bluealsa[.unique ID]
Interface
org.bluealsa.PCM1
Object path
[variable prefix]/{hci0,...}/dev_XX_XX_XX_XX_XX_XX/[type]/[mode]
π¦ DESCRIPTION π¦
so this page is all about the D-Bus PCM interface of the bluealsa(8) service π«Ά and like, what it does is give you access to the individual PCM objects that this service creates. one at a time, your own little baby PCM. iconic.
π Methods π
fd, fd Open()β opens a BlueALSA PCM stream π and it hands you back two file descriptors: the PCM stream PIPE and the PCM controller SEQPACKET socket. two for the price of one, we love a package deal.
Controller socket commands: "Drain", "Drop", "Pause", "Resume"
Possible Errors:
dbus.Error.InvalidArguments
dbus.Error.NotSupported
dbus.Error.Failed
array{string, dict} GetCodecs()β returns the array of additional PCM codecs π and you, the client, can switch to any one of them with theSelectCodec()D-Bus method call. choose your fighter.
The dictionary may contain the following properties:
array{byte} Capabilitiesβ A2DP codec capabilities blob.array{byte} SupportedChannelsβ List of supported number of audio channels.array{uint32} SupportedSamplingβ List of supported sampling frequency.
void SelectCodec(string codec, dict props)β selects the PCM codec β okay so important thing: this call shall be made before the PCM stream is opened for the given transport type, otherwise the ongoing stream (or its PCM counterpart: sink, source) will be terminated. yes, terminated. π so do it in the right order, bestie, i'm begging.
For A2DP codecs, the client can override the built-in logic for selecting codec configuration by providing the configuration blob via the "Configuration" property. Provided configuration must be valid for the given codec in respect to BlueALSA and peer device capabilities. Otherwise, the call will fail. It is possible to override this validation by setting the "NonConformant" property to true. (chaotic. i respect it. π)
In case of codecs which support different number of audio channels or sampling frequencies, the client can select the desired configuration by providing the "Channels" and "Sampling" properties respectively. These properties take precedence over the provided codec configuration. they said "i'm the main character" and they meant it.
Possible Errors:
dbus.Error.InvalidArguments
dbus.Error.NotSupported
dbus.Error.Failed
void SetDelayAdjustment(string codec, int16 adjustment)β sets an arbitrary adjustment (+/-) to the reportedDelayin 1/10 of millisecond for a specific codec π°οΈ this adjustment gets applied to theDelayproperty when that codec is selected, and it's there to compensate for devices that do not report accurateDelayvalues. some devices are just out here lying about time, smh.
Possible Errors:
dbus.Error.InvalidArguments
array{string, int16} GetDelayAdjustments()β returns the array of currently set delay adjustments π each entry of the array gives the name of a codec and the adjustment that the PCM will apply to theDelayproperty when that codec is selected. receipts, basically. π§Ύ
π Properties π
object Device[readonly] β BlueZ device object path.uint32 Sequence[readonly] β this property indicates the sequence in which devices connected. the larger the value, the later the device was connected. so big number = late arrival, no judgment. π’string Transport[readonly] β underlying Bluetooth transport type.
Possible values:
"A2DP-sink"
"A2DP-source"
"HFP-AG"
"HFP-HF"
"HSP-AG"
"HSP-HS"
string Mode[readonly] β PCM stream operation mode (direction).
Possible values:
"sink"
"source"
boolean Running[readonly] β this property istruewhen the Bluetooth transport for this PCM is acquired and able to transfer audio samples π₯ so like, it's awake, it's ready, it's serving.uint16 Format[readonly] β stream format identifier π the highest two bits of the 16-bit identifier determine the signedness and the endianness. the next 6 bits determine the physical width of a sample in bytes. the lowest 8 bits are used to store the actual sample bit-width. bit math, my beloved.
Examples:
0x4210 - unsigned 16-bit 2 bytes big-endian
0x8418 - signed 24-bit 4 bytes little-endian
byte Channels[readonly] β number of audio channels.uint32 Sampling[readonly] β sampling frequency.string Codec[readonly] β Bluetooth transport codec. this property is available only when the transport codec is selected. no codec, no property, that's the rule. πarray{byte} CodecConfiguration[readonly] β optional. Bluetooth transport codec configuration blob. this property is available only for transports which support codec configuration (e.g. A2DP).uint16 Delay[readonly] β approximate PCM delay in 1/10 of millisecond.int16 DelayAdjustment[readonly] β an adjustment (+/-) included within the reportedDelayin 1/10 of millisecond to compensate for devices that do not report accurate delay values.boolean SoftVolume[readwrite] β this property determines whether BlueALSA will make volume control internally, or will delegate this task to the BlueALSA PCM client or the connected Bluetooth device respectively for PCM sink or PCM source. who's holding the aux cord, essentially. π§uint16 Volume[readwrite] β this property holds volume (loudness) value and mute information for channel 1 (left) and 2 (right). data for channel 1 is stored in the upper byte, channel 2 is stored in the lower byte. the highest bit of both bytes determines whether the channel is muted. π
Possible values:
A2DP: 0-127
SCO: 0-15
π COPYRIGHT π
Copyright (c) 2016-2023 Arkadiusz Bokowy.
The bluez-alsa project is licensed under the terms of the MIT license.
π«Ά SEE ALSO π«Ά
bluealsa-cli(1), bluealsa-plugins(5), bluealsa(8)
Project web site
<https://github.com/arkq/bluez-alsa>
and that's the whole page, bestie, you ate that π this was BlueALSA v4.3.1, dated July 2024, signing off with a little kiss β go forth and open some PCM streams, but in the right order, okay? πβ¨πΈ
π¦ where this page comes from
- alpine 3.24: bluez-alsa-doc 4.3.1-r0 Β· MIT
- debian trixie: libasound2-plugin-bluez 4.3.1-3 Β· MIT
- ubuntu questing: libasound2-plugin-bluez 4.3.1-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms