All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Henningsson <david.henningsson@canonical.com>
To: tiwai@suse.de, alsa-devel@alsa-project.org
Cc: David Henningsson <david.henningsson@canonical.com>
Subject: [PATCH (hda-emu)] Adapt to new snd_hda_calc_stream_format
Date: Tue,  1 Jul 2014 07:55:38 +0200	[thread overview]
Message-ID: <1404194138-6899-1-git-send-email-david.henningsson@canonical.com> (raw)

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
---
 configure.ac | 23 +++++++++++++++++++++++
 hda-emu.c    |  6 +++++-
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 31b31cd..fe5c0e2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -488,6 +488,29 @@ if test "$STREAM_FORMAT_WITH_SPDIF" = "1"; then
 fi
 fi
 
+AC_MSG_CHECKING(for snd_hda_calc_stream_format with codec)
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Iinclude"
+STREAM_FORMAT_WITH_CODEC=
+AC_TRY_COMPILE([
+#include "hda-types.h"
+#include "hda-log.h"
+#include <sound/driver.h>
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include "hda/hda_codec.h"
+],[
+  snd_hda_calc_stream_format(0, 0, 0, 0, 0, 0);
+],
+  [AC_MSG_RESULT(yes); STREAM_FORMAT_WITH_CODEC="1"],
+  [AC_MSG_RESULT(no)],
+  [AC_MSG_RESULT(unknown)]
+)
+CFLAGS=$ac_save_CFLAGS
+if test "$STREAM_FORMAT_WITH_CODEC" = "1"; then
+  AC_DEFINE(STREAM_FORMAT_WITH_CODEC)
+fi
+
 HAVE_COMMON_PREPARE=
 AC_MSG_CHECKING(for common snd_hda_codec_prepare/cleanup)
 if grep -q snd_hda_codec_prepare hda/hda_codec.h; then
diff --git a/hda-emu.c b/hda-emu.c
index b564e34..e8309d5 100644
--- a/hda-emu.c
+++ b/hda-emu.c
@@ -798,7 +798,11 @@ void hda_test_pcm(int id, int op, int subid,
 		hda_log(HDA_LOG_INFO, "Prepare PCM, rate=%d, channels=%d, "
 			"format=%d bits\n",
 			rate, channels, format);
-		format_val = snd_hda_calc_stream_format(rate, channels,
+		format_val = snd_hda_calc_stream_format(
+#if defined(STREAM_FORMAT_WITH_CODEC)
+							_codec,
+#endif
+							rate, channels,
 							get_alsa_format(format),
 							format
 #if defined(INDIVIDUAL_SPDIF_CTLS) || defined(STREAM_FORMAT_WITH_SPDIF)
-- 
1.9.1

             reply	other threads:[~2014-07-01  5:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-01  5:55 David Henningsson [this message]
2014-07-01  9:23 ` [PATCH (hda-emu)] Adapt to new snd_hda_calc_stream_format Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1404194138-6899-1-git-send-email-david.henningsson@canonical.com \
    --to=david.henningsson@canonical.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.