Sort SYNOPSIS, descriptions, SEE ALSO.
Use more macros. Fix sections. New sentence, new line. Various other improvements.
This commit is contained in:
parent
ce31bd9da4
commit
3c1a929df9
|
@ -1,4 +1,4 @@
|
||||||
.\" $NetBSD: bta2dpd.8,v 1.1 2017/01/28 16:55:54 nat Exp $
|
.\" $NetBSD: bta2dpd.8,v 1.2 2017/01/28 23:52:45 wiz Exp $
|
||||||
.\"
|
.\"
|
||||||
.\" Copyright (c) 2015 - 2016 Nathanial Sloss <nathanialsloss@yahoo.com.au>
|
.\" Copyright (c) 2015 - 2016 Nathanial Sloss <nathanialsloss@yahoo.com.au>
|
||||||
.\" All rights reserved.
|
.\" All rights reserved.
|
||||||
|
@ -37,45 +37,44 @@
|
||||||
.Nd Bluetooth Advanced Audio Distribution Profile daemon
|
.Nd Bluetooth Advanced Audio Distribution Profile daemon
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.Nm
|
.Nm
|
||||||
.Op Fl d Ar device
|
|
||||||
.Op Fl m Ar mode
|
|
||||||
.Op Fl B Ar bitpool
|
|
||||||
.Op Fl V Ar volume
|
|
||||||
.Op Fl M Ar mtu
|
|
||||||
.Op Fl f Ar channel_mode
|
|
||||||
.Op Fl r Ar rate
|
|
||||||
.Op Fl b Ar blocks
|
|
||||||
.Op Fl e Ar encoding_bands
|
|
||||||
.Op Fl A Ar bitpool_allocation
|
|
||||||
.Op Fl v
|
.Op Fl v
|
||||||
|
.Op Fl A Ar bitpool_allocation
|
||||||
|
.Op Fl B Ar bitpool
|
||||||
|
.Op Fl b Ar blocks
|
||||||
|
.Op Fl d Ar device
|
||||||
|
.Op Fl e Ar encoding_bands
|
||||||
|
.Op Fl f Ar channel_mode
|
||||||
|
.Op Fl M Ar mtu
|
||||||
|
.Op Fl m Ar mode
|
||||||
|
.Op Fl r Ar rate
|
||||||
|
.Op Fl V Ar volume
|
||||||
.Fl a Ar address
|
.Fl a Ar address
|
||||||
.Ar files...
|
.Ar files ...
|
||||||
.Nm
|
.Nm
|
||||||
.Fl K
|
.Fl K
|
||||||
.Op Fl I
|
.Op Fl Iv
|
||||||
|
.Op Fl A Ar bitpool_allocation
|
||||||
|
.Op Fl B Ar bitpool
|
||||||
|
.Op Fl b Ar blocks
|
||||||
.Op Fl d Ar device
|
.Op Fl d Ar device
|
||||||
|
.Op Fl e Ar encoding_bands
|
||||||
|
.Op Fl f Ar channel_mode
|
||||||
.Op Fl m Ar mode
|
.Op Fl m Ar mode
|
||||||
.Op Fl p Ar psm
|
.Op Fl p Ar psm
|
||||||
.Op Fl B Ar bitpool
|
|
||||||
.Op Fl f Ar channel_mode
|
|
||||||
.Op Fl r Ar rate
|
.Op Fl r Ar rate
|
||||||
.Op Fl b Ar blocks
|
|
||||||
.Op Fl e Ar encoding_bands
|
|
||||||
.Op Fl A Ar bitpool_allocation
|
|
||||||
.Op Fl v
|
|
||||||
.Op a Ar address
|
.Op a Ar address
|
||||||
.Ar file
|
.Ar file
|
||||||
.Nm
|
.Nm
|
||||||
.Fl t
|
.Fl t
|
||||||
|
.Op Fl A Ar bitpool_allocation
|
||||||
.Op Fl B Ar bitpool
|
.Op Fl B Ar bitpool
|
||||||
.Op Fl V Ar volume
|
|
||||||
.Op Fl M Ar mtu
|
|
||||||
.Op Fl f Ar channel_mode
|
|
||||||
.Op Fl r Ar rate
|
|
||||||
.Op Fl b Ar blocks
|
.Op Fl b Ar blocks
|
||||||
.Op Fl e Ar encoding_bands
|
.Op Fl e Ar encoding_bands
|
||||||
.Op Fl A Ar bitpool_allocation
|
.Op Fl f Ar channel_mode
|
||||||
.Ar files...
|
.Op Fl M Ar mtu
|
||||||
|
.Op Fl r Ar rate
|
||||||
|
.Op Fl V Ar volume
|
||||||
|
.Ar files ...
|
||||||
.Nm
|
.Nm
|
||||||
.Fl t
|
.Fl t
|
||||||
.Fl K
|
.Fl K
|
||||||
|
@ -84,12 +83,9 @@
|
||||||
The
|
The
|
||||||
.Nm
|
.Nm
|
||||||
daemon is used to transmit/receive audio to/from Bluetooth devices such as
|
daemon is used to transmit/receive audio to/from Bluetooth devices such as
|
||||||
speakers or headphones, using the Advanced Audio Distribution Profile
|
speakers or headphones, using the Advanced Audio Distribution Profile
|
||||||
(A2DP)
|
(A2DP).
|
||||||
.Bl -tag -indent width
|
.Bl -tag -indent width
|
||||||
.It Fl d Ar device
|
|
||||||
Local device address.
|
|
||||||
May be given as BDADDR or device name.
|
|
||||||
.It Fl a Ar address
|
.It Fl a Ar address
|
||||||
Remote device address.
|
Remote device address.
|
||||||
The
|
The
|
||||||
|
@ -100,83 +96,91 @@ If a name was specified,
|
||||||
.Nm
|
.Nm
|
||||||
attempts to resolve the name via
|
attempts to resolve the name via
|
||||||
.Xr bt_gethostbyname 3 .
|
.Xr bt_gethostbyname 3 .
|
||||||
.It Ar files...
|
|
||||||
Files to stream. These can be wav files or CD-Audio Red Book data or output from
|
|
||||||
.Xr pad 4
|
|
||||||
device.
|
|
||||||
If not specified the default is stdin or stdout if -K applied and
|
|
||||||
.Nm
|
|
||||||
is used as an audio sink.
|
|
||||||
.Pp
|
|
||||||
When writing to a file or stdout it is raw 16-bit little endian (pulse coded
|
|
||||||
modulation) pcm data.
|
|
||||||
So a utility must be used to convert the file to add a header or use the
|
|
||||||
audioplay command as stated in EXAMPLES.
|
|
||||||
.It Fl M Ar mtu
|
|
||||||
Allows setting the Maximum Transmission Unit (MTU) for the streaming
|
|
||||||
connections.
|
|
||||||
.Pp
|
|
||||||
For most devices this would be 672 but if audio is broken or has gaps lowering
|
|
||||||
this value may help.
|
|
||||||
.It Fl I
|
|
||||||
Initiate a Discover command. Useful when used as an audio sink as some
|
|
||||||
devices need this to pair.
|
|
||||||
.It Fl K
|
|
||||||
Allows registering as an audio sink receiving an incoming connection.
|
|
||||||
.It Fl m Ar mode
|
|
||||||
Set L2CAP connection link mode.
|
|
||||||
Supported modes are:
|
|
||||||
.Pp
|
|
||||||
.Bl -tag -compact
|
|
||||||
.It auth
|
|
||||||
require devices to be paired.
|
|
||||||
.It encrypt
|
|
||||||
auth, plus enable encryption.
|
|
||||||
.It secure
|
|
||||||
encryption, plus change of link key.
|
|
||||||
.El
|
|
||||||
.It Fl p Ar psm
|
|
||||||
Allows changing the l2cap psm for an audio sink the default is 25.
|
|
||||||
Most all devices will use 25.
|
|
||||||
.It Fl t
|
|
||||||
Test mode can be used with -K to decode and receive encoded music from
|
|
||||||
stdout/stdin to file.
|
|
||||||
.It Fl V Ar volume
|
|
||||||
Allows shifting the volume of the music by 1 or 2 bits prior to encoding for
|
|
||||||
increased volume.
|
|
||||||
.Pp
|
|
||||||
.Sy USE WITH CARE
|
|
||||||
as this may mean the output is quite loud.
|
|
||||||
.It Fl B Ar bitpool
|
.It Fl B Ar bitpool
|
||||||
Allows setting the maximum bitpool value for your device.
|
Allows setting the maximum bitpool value for your device.
|
||||||
This may have to be lowered if audio is distorted.
|
This may have to be lowered if audio is distorted.
|
||||||
.Pp
|
.Pp
|
||||||
Use
|
Use
|
||||||
.Nm
|
.Nm
|
||||||
with only the -v option and the maximum bitpool for your device will be printed
|
with only the
|
||||||
to stdout.
|
.Fl v
|
||||||
|
option and the maximum bitpool for your device will be printed to stdout.
|
||||||
|
.It Fl d Ar device
|
||||||
|
Local device address.
|
||||||
|
May be given as BDADDR or device name.
|
||||||
|
.It Fl I
|
||||||
|
Initiate a Discover command.
|
||||||
|
Useful when used as an audio sink as some devices need this to pair.
|
||||||
|
.It Fl K
|
||||||
|
Allows registering as an audio sink receiving an incoming connection.
|
||||||
|
.It Fl M Ar mtu
|
||||||
|
Allows setting the Maximum Transmission Unit (MTU) for the streaming
|
||||||
|
connections.
|
||||||
|
.Pp
|
||||||
|
For most devices this would be 672 but if audio is broken or has gaps lowering
|
||||||
|
this value may help.
|
||||||
|
.It Fl m Ar mode
|
||||||
|
Set L2CAP connection link mode.
|
||||||
|
Supported modes are:
|
||||||
|
.Pp
|
||||||
|
.Bl -tag -compact -width encrypt
|
||||||
|
.It auth
|
||||||
|
Require devices to be paired.
|
||||||
|
.It encrypt
|
||||||
|
Auth, plus enable encryption.
|
||||||
|
.It secure
|
||||||
|
Encryption, plus change of link key.
|
||||||
|
.El
|
||||||
|
.It Fl p Ar psm
|
||||||
|
Allows changing the l2cap psm for an audio sink the default is 25.
|
||||||
|
Most all devices will use 25.
|
||||||
|
.It Fl t
|
||||||
|
Test mode can be used with
|
||||||
|
.Fl K
|
||||||
|
to decode and receive encoded music from stdout/stdin to file.
|
||||||
|
.It Fl V Ar volume
|
||||||
|
Allows shifting the volume of the music by 1 or 2 bits prior to encoding for
|
||||||
|
increased volume.
|
||||||
|
.Pp
|
||||||
|
.Sy USE WITH CARE
|
||||||
|
as this may mean the output is quite loud.
|
||||||
.It Fl v
|
.It Fl v
|
||||||
Be verbose.
|
Be verbose.
|
||||||
|
.It Ar files ...
|
||||||
|
Files to stream.
|
||||||
|
These can be WAV files or CD-Audio Red Book data or output from a
|
||||||
|
.Xr pad 4
|
||||||
|
device.
|
||||||
|
If not specified, the default is stdin or stdout if
|
||||||
|
.Fl K
|
||||||
|
applied and
|
||||||
|
.Nm
|
||||||
|
is used as an audio sink.
|
||||||
|
.Pp
|
||||||
|
When writing to a file or stdout it is raw 16-bit little endian (pulse coded
|
||||||
|
modulation) PCM data.
|
||||||
|
So a utility must be used to convert the file to add a header or use the
|
||||||
|
.Xr audioplay 1
|
||||||
|
command as stated in
|
||||||
|
.Sx EXAMPLES .
|
||||||
.El
|
.El
|
||||||
.Ss Channel Modes
|
.Ss Channel Modes
|
||||||
.Bl -tag -indent width
|
.Bl -tag -indent width
|
||||||
.It Fl f Ar channel_mode
|
.It Fl f Ar channel_mode
|
||||||
.Ar 0
|
.Bl -tag -width 2n
|
||||||
|
.It Ar 0
|
||||||
This specifies that all possible input formats are accepted and then one is
|
This specifies that all possible input formats are accepted and then one is
|
||||||
chosen starting with joint stereo then stereo then 2 channel then mono.
|
chosen starting with joint stereo then stereo then 2 channel then mono.
|
||||||
.Lp
|
.It Ar m
|
||||||
.Ar m
|
|
||||||
This specifies that the input is monophonic.
|
This specifies that the input is monophonic.
|
||||||
.Lp
|
.It Ar 2
|
||||||
.Ar 2
|
|
||||||
This specifies that the input is dual-channel.
|
This specifies that the input is dual-channel.
|
||||||
.Lp
|
.It Ar j
|
||||||
.Ar j
|
|
||||||
This specifies that the input is joint-stereo.
|
This specifies that the input is joint-stereo.
|
||||||
.Lp
|
.It Ar s
|
||||||
.Ar s
|
|
||||||
This specifies that the input is stereo.
|
This specifies that the input is stereo.
|
||||||
This is the default.
|
This is the default.
|
||||||
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
Specifying joint stereo as opposed to stereo would allow for a slightly higher
|
Specifying joint stereo as opposed to stereo would allow for a slightly higher
|
||||||
quality of playback as
|
quality of playback as
|
||||||
|
@ -184,95 +188,98 @@ quality of playback as
|
||||||
will only encode stereo and monophonic streams.
|
will only encode stereo and monophonic streams.
|
||||||
.It Fl r Ar rate
|
.It Fl r Ar rate
|
||||||
The frequency of the input.
|
The frequency of the input.
|
||||||
Where rate is one of 0 16000, 32000, 44100, 48000.
|
Where rate is one of 0, 16000, 32000, 44100, 48000.
|
||||||
This defaults to 44.1 kHz.
|
This defaults to 44.1 kHz.
|
||||||
.Pp
|
.Pp
|
||||||
A value of 0 will arbitrate from the highest to lowest frequency.
|
A value of 0 will arbitrate from the highest to lowest frequency.
|
||||||
.El
|
.El
|
||||||
.Ss Sub Band Codec (SBC) Encoding Options
|
.Ss Sub Band Codec (SBC) Encoding Options
|
||||||
.Bl -tag -indent width
|
.Bl -tag -indent width
|
||||||
|
.It Fl A Ar bitpool_allocation
|
||||||
|
.Bl -tag width 2n
|
||||||
|
.It Ar 0
|
||||||
|
Bit Allocation is negotiated starting with Loudness then SNR.
|
||||||
|
.It Ar S
|
||||||
|
Audio is encoded with SNR (Signal to Noise Ratio) bit allocation.
|
||||||
|
.It Ar L
|
||||||
|
Audio is encoded with Loudness bit allocation.
|
||||||
|
This is the default.
|
||||||
|
.El
|
||||||
.It Fl b Ar blocks
|
.It Fl b Ar blocks
|
||||||
Number of blocks to use for encoding.
|
Number of blocks to use for encoding.
|
||||||
Where blocks is one of 0 4, 8, 12, 16.
|
Where blocks is one of 0, 4, 8, 12, 16.
|
||||||
This defaults to 16 blocks.
|
This defaults to 16 blocks.
|
||||||
.Pp
|
.Pp
|
||||||
In the case of 0 the number of blocks is
|
In the case of 0 the number of blocks is
|
||||||
negotiated starting from 16 down to 4.
|
negotiated starting from 16 down to 4.
|
||||||
.It Fl e Ar bands
|
.It Fl e Ar bands
|
||||||
.Ar 0
|
.Bl -tag -width 2n
|
||||||
|
.It Ar 0
|
||||||
Number of SBC bands is negotiated 8 then 4.
|
Number of SBC bands is negotiated 8 then 4.
|
||||||
.Lp
|
.It Ar 4
|
||||||
.Ar 4
|
Audio is encoded with 4 SBC bands.
|
||||||
Audio is endoded with 4 SBC bands.
|
.It Ar 8
|
||||||
.Lp
|
Audio is encoded with 8 SBC bands.
|
||||||
.Ar 8
|
|
||||||
Audio is endoded with 8 SBC bands.
|
|
||||||
This is the default.
|
|
||||||
.It Fl A Ar bitpool_allocation
|
|
||||||
.Ar 0
|
|
||||||
Bit Allocation is negotiated starting with Loudness then SNR.
|
|
||||||
.Lp
|
|
||||||
.Ar S
|
|
||||||
Audio is encoded with SNR (Signal to Noise Ratio) bit allocation.
|
|
||||||
.Lp
|
|
||||||
.Ar L
|
|
||||||
Audio is encoded with Loudness bit allocation.
|
|
||||||
This is the default.
|
This is the default.
|
||||||
.El
|
.El
|
||||||
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
It may be necessary to use
|
It may be necessary to use
|
||||||
.Xr btconfig 1
|
.Xr btconfig 8
|
||||||
to set the class of your bluetooth adapter to that of headphones when
|
to set the class of your Bluetooth adapter to that of headphones when
|
||||||
using
|
using
|
||||||
.Nm
|
.Nm
|
||||||
as an audio sink.
|
as an audio sink.
|
||||||
i.e
|
I.e.,
|
||||||
.Dl btconfig ubt0 class 0x200418
|
.Dl btconfig ubt0 class 0x200418
|
||||||
Then start
|
Then start
|
||||||
.Nm
|
.Nm
|
||||||
with -K before pairing.
|
with
|
||||||
|
.Fl K
|
||||||
|
before pairing.
|
||||||
.Pp
|
.Pp
|
||||||
This is necessary as some devices only perform an
|
This is necessary as some devices only perform an
|
||||||
.Xr sdpquery 1
|
.Xr sdpquery 1
|
||||||
just after pairing and cache the result.
|
just after pairing and cache the result.
|
||||||
.Pp
|
.Pp
|
||||||
It is possible to specify multiples of -r -e -b -f .
|
It is possible to specify multiples of
|
||||||
|
.Fl r Fl e Fl b Fl f .
|
||||||
This will mean that the specified combinations are reported as being accepted
|
This will mean that the specified combinations are reported as being accepted
|
||||||
by the source/sink.
|
by the source/sink.
|
||||||
.Pp
|
.Pp
|
||||||
When used as a sink -K all modes, bands, blocks and allocation modes will be
|
When used as a sink
|
||||||
|
.Fl ( K ) ,
|
||||||
|
all modes, bands, blocks and allocation modes will be
|
||||||
accepted unless specified as options.
|
accepted unless specified as options.
|
||||||
i.e -r 44100 will only accept a connection with a rate of 44.1kHz.
|
I.e.,
|
||||||
|
.Fl r Ar 44100
|
||||||
|
will only accept a connection with a rate of 44.1kHz.
|
||||||
.Sh EXAMPLES
|
.Sh EXAMPLES
|
||||||
.Dl bta2dpd -a spkr my.wav
|
.Dl bta2dpd -a spkr my.wav
|
||||||
.Lp
|
|
||||||
Encode and send audio
|
Encode and send audio
|
||||||
.Pa my.wav
|
.Pa my.wav
|
||||||
to address
|
to address
|
||||||
.Sq spkr .
|
.Sq spkr .
|
||||||
.Pp
|
.Pp
|
||||||
.Dl bta2dpd -a spkr /dev/pad
|
.Dl bta2dpd -a spkr /dev/pad
|
||||||
.Lp
|
|
||||||
Encode and send audio from
|
Encode and send audio from
|
||||||
.Xr pad 4
|
.Xr pad 4
|
||||||
to address
|
to address
|
||||||
.Sq spkr .
|
.Sq spkr .
|
||||||
.Pp
|
.Pp
|
||||||
.Dl bta2dpd -K out.pcm
|
.Dl bta2dpd -K out.pcm
|
||||||
.Lp
|
|
||||||
Decode stream from any connected address
|
Decode stream from any connected address
|
||||||
and write it to
|
and write it to
|
||||||
.Pa out.pcm .
|
.Pa out.pcm .
|
||||||
.Pp
|
.Pp
|
||||||
.Dl bta2dpd -K -a phone | audioplay -f -e linear -P 16 -s 44100 -c 2 --
|
.Dl bta2dpd -K -a phone | audioplay -f -e linear -P 16 -s 44100 -c 2 --
|
||||||
.Lp
|
|
||||||
Decode stream from address
|
Decode stream from address
|
||||||
.Sq phone
|
.Sq phone
|
||||||
and send to speakers.
|
and send to speakers.
|
||||||
.Sh SEE ALSO
|
.Sh SEE ALSO
|
||||||
.Xr pad 4 ,
|
|
||||||
.Xr audioplay 1 ,
|
.Xr audioplay 1 ,
|
||||||
.Xr btconfig 1 ,
|
.Xr sdpquery 1 ,
|
||||||
.Xr sdpquery 1
|
.Xr pad 4 ,
|
||||||
|
.Xr btconfig 8
|
||||||
.Sh AUTHORS
|
.Sh AUTHORS
|
||||||
.An Nathanial Sloss
|
.An Nathanial Sloss
|
||||||
|
|
Loading…
Reference in New Issue