[pulseaudio-commits] [Git][pulseaudio/pulseaudio][bug-template-001] 5 commits: build-sys: meson: Fixes for some ARM compiler checks

Arun Raghavan gitlab at gitlab.freedesktop.org
Tue Aug 27 03:30:38 UTC 2019



Arun Raghavan pushed to branch bug-template-001 at PulseAudio / pulseaudio


Commits:
f515443f by Arun Raghavan at 2019-08-22T13:35:40Z
build-sys: meson: Fixes for some ARM compiler checks

- - - - -
1172daf1 by Arun Raghavan at 2019-08-22T13:35:40Z
build-sys: meson: Process subdirectories before generating configuration

Subdirectories add to the top-level cdata (specifically, the SIMD
detection happens in the pulsecore meson.build), so we were missing
HAVE_MMX/SSE2/NEON defines without this fix.

- - - - -
bdf66c46 by Pali Rohár at 2019-08-27T03:14:27Z
bluetooth: Only perform write-related calculations when we have a sink

This avoids a potential divide-by-zero when we try to decide how much to
write to the sink in the source thread when there is no sink.

Fixes https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/717

- - - - -
b76f6682 by David Emett at 2019-08-27T03:21:27Z
dbus: fix ActiveProfile setting

Just like with handle_set_active_port, we need to look up the profile
corresponding to the provided path rather than doing a name comparison.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/709

- - - - -
b80b19e0 by Russell Treleaven at 2019-08-27T03:30:02Z
gitlab: white space change to Bug.md

Add a second whitespace at the end of the line to force a newline in the
output.

- - - - -


4 changed files:

- .gitlab/issue_templates/Bug.md
- meson.build
- src/modules/bluetooth/module-bluez5-device.c
- src/modules/dbus/iface-card.c


Changes:

=====================================
.gitlab/issue_templates/Bug.md
=====================================
@@ -7,7 +7,7 @@ Missing data may cause bugs to languish.
 ### environment  
 Check to see if you have pa-info installed by running `which pa-info`  
 If yes please run it  
-If no please download and run https://gitlab.freedesktop.org/pulseaudio/pulseaudio/blob/master/src/utils/pa-info 
+If no please download and run https://gitlab.freedesktop.org/pulseaudio/pulseaudio/blob/master/src/utils/pa-info  
 Attach the output to this bug report as pa-info.txt  
 
 ### Steps to reproduce  


=====================================
meson.build
=====================================
@@ -430,19 +430,21 @@ elif host_machine.cpu_family() == 'arm'
   if host_machine.system() == 'linux' and get_option('atomic-arm-linux-helpers')
     cdata.set('ATOMIC_ARM_LINUX_HELPERS', 1)
   else
-    armatomictest = '''void func() {
+    armatomictest = '''int func() {
       volatile int a=0;
       int o=0, n=1, r;
-      asm volatile ("ldrex    %0, [%1]\n"
-      "subs  %0, %0, %2\n"
-      "strexeq %0, %3, [%1]\n"
-      : "=&r" (r)
-      : "r" (&a), "Ir" (o), "r" (n)
+      asm volatile (
+	      "ldrex    %0, [%1]\n"
+	      "subs  %0, %0, %2\n"
+	      "strexeq %0, %3, [%1]\n"
+	      : "=&r" (r)
+	      : "r" (&a), "Ir" (o), "r" (n)
       : "cc");
       return (a==1 ? 0 : -1);
+    }
     '''
 
-    if cc.compiles(aratomictest)
+    if cc.compiles(armatomictest)
       cdata.set('ATOMIC_ARM_INLINE_ASM', 1)
     else
       need_libatomic_ops = true
@@ -470,7 +472,7 @@ endif
 # ARM checks
 # ARMV6 instructions we need
 if host_machine.cpu_family() == 'arm'
-  armv6test = '''void func() {
+  armv6test = '''int func() {
     volatile int a = -60000, b = 0xaaaabbbb, c = 0xccccdddd;
     asm volatile ("ldr r0, %2 \n"
                   "ldr r2, %3 \n"
@@ -483,6 +485,7 @@ if host_machine.cpu_family() == 'arm'
                   : "m" (a), "m" (b), "m" (c)
                   : "r0", "r1", "r2", "r3", "cc");
     return (a == -128 && b == 0xaabbdddd) ? 0 : -1;
+  }
   '''
 
   if cc.compiles(armv6test)
@@ -671,6 +674,17 @@ endif
 
 check_dep = dependency('check', version : '>= 0.9.10', required : get_option('tests'))
 
+# Subdirs
+
+subdir('po')
+if get_option('man')
+  subdir('man')
+endif
+subdir('shell-completion/bash')
+subdir('shell-completion/zsh')
+subdir('src')
+subdir('vala')
+
 # Now generate config.h from everything above
 configure_file(output : 'config.h', configuration : cdata)
 
@@ -738,17 +752,6 @@ configure_file(
   install_dir : cmakedir,
 )
 
-# Subdirs
-
-subdir('po')
-if get_option('man')
-  subdir('man')
-endif
-subdir('shell-completion/bash')
-subdir('shell-completion/zsh')
-subdir('src')
-subdir('vala')
-
 ############################################################
 
 # Final summary


=====================================
src/modules/bluetooth/module-bluez5-device.c
=====================================
@@ -1378,7 +1378,7 @@ static void thread_func(void *userdata) {
             if (have_source) {
 
                 /* We should send two blocks to the device before we expect a response. */
-                if (u->write_index == 0 && u->read_index <= 0)
+                if (have_sink && u->write_index == 0 && u->read_index <= 0)
                     blocks_to_write = 2;
 
                 /* If we got woken up by POLLIN let's do some reading */
@@ -1393,7 +1393,7 @@ static void thread_func(void *userdata) {
                     if (n_read < 0)
                         goto fail;
 
-                    if (n_read > 0) {
+                    if (have_sink && n_read > 0) {
                         /* We just read something, so we are supposed to write something, too */
                         bytes_to_write += n_read;
                         blocks_to_write += bytes_to_write / u->write_block_size;


=====================================
src/modules/dbus/iface-card.c
=====================================
@@ -324,7 +324,9 @@ static void handle_get_active_profile(DBusConnection *conn, DBusMessage *msg, vo
 static void handle_set_active_profile(DBusConnection *conn, DBusMessage *msg, DBusMessageIter *iter, void *userdata) {
     pa_dbusiface_card *c = userdata;
     const char *new_active_path;
-    pa_dbusiface_card_profile *new_active;
+    pa_dbusiface_card_profile *profile;
+    void *state;
+    pa_dbusiface_card_profile *new_active = NULL;
     int r;
 
     pa_assert(conn);
@@ -334,7 +336,14 @@ static void handle_set_active_profile(DBusConnection *conn, DBusMessage *msg, DB
 
     dbus_message_iter_get_basic(iter, &new_active_path);
 
-    if (!(new_active = pa_hashmap_get(c->profiles, new_active_path))) {
+    PA_HASHMAP_FOREACH(profile, c->profiles, state) {
+        if (pa_streq(pa_dbusiface_card_profile_get_path(profile), new_active_path)) {
+            new_active = profile;
+            break;
+        }
+    }
+
+    if (!new_active) {
         pa_dbus_send_error(conn, msg, PA_DBUS_ERROR_NOT_FOUND, "%s: No such profile.", new_active_path);
         return;
     }



View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/compare/5980ace5fc1d6cc927efda8311f42d8c66435328...b80b19e060ffa7e816c72c08af43dccb0fa9ffe5

-- 
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/compare/5980ace5fc1d6cc927efda8311f42d8c66435328...b80b19e060ffa7e816c72c08af43dccb0fa9ffe5
You're receiving this email because of your account on gitlab.freedesktop.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20190827/29d2094d/attachment-0001.html>


More information about the pulseaudio-commits mailing list