audio/player: Fix not being able to register players of different types
Luiz Augusto von Dentz
maintainerPATCH 1/1 audio/player: Fix not being able to register players of different types
From: Luiz Augusto von Dentz <[email protected]>
When registering players both AVRCP and MCP were using the same object path making them clash, so this fix it by adding a type to the object path so each profile can register their player in their own domain.
--- profiles/audio/avrcp.c | 2 +- profiles/audio/mcp.c | 3 ++- profiles/audio/player.c | 5 +++-- profiles/audio/player.h | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-)
profiles/audio/avrcp.c +1 -1
@@ -3577,7 +3577,7 @@ static struct avrcp_player *create_ct_player(struct avrcp *session, path =device_get_path (session->dev); - mp =media_player_controller_create (path, id); + mp =media_player_controller_create (path,"avrcp" , id);if (mp ==NULL ) {g_free (player);return NULL ;
profiles/audio/mcp.c +2 -1
@@ -342,7 +342,8 @@ static int mcp_accept(struct btd_service *service)bt_mcp_attach (data->mcp, client); - data->mp =media_player_controller_create (device_get_path (device),0 ); + data->mp =media_player_controller_create (device_get_path (device), +"mcp" ,0 );if (data->mp ==NULL ) {DBG ("Unable to create Media Player" );return -EINVAL ;
profiles/audio/player.c +3 -2
@@ -1277,13 +1277,14 @@ void media_player_destroy(struct media_player *mp) }struct media_player *media_player_controller_create (const char *path, -uint16_t id) +const char *type, +uint16_t id) {struct media_player *mp; mp = g_new0(struct media_player, 1); mp->device =g_strdup (path); - mp->path =g_strdup_printf ("%s/player%u" , path, id); + mp->path =g_strdup_printf ("%s/%s/player%u" , path, type, id); mp->settings =g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); mp->track = g_hash_table_new_full(g_str_hash, g_str_equal,
profiles/audio/player.h +2 -1
@@ -61,7 +61,8 @@ struct media_player_callback { };struct media_player *media_player_controller_create (const char *path, -uint16_t id); +const char *type, +uint16_t id);const char *media_player_get_path (struct media_player *mp);void media_player_destroy (struct media_player *mp);void media_player_set_duration (struct media_player *mp,uint32_t duration);
Signature · 1 line
2.49.0
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=967039
---Test result---
Test Summary:
CheckPatch PENDING 0.30 seconds GitLint PENDING 0.34 seconds BuildEll PASS 20.22 seconds BluezMake PASS 2812.85 seconds MakeCheck PASS 20.19 seconds MakeDistcheck FAIL 8.60 seconds CheckValgrind PASS 278.49 seconds CheckSmatch PASS 305.18 seconds bluezmakeextell PASS 128.78 seconds IncrementalBuild PENDING 0.35 seconds ScanBuild PASS 916.34 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: MakeDistcheck - FAIL
Desc: Run Bluez Make Distcheck
Output:
make[2]: *** No rule to make target 'doc/mgmt-api.txt', needed by 'distdir-am'. Stop. make[1]: *** [Makefile:12179: distdir] Error 2
make: *** [Makefile:12255: dist] Error 2
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:
---
Regards,
Linux Bluetooth
This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:
Hello:
This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:
Quoted 9 lines · On Wed, 28 May 2025 10:21:12 -0400 you wrote:
From: Luiz Augusto von Dentz <[email protected]>
When registering players both AVRCP and MCP were using the same object path making them clash, so this fix it by adding a type to the object path so each profile can register their player in their own domain.
[...]
Here is the summary with links:
- [BlueZ,v1] audio/player: Fix not being able to register players of different types
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=f2cc37050402
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html