* [PATCH (hda-emu)] Adapt to new snd_hda_calc_stream_format
@ 2014-07-01 5:55 David Henningsson
2014-07-01 9:23 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: David Henningsson @ 2014-07-01 5:55 UTC (permalink / raw)
To: tiwai, alsa-devel; +Cc: David Henningsson
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH (hda-emu)] Adapt to new snd_hda_calc_stream_format
2014-07-01 5:55 [PATCH (hda-emu)] Adapt to new snd_hda_calc_stream_format David Henningsson
@ 2014-07-01 9:23 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2014-07-01 9:23 UTC (permalink / raw)
To: David Henningsson; +Cc: alsa-devel
At Tue, 1 Jul 2014 07:55:38 +0200,
David Henningsson wrote:
>
> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Applied, thanks.
Takashi
> ---
> 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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-01 9:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-01 5:55 [PATCH (hda-emu)] Adapt to new snd_hda_calc_stream_format David Henningsson
2014-07-01 9:23 ` Takashi Iwai
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.