android/AVDTP: Make signalling channel high priority
Luiz Augusto von Dentz
maintainerRFC 1/1 android/AVDTP: Make signalling channel high priority
From: Luiz Augusto von Dentz <[email protected]>
This makes signalling high priority (6) so it can push commands before the stream channel, without this the stream channel may be schedule first and cause the signalling commands to timeout while waiting a slot.
--- android/avdtp.c | 9 +++++++++ 1 file changed, 9 insertions(+)
android/avdtp.c +9 -0
@@ -2057,6 +2057,7 @@ struct avdtp *avdtp_new(int fd, size_t imtu, size_t omtu, uint16_t version)struct avdtp *session;GIOCondition cond =G_IO_IN |G_IO_ERR |G_IO_HUP |G_IO_NVAL ;int new_fd; +int priority; new_fd =dup (fd);if (new_fd <0 ) {
@@ -2064,6 +2065,14 @@ struct avdtp *avdtp_new(int fd, size_t imtu, size_t omtu, uint16_t version)return NULL ; } + priority =6 ; +if (setsockopt (new_fd,SOL_SOCKET ,SO_PRIORITY , + (const void *) &priority,sizeof (priority)) <0 ) { +error ("setsockopt(SO_PRIORITY): %s (%d)" ,strerror (errno), + errno); +return NULL ; + } + session = g_new0(struct avdtp, 1); session->io =g_io_channel_unix_new (new_fd); session->version = version;
Signature · 1 line
1.8.4.2
Marcel Holtmann
maintainerHi Luiz,
Quoted 21 lines
This makes signalling high priority (6) so it can push commands before the stream channel, without this the stream channel may be schedule first and cause the signalling commands to timeout while waiting a slot.
---android/avdtp.c| 9 +++++++++1 file changed, 9 insertions(+)android/avdtp.c +1
-0@@ -2057,6 +2057,7 @@ struct avdtp *avdtp_new(int fd, size_t imtu, size_t omtu, uint16_t version)struct avdtp *session;GIOCondition cond =G_IO_IN |G_IO_ERR |G_IO_HUP |G_IO_NVAL ;int new_fd; +int priority; new_fd =dup (fd);if (new_fd <0 ) {@@ -2064,6 +2065,14 @@ struct avdtp *avdtp_new(int fd, size_t imtu, size_t omtu, uint16_t version)return NULL ;
android/avdtp.c struct avdtp *avdtp_new(int fd, size_t imtu, size_t omtu, uint16_t version) · line 2075
Quoted 10 lines
android/avdtp.c +8
-0} + priority =6 ; +if (setsockopt (new_fd,SOL_SOCKET ,SO_PRIORITY , + (const void *) &priority,sizeof (priority)) <0 ) { +error ("setsockopt(SO_PRIORITY): %s (%d)" ,strerror (errno), + errno); +return NULL ; + } +
I think we should make it one higher than the media channel. If we are currently using priority 6 on the media channel than this should be 7. If 7 is not possible, then we might degrade the media channel to 5.
Regards
Marcel
Luiz Augusto von Dentz
maintainerHi Marcel,
Quoted 25 lines · Marcel Holtmann
Hi Luiz,
Quoted 23 lines
This makes signalling high priority (6) so it can push commands before the stream channel, without this the stream channel may be schedule first and cause the signalling commands to timeout while waiting a slot.
---android/avdtp.c| 9 +++++++++1 file changed, 9 insertions(+)android/avdtp.c +1
-0@@ -2057,6 +2057,7 @@ struct avdtp *avdtp_new(int fd, size_t imtu, size_t omtu, uint16_t version)struct avdtp *session;GIOCondition cond =G_IO_IN |G_IO_ERR |G_IO_HUP |G_IO_NVAL ;int new_fd; +int priority; new_fd =dup (fd);if (new_fd <0 ) {@@ -2064,6 +2065,14 @@ struct avdtp *avdtp_new(int fd, size_t imtu, size_t omtu, uint16_t version)return NULL ; }
Quoted 10 lines
android/avdtp.c struct avdtp *avdtp_new(int fd, size_t imtu, size_t omtu, uint16_t version) · line 2075
Quoted 8 lines
android/avdtp.c +8
-0+ priority =6 ; +if (setsockopt (new_fd,SOL_SOCKET ,SO_PRIORITY , + (const void *) &priority,sizeof (priority)) <0 ) { +error ("setsockopt(SO_PRIORITY): %s (%d)" ,strerror (errno), + errno); +return NULL ; + } +I think we should make it one higher than the media channel. If we are currently using priority 6 on the media channel than this should be 7. If 7 is not possible, then we might degrade the media channel to 5.
Setting anything bigger than 6 requires CAP_NET_ADMIN so it would requires unit tests to run with it, perhaps we can do some logic that checks if we can over 6 or not depending on what capabilities we have.
Signature · 1 line
Luiz Augusto von Dentz