--- alsa-lib-1.0.16/src/pcm/pcm.orig.c	2009-07-07 16:44:53.996882412 +0100
+++ alsa-lib-1.0.16/src/pcm/pcm.c	2009-07-07 16:43:39.107972719 +0100
@@ -4026,6 +4026,38 @@
 }
 
 /**
+ * \brief Set SPDIF data/audio flag
+ * \param pcm PCM handle
+ * \param params Configuration space
+ * \param val 1 = non-audio, 0 = audio (default)
+ * \return 0 otherwise a negative error code
+ */
+int snd_pcm_hw_params_set_nonaudio(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val)
+{
+	assert(pcm && params);
+	if (val)
+		params->flags |= SND_PCM_HW_PARAMS_NON_AUDIO_DATA;
+	else
+		params->flags &= ~SND_PCM_HW_PARAMS_NON_AUDIO_DATA;
+	return snd_pcm_hw_refine(pcm, params);
+}
+
+/**
+ * \brief Extract SPDIF data/audio flag
+ * \param pcm PCM handle
+ * \param params Configuration space
+ * \param val 1 = non-audio, 0 = audio (default)
+ * \return 0 otherwise a negative error code
+ */
+int snd_pcm_hw_params_get_nonaudio(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val)
+{
+	assert(pcm && params && val);
+	*val = params->flags & SND_PCM_HW_PARAMS_NON_AUDIO_DATA ? 1 : 0;
+	return 0;
+}
+
+
+/**
  * \brief Restrict a configuration space to allow the buffer accessible from outside
  * \param pcm PCM handle
  * \param params Configuration space
--- alsa-lib-1.0.16/include/pcm.orig.h	2008-02-05 09:23:44.000000000 +0000
+++ alsa-lib-1.0.16/include/pcm.h	2009-07-07 16:48:46.064092593 +0100
@@ -619,6 +619,8 @@
 int snd_pcm_hw_params_get_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
 int snd_pcm_hw_params_set_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
 int snd_pcm_hw_params_get_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
+int snd_pcm_hw_params_set_nonaudio(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
+int snd_pcm_hw_params_get_nonaudio(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
 
 int snd_pcm_hw_params_get_period_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
 int snd_pcm_hw_params_get_period_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
--- alsa-lib-1.0.16/src/pcm/pcm_local.orig.h	2008-02-05 09:23:45.000000000 +0000
+++ alsa-lib-1.0.16/src/pcm/pcm_local.h	2009-07-07 16:52:51.776054156 +0100
@@ -94,6 +94,7 @@
 
 #define SND_PCM_HW_PARAMS_NORESAMPLE SNDRV_PCM_HW_PARAMS_NORESAMPLE
 #define SND_PCM_HW_PARAMS_EXPORT_BUFFER SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER
+#define SND_PCM_HW_PARAMS_NON_AUDIO_DATA SNDRV_PCM_HW_PARAMS_NON_AUDIO_DATA
 
 typedef struct _snd_pcm_rbptr {
 	snd_pcm_t *master;
