Commit Graph

1763 Commits

Author SHA1 Message Date
Michal Labedzki
9696f5ab39 AVRCP: Update constant names for AVRCP 1.4
AVRCP 1.4 introduces status code that is not error code, so using
"status" prefix for both.
2012-07-04 16:35:26 +03:00
Frédéric Dalleau
c301b7650b audio: Remove unimplemented declaration 2012-07-04 15:37:00 +03:00
Frédéric Dalleau
3e68d12a4f audio: Fix style issue in start_timeout
open_acp is a boolean and not an integer
2012-07-02 19:12:34 +03:00
Frédéric Dalleau
a6542f9dde audio: Fix missing reply to Acquire in AVDTP
Calling org.bluez.MediaEndpoint.Acquire ends in avdtp_start().
If bluez is acceptor of AVDTP_OPEN, then avdtp_start is delayed in a
timer in order to wait for the initiator to send AVDTP_START.
If the timer expires, avdtp_start() is called a second time and find
that Bluez is acceptor. This time, since a timer already exists, Bluez
does nothing and the answer to Acquire is never sent.
The idea of this patch is that if we get in the timeout, we will no longer
care whether we accepted open or not.
2012-07-02 18:32:01 +03:00
Luiz Augusto von Dentz
9153d66ad7 audio: Remove remaining references to Socket 2012-07-02 13:19:40 +03:00
Luiz Augusto von Dentz
c1d42542b9 audio: Remove local A2DP endpoints options
The local endpoints are no use without the internal IPC.
2012-07-02 13:13:50 +03:00
Luiz Augusto von Dentz
f2bdd7243e audio: Remove internal audio IPC
With unix socket and ALSA removed there is no longer any use for the
internal IPC.
2012-07-02 13:13:46 +03:00
Luiz Augusto von Dentz
4ff9b99292 audio: Remove ALSA support
ALSA support depend on unix support that is now removed.
2012-07-02 13:13:43 +03:00
Luiz Augusto von Dentz
1d9d0527cf audio: Remove unix socket support
Unix socket support is deprecated by Media API.
2012-07-02 13:13:39 +03:00
Szymon Janc
c1d6620752 audio: Remove not needed NULL pointer checks
g_new0 always returns valid pointer and there is no need to check that.
2012-06-29 14:25:12 +03:00
Luiz Augusto von Dentz
e2d49cfa89 AVDTP: Fix disconnecting when acting as sink
Usually after pairing the source will attempt to connect and create a
stream, but it may never send AVDTP_START command as it is not
playing anything. In the meantime the local endpoint may attempt to
acquire the transport, but since it was the remote side that opened the
stream instead of sending AVDTP_START the code now wait and eventually
timeout.

To fix this now instead of just waiting the remote to send AVDTP_START
the code will attempt to send the command if nothing is received after
a small timeout (1s).
2012-06-29 14:08:35 +03:00
Luiz Augusto von Dentz
9d656c7a1d AVDTP: Remove auto_dc flag
auto_dc flag is no longer useful as all the users of it just reset it
to FALSE, also this was first introduced to maintain the stream for
some time as the clients disconnected frequently, but this is not the
case anymore.
2012-06-29 14:07:31 +03:00
Rafael Fonseca
20ad88c5c7 Update comment in the audio.conf file.
The config file erroneously said that all services were available by
default. Actually Gateway, Source and Socket are disabled.
2012-06-29 14:01:03 +03:00
Michal Labedzki
256fde4f35 AVRCP: Convert spaces to tabs
Fix coding style issue.
2012-06-28 13:14:10 +03:00
Frédéric Dalleau
2f92669697 audio: Permit concurrent use of AG and HF roles
If a device supports both HF and AG roles, then if a SCO connection
related to AG profile happens, the connection is rejected because HF is
not connected. One consequence is pulseaudio failing to load bluetooth
module.
2012-06-28 13:06:57 +03:00
Lucas De Marchi
a66a557038 Fix GDBus flags after conversion to macros
Commit "aa3b9016bf444b60e1b7e1804dfc323a23a93c5a Convert GDBus methods
to use macro helpers" converted the previous tables to use the new
macros but some flags were lost.
2012-06-27 10:33:53 +03:00
Luiz Augusto von Dentz
9d2f3c94d6 AVDTP: Fix rejecting AVDTP Start if starting flag is set
This is now handled by checking if the command collided.
2012-06-18 11:40:37 +03:00
Luiz Augusto von Dentz
83630251be audio: Fix aborting A2DP setup while AVDTP Start is in progress
Change return of avdtp_start to -EINPROGRESS so the caller can check if
the operation is in progress and don't abort because of that.
2012-06-15 17:50:58 +03:00
Luiz Augusto von Dentz
a59e82103a AVDTP: Fix responding to ABORT with reject
ABORT command cannot be rejected
2012-06-15 17:50:23 +03:00
Luiz Augusto von Dentz
2b3bf7b241 AVDTP: Do not respond ABORT command with invalid id
AVDTP spec, 8.15.2 Abort Response:

  "If an AVDTP_ABORT_CMD contains an invalid SEID, no response shall be
  sent."
2012-06-15 17:50:14 +03:00
Luiz Augusto von Dentz
34d9bd7dd2 audio: Wait remote side to send AVDTP_START when acting as acceptor
Some devices like Sony Ericsson MW600 reject AVDTP_START if it was the
initiator of the connection, apparently it follows recommendation 12 of
simultaneous use of HFP, A2DP and AVRCP profiles white paper which says:

  "If the RD has configured and opened a stream it is also responsible to
  start the streaming via GAVDP_START."

If the client is fast enough and try to acquire the transport this cause
an error, so instead of sending AVDTP_START the code now checks if it is
the acceptor of the stream and wait the remote side to send the command.
2012-06-15 17:50:01 +03:00
Luiz Augusto von Dentz
4503dba4ba audio: Fix handling of A2DP abort indication
When an abort is received all setup callbacks should return an error.
2012-06-15 17:49:42 +03:00
Luiz Augusto von Dentz
c1b8914642 audio: Fix handling of A2DP start indication
Only process callbacks if avdtp_start was sent, otherwise it may cancel
setup callbacks that were registere via g_idle_add.
2012-06-15 17:49:33 +03:00
Luiz Augusto von Dentz
ef539d8461 audio: Fix handling of A2DP open indication
When accepting the open indication all config callbacks should be
notified that open completed.
2012-06-15 17:49:25 +03:00
Luiz Augusto von Dentz
c5bf6d662b audio: Fix handling of A2DP suspend indication
When accepting the suspend indication all callbacks should be notified
that suspend completed.

In addition to this fix not using avdtp_start return in indication
callback as well as in the confirmation.
2012-06-15 17:48:52 +03:00
Luiz Augusto von Dentz
ee89674c0b audio: Add handling of AVDTP command collision
Check collision for AVDTP Open, Close, Start, Suspend and Abort commands
and if they collided remove the pending request if SEP has accepted the
indication.
2012-06-15 17:47:53 +03:00
Luiz Augusto von Dentz
07b6738fb4 audio: Separate profile specific fields from media_transport 2012-06-12 16:38:45 +03:00
Daniel Wagner
b968b12927 audio: Move UUID string definition to lib 2012-06-02 09:06:32 +08:00
Anderson Lizardo
48d317102e Remove compatibility check for DBUS_TYPE_UNIX_FD
Since commit c89b589a58, D-Bus >= 1.4.0 is
required. This version already contains Unix FD passing support,
therefore code that checks for DBUS_TYPE_UNIX_FD definition is
unnecessary.
2012-05-31 11:29:58 +03:00
Luiz Augusto von Dentz
e1942bc1be AVRCP: Fix not registering to VolumeChanged event again when notified
The spec says:

"A registered notification gets changed on receiving CHANGED event
notification. For a new notification additional NOTIFY command is
expected to be sent."
2012-05-28 14:36:26 +03:00
Luiz Augusto von Dentz
da8b6211d8 audio: Add Volume property to A2DP transport GetProperties
Now that volume is being handled by SetProperty it should also be
available in GetProperties.
2012-05-27 22:44:43 +03:00
Luiz Augusto von Dentz
3b3e3c3df6 AVRCP: Add support for sending SetAbsoluteVolume
Once the transport volume is changed update the remote volume by sending
SetAbsoluteVolume:

< AVCTP: Command : pt 0x00 transaction 9 pid 0x110e
    AV/C: Changed: address 0x48 opcode 0x00
      Subunit: Panel
      Opcode: Vendor Dependent
      Company ID: 0x001958
      AVRCP: SetAbsoluteVolume: pt Single len 0x0001
        Volume: 100.00% (127/127)
> AVCTP: Response : pt 0x00 transaction 9 pid 0x110e
    AV/C: Accepted: address 0x48 opcode 0x00
      Subunit: Panel
      Opcode: Vendor Dependent
      Company ID: 0x001958
      AVRCP: SetAbsoluteVolume: pt Single len 0x0001
        Volume: 100.00% (127/127)
2012-05-27 22:44:20 +03:00
Luiz Augusto von Dentz
32b2b057fd audio: Fix signature type for transport Volume
Signature is now uint16 instead of byte
2012-05-27 22:44:07 +03:00
Luiz Augusto von Dentz
dbe02b8c00 audio: Fix updating volume property for non-A2DP transports
Volume property is A2DP only
2012-05-27 22:43:37 +03:00
Luiz Augusto von Dentz
bd7644ed29 AVRCP: Fix initializing volume before checking PDU type
Response may be rejected or not implemented so the operand used to
initialize the variable may not even exist.
2012-05-27 22:42:39 +03:00
Lucas De Marchi
f04e4a740e AVRCP: Remove unneeded check for set_volume callback 2012-05-25 10:43:19 +03:00
Luiz Augusto von Dentz
ea5e0da40e AVRCP: Fix not setting audio device connected to player
While connecting device should be set to match the AVCTP session and when
disconnected reset it back to NULL.
2012-05-25 10:41:42 +03:00
Luiz Augusto von Dentz
fda5d9f638 AVCTP: Fix setting wrong transaction id expected for responses
The id were incremented after being set to the request so it is always
+1 of the actual transaction.
2012-05-25 10:41:26 +03:00
Syam Sidhardhan
732b5eb55f audio: Remove unwanted code from manager
Here the variable adp never be NULL, so no need to check it
against NULL.
2012-05-24 11:08:51 +03:00
Syam Sidhardhan
44e59c8d9f avctp: Fix NULL check after dereference
Check for session != NULL has to be done before accessing session.
2012-05-24 11:07:15 +03:00
Syam Sidhardhan
e03ca07559 media: Remove redundant D-Bus error initilization 2012-05-24 11:04:29 +03:00
Marcel Holtmann
df347cbbac audio: Change the file mode back to 644 2012-05-22 20:29:27 +02:00
Luiz Augusto von Dentz
bb846fcc33 audio: Fix media transport creation for gateway endpoints
The device maybe connected to another adapter other than the endpoint's
so the adapters must be first check.
2012-05-22 16:37:23 +03:00
Frédéric Danis
0d81fc7cf1 audio: Fix media transport creation
Prevents set_configuration() to be called on another adapter
than connecting one
2012-05-22 16:37:23 +03:00
Anderson Lizardo
173cde1eb4 avdtp: Fix incorrect gchar buffer allocation
The code was allocating an array of gchar pointers, where an array of
gchar is expected.
2012-05-22 12:59:14 +03:00
Joohi Rastogi
839012faf3 AVRCP: Add missing Player Setting feature in TG record 2012-05-22 12:57:44 +03:00
Joohi Rastogi
a25de3dcd6 AVRCP: Refactor the code using constants 2012-05-22 12:57:44 +03:00
Luiz Augusto von Dentz
32b4ad5af8 AVRCP: Bump TG record to 1.4
The only mandatory feature for 1.4 is absolute volume control which is
now supported.
2012-05-18 20:48:53 +03:00
Luiz Augusto von Dentz
a282fff97d AVRCP: Subscribe for VolumeChanged Notification
If the remote device support version 1.4 or latter send register command
for VolumeChanged event:

< AVCTP: Command : pt 0x00 transaction 0 pid 0x110e
    AV/C: Notify: address 0x48 opcode 0x00
      Subunit: Panel
      Opcode: Vendor Dependent
      Company ID: 0x001958
      AVRCP: RegisterNotification: pt Single len 0x0005
        EventID: 0x0d (EVENT_VOLUME_CHANGED)
        Interval: 0x00000000 (0 seconds)
> AVCTP: Response : pt 0x00 transaction 0 pid 0x110e
    AV/C: Interim: address 0x48 opcode 0x00
      Subunit: Panel
      Opcode: Vendor Dependent
      Company ID: 0x001958
      AVRCP: RegisterNotification: pt Single len 0x0002
        EventID: 0x0d (EVENT_VOLUME_CHANGED)
        Volume: 100.00% (127/127)
2012-05-18 20:48:12 +03:00
Luiz Augusto von Dentz
54c412c370 AVRCP: Add define for VolumeChanged event 2012-05-18 20:36:44 +03:00