alsa-lib: hacks for old OE and pandora
authorGrazvydas Ignotas <notasas@gmail.com>
Sun, 14 Sep 2014 19:40:02 +0000 (22:40 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 14 Sep 2014 19:40:02 +0000 (22:40 +0300)
recipes/alsa/alsa-lib/neon_mixer.patch
recipes/alsa/alsa-lib/pandora_hack_params.patch [new file with mode: 0644]
recipes/alsa/alsa-lib_1.0.28.bb

index 79c024e..2201b58 100644 (file)
@@ -1,6 +1,6 @@
-diff -Nur alsa-lib-1.0.20_orig/configure.in alsa-lib-1.0.20/configure.in
---- alsa-lib-1.0.20_orig/configure.in  2009-05-06 10:07:23.000000000 +0300
-+++ alsa-lib-1.0.20/configure.in       2013-06-11 00:15:10.049448655 +0300
+diff -Nur alsa-lib-1.0.20_orig/configure.ac alsa-lib-1.0.20/configure.ac
+--- alsa-lib-1.0.20_orig/configure.ac  2009-05-06 10:07:23.000000000 +0300
++++ alsa-lib-1.0.20/configure.ac       2013-06-11 00:15:10.049448655 +0300
 @@ -43,6 +43,7 @@
  AC_DISABLE_STATIC
  AC_LIBTOOL_DLOPEN
diff --git a/recipes/alsa/alsa-lib/pandora_hack_params.patch b/recipes/alsa/alsa-lib/pandora_hack_params.patch
new file mode 100644 (file)
index 0000000..04f326c
--- /dev/null
@@ -0,0 +1,80 @@
+diff -ur alsa-lib-1.0.28_/src/pcm/pcm_hw.c alsa-lib-1.0.28/src/pcm/pcm_hw.c
+--- alsa-lib-1.0.28_/src/pcm/pcm_hw.c  2014-09-14 21:59:36.900376006 +0300
++++ alsa-lib-1.0.28/src/pcm/pcm_hw.c   2014-09-14 22:01:22.406922865 +0300
+@@ -1285,6 +1285,76 @@
+       }
+ }
++/* pandora hack */
++#include "pcm_generic.h"
++
++/* can't #include "pcm_direct.h" :( */
++#define DIRECT_IPC_SEMS         1
++
++struct snd_pcm_direct {
++      snd_pcm_type_t type;            /* type (dmix, dsnoop, dshare) */
++      key_t ipc_key;                  /* IPC key for semaphore and memory */
++      mode_t ipc_perm;                /* IPC socket permissions */
++      int ipc_gid;                    /* IPC socket gid */
++      int semid;                      /* IPC global semaphore identification */
++      int locked[DIRECT_IPC_SEMS];    /* local lock counter */
++      int shmid;                      /* IPC global shared memory identification */
++      void *shmptr;                   /* pointer to shared memory area */
++      snd_pcm_t *spcm;                /* slave PCM handle */
++      /* ... */
++};
++
++struct snd_pnd_hack_params {
++      unsigned int frames_min;
++      unsigned int frames_max;
++      unsigned int reserved[14];
++};
++
++int snd_pcm_hw_set_hack_params(snd_pcm_t *pcm, unsigned int frames_min, unsigned int frames_max)
++{
++      struct snd_pnd_hack_params pnd_hack_params;
++      snd_pcm_hw_t *hw;
++      int fd;
++      int err;
++
++      if (pcm == NULL)
++              return -EINVAL;
++
++      while (pcm->type != SND_PCM_TYPE_HW) {
++              snd_pcm_generic_t *gen;
++              struct snd_pcm_direct *direct;
++
++              // printf("name: '%s' %d\n", pcm->name, (int)pcm->type);
++              switch (pcm->type) {
++              case SND_PCM_TYPE_PLUG:
++              case SND_PCM_TYPE_SOFTVOL:
++                      gen = pcm->private_data;
++                      pcm = gen->slave;
++                      break;
++              case SND_PCM_TYPE_DMIX:
++                      direct = pcm->private_data;
++                      pcm = direct->spcm;
++                      break;
++              default:
++                      SNDERR("can't handle pcm type %d", (int)pcm->type);
++                      return -EINVAL;
++              }
++      }
++
++      hw = pcm->private_data;
++      fd = hw->fd;
++
++      if (frames_min == 0 || frames_min > frames_max)
++              return -EINVAL;
++
++      memset(&pnd_hack_params, 0, sizeof(pnd_hack_params));
++      pnd_hack_params.frames_min = frames_min;
++      pnd_hack_params.frames_max = frames_max;
++
++      err = ioctl(fd, _IOW('A', 0xfe, struct snd_pnd_hack_params), &pnd_hack_params);
++      return err >= 0 ? err : -errno;
++}
++
+ static const snd_pcm_ops_t snd_pcm_hw_ops = {
+       .close = snd_pcm_hw_close,
+       .info = snd_pcm_hw_info,
index 9a4aab4..becfe74 100644 (file)
@@ -1,8 +1,9 @@
 SUMMARY = "ALSA sound library"
+DESCRIPTION = "ALSA sound library"
 HOMEPAGE = "http://www.alsa-project.org"
 BUGTRACKER = "https://bugtrack.alsa-project.org/alsa-bug/login_page.php"
 SECTION = "libs/multimedia"
-LICENSE = "LGPLv2.1 GPLv2+"
+LICENSE = "LGPLv2.1 GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34 \
                     file://src/socket.c;beginline=1;endline=26;md5=11ff89a8a7a4a690a5c78effe8159545"
 
@@ -15,11 +16,13 @@ BBCLASSEXTEND = "native nativesdk"
 ARM_INSTRUCTION_SET = "arm"
 
 SRC_URI = "ftp://ftp.alsa-project.org/pub/lib/${BP}.tar.bz2 \
-           file://Check-if-wordexp-function-is-supported.patch \
-           file://fix-tstamp-declaration.patch \
-           file://0001-pcm-route-Use-get32-for-multi-source-route-calculati.patch \
-           file://0001-pcm-rate-fix-hw_ptr-exceed-the-boundary.patch \
-           file://0001-pcm-pcm_local.h-include-time.h-to-enable-CLOCK_MONOT.patch \
+           file://Check-if-wordexp-function-is-supported.patch;patch=1 \
+           file://fix-tstamp-declaration.patch;patch=1 \
+           file://0001-pcm-route-Use-get32-for-multi-source-route-calculati.patch;patch=1 \
+           file://0001-pcm-rate-fix-hw_ptr-exceed-the-boundary.patch;patch=1 \
+           file://0001-pcm-pcm_local.h-include-time.h-to-enable-CLOCK_MONOT.patch;patch=1 \
+           file://neon_mixer.patch;patch=1 \
+           file://pandora_hack_params.patch;patch=1 \
 "
 SRC_URI[md5sum] = "c9e21b88a2b3e6e12ea7ba0f3b271fc3"
 SRC_URI[sha256sum] = "3c074b85dde1b30e78ef4995579765833e5b693fbbd8f834c335e080cb734a6d"
@@ -47,7 +50,8 @@ ${datadir}/alsa/pcm/default.conf \
 ${datadir}/alsa/pcm/dmix.conf \
 ${datadir}/alsa/pcm/dsnoop.conf"
 
-RDEPENDS_libasound = "alsa-conf-base alsa-conf"
+#RDEPENDS_libasound = "alsa-conf-base alsa-conf"
+RDEPENDS_libasound = "alsa-conf-base"
 # upgrade path
 RPROVIDES_${PN}-dev = "alsa-dev"
 RREPLACES_${PN}-dev = "alsa-dev"