mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
bluez5: add aptx-LL codec
Support the low-latency variant of the aptx codec. The magic mostly seems to be on the device side, since the stream is the same as standard aptx, but latency is smaller even if stream/packet sizes are the same. Sound output latency is noticeably less than with the standard aptx. Tested on Sennheiser HD 250 / Avantree Aria Pro. The codec in principle also supports bidirectional duplex streams, but that is not implemented here.
This commit is contained in:
parent
73994feda9
commit
90b62ba2b3
6 changed files with 143 additions and 21 deletions
|
|
@ -1933,24 +1933,20 @@ int64_t spa_bt_transport_get_delay_nsec(struct spa_bt_transport *t)
|
|||
if (t->a2dp_codec == NULL)
|
||||
return 30 * SPA_NSEC_PER_MSEC;
|
||||
|
||||
switch (t->a2dp_codec->codec_id) {
|
||||
case A2DP_CODEC_SBC:
|
||||
switch (t->a2dp_codec->id) {
|
||||
case SPA_BLUETOOTH_AUDIO_CODEC_SBC:
|
||||
case SPA_BLUETOOTH_AUDIO_CODEC_SBC_XQ:
|
||||
return 200 * SPA_NSEC_PER_MSEC;
|
||||
case A2DP_CODEC_MPEG24:
|
||||
case SPA_BLUETOOTH_AUDIO_CODEC_MPEG:
|
||||
case SPA_BLUETOOTH_AUDIO_CODEC_AAC:
|
||||
return 200 * SPA_NSEC_PER_MSEC;
|
||||
case A2DP_CODEC_VENDOR:
|
||||
{
|
||||
uint32_t vendor_id = t->a2dp_codec->vendor.vendor_id;
|
||||
uint16_t codec_id = t->a2dp_codec->vendor.codec_id;
|
||||
|
||||
if (vendor_id == APTX_VENDOR_ID && codec_id == APTX_CODEC_ID)
|
||||
return 150 * SPA_NSEC_PER_MSEC;
|
||||
if (vendor_id == APTX_HD_VENDOR_ID && codec_id == APTX_HD_CODEC_ID)
|
||||
return 150 * SPA_NSEC_PER_MSEC;
|
||||
if (vendor_id == LDAC_VENDOR_ID && codec_id == LDAC_CODEC_ID)
|
||||
return 175 * SPA_NSEC_PER_MSEC;
|
||||
break;
|
||||
}
|
||||
case SPA_BLUETOOTH_AUDIO_CODEC_APTX:
|
||||
case SPA_BLUETOOTH_AUDIO_CODEC_APTX_HD:
|
||||
return 150 * SPA_NSEC_PER_MSEC;
|
||||
case SPA_BLUETOOTH_AUDIO_CODEC_LDAC:
|
||||
return 175 * SPA_NSEC_PER_MSEC;
|
||||
case SPA_BLUETOOTH_AUDIO_CODEC_APTX_LL:
|
||||
return 40 * SPA_NSEC_PER_MSEC;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue