Hi,
could it be that there is some power management work in progress? I tried to
compile from the cvs tree, and compilation of pcm_native.c failed to to some
undefined functions/fields for power management.
To get things working for me I added some quick & dirty #ifdef CONFIG_PM
around the affected sections. (in my config CONFIG_PM is of course unset).
Cheers,
Frank.
Index: alsa-driver/kernel/pcm_native.c
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/kernel/pcm_native.c,v
retrieving revision 1.175
diff -u -r1.175 pcm_native.c
--- alsa-driver/kernel/pcm_native.c 2001/10/04 16:49:47 1.175
+++ alsa-driver/kernel/pcm_native.c 2001/10/07 01:31:34
@@ -888,6 +888,7 @@
int res = 0;
snd_pcm_substream_t *s;
snd_card_t *card = substream->pcm->card;
+#ifdef CONFIG_PM
snd_power_lock(card, 1);
while (card->power_state != SNDRV_CTL_POWER_D0) {
if (substream->ffile->f_flags & O_NONBLOCK) {
@@ -896,6 +897,7 @@
}
snd_power_wait(card, 1);
}
+#endif
spin_lock(&pcm_link_lock);
s = substream;
do {
@@ -934,8 +936,10 @@
} while (s != substream);
_end:
spin_unlock(&pcm_link_lock);
+#ifdef CONFIG_PM
_power_unlock:
snd_power_unlock(card);
+#endif
return res;
}
@@ -1053,6 +1057,7 @@
int res = 0;
snd_pcm_substream_t *s;
snd_card_t *card = substream->pcm->card;
+#ifdef CONFIG_PM
snd_power_lock(card, 1);
while (card->power_state != SNDRV_CTL_POWER_D0) {
if (substream->ffile->f_flags & O_NONBLOCK) {
@@ -1061,6 +1066,7 @@
}
snd_power_wait(card, 1);
}
+#endif
spin_lock(&pcm_link_lock);
s = substream;
do {
@@ -1101,8 +1107,10 @@
} while (s != substream);
_end:
spin_unlock(&pcm_link_lock);
+#ifdef CONFIG_PM
_power_unlock:
snd_power_unlock(card);
+#endif
return res;
}
@@ -1139,7 +1147,9 @@
runtime = substream->runtime;
card = substream->pcm->card;
+#ifdef CONFIG_PM
snd_power_lock(card, 1);
+#endif
spin_lock_irq(&runtime->lock);
switch (runtime->status->state) {
case SNDRV_PCM_STATE_PAUSED:
@@ -1149,6 +1159,7 @@
case SNDRV_PCM_STATE_DRAINING:
break;
case SNDRV_PCM_STATE_SUSPENDED:
+#ifdef CONFIG_PM
while (card->power_state != SNDRV_CTL_POWER_D0) {
if (substream->ffile->f_flags & O_NONBLOCK) {
result = -EAGAIN;
@@ -1159,6 +1170,9 @@
spin_lock_irq(&runtime->lock);
}
goto _xrun_recovery;
+#else
+ break;
+#endif
case SNDRV_PCM_STATE_OPEN:
result = -EBADFD;
goto _end;
@@ -1233,7 +1247,9 @@
_end:
spin_unlock_irq(&runtime->lock);
+#ifdef CONFIG_PM
snd_power_unlock(card);
+#endif
return result;
}
@@ -1242,7 +1258,9 @@
snd_pcm_runtime_t *runtime = substream->runtime;
snd_card_t *card = substream->pcm->card;
int res = 0;
+#ifdef CONFIG_PM
snd_power_lock(card, 1);
+#endif
spin_lock_irq(&runtime->lock);
switch (runtime->status->state) {
case SNDRV_PCM_STATE_OPEN:
@@ -1266,6 +1284,7 @@
snd_pcm_change_state(substream, SNDRV_PCM_STATE_SETUP);
break;
case SNDRV_PCM_STATE_SUSPENDED:
+#ifdef CONFIG_PM
while (card->power_state != SNDRV_CTL_POWER_D0) {
if (substream->ffile->f_flags & O_NONBLOCK) {
res = -EAGAIN;
@@ -1276,11 +1295,16 @@
spin_lock_irq(&runtime->lock);
}
goto _xrun_recovery;
+#else
+ break;
+#endif
}
runtime->control->appl_ptr = runtime->status->hw_ptr;
_end:
spin_unlock_irq(&runtime->lock);
+#ifdef CONFIG_PM
snd_power_unlock(card);
+#endif
return res;
}
@@ -1289,7 +1313,9 @@
snd_pcm_runtime_t *runtime = substream->runtime;
snd_card_t *card = substream->pcm->card;
int res = 0;
+#ifdef CONFIG_PM
snd_power_lock(card, 1);
+#endif
spin_lock_irq(&runtime->lock);
switch (runtime->status->state) {
case SNDRV_PCM_STATE_OPEN:
@@ -1319,6 +1345,7 @@
SNDRV_PCM_STATE_DRAINING : SNDRV_PCM_STATE_SETUP);
break;
case SNDRV_PCM_STATE_SUSPENDED:
+#ifdef CONFIG_PM
while (card->power_state != SNDRV_CTL_POWER_D0) {
if (substream->ffile->f_flags & O_NONBLOCK) {
res = -EAGAIN;
@@ -1329,10 +1356,15 @@
spin_lock_irq(&runtime->lock);
}
goto _xrun_recovery;
+#else
+ break;
+#endif
}
_end:
spin_unlock_irq(&runtime->lock);
+#ifdef CONFIG_PM
snd_power_unlock(card);
+#endif
return res;
}
@@ -1341,7 +1373,9 @@
snd_pcm_runtime_t *runtime = substream->runtime;
snd_card_t *card = substream->pcm->card;
int res = 0;
+#ifdef CONFIG_PM
snd_power_lock(card, 1);
+#endif
spin_lock_irq(&runtime->lock);
switch (runtime->status->state) {
case SNDRV_PCM_STATE_OPEN:
@@ -1356,6 +1390,7 @@
snd_pcm_stop(substream, SNDRV_PCM_STATE_SETUP);
break;
case SNDRV_PCM_STATE_SUSPENDED:
+#ifdef CONFIG_PM
while (card->power_state != SNDRV_CTL_POWER_D0) {
if (substream->ffile->f_flags & O_NONBLOCK) {
res = -EAGAIN;
@@ -1366,6 +1401,9 @@
spin_lock_irq(&runtime->lock);
}
/* Fall through */
+#else
+ break;
+#endif
case SNDRV_PCM_STATE_PREPARED:
case SNDRV_PCM_STATE_DRAINING:
case SNDRV_PCM_STATE_XRUN:
@@ -1375,7 +1413,9 @@
runtime->control->appl_ptr = runtime->status->hw_ptr;
_end:
spin_unlock_irq(&runtime->lock);
+#ifdef CONFIG_PM
snd_power_unlock(card);
+#endif
return res;
}
+---- --- -- - - - -
| Frank van de Pol -o) A-L-S-A
| [EMAIL PROTECTED] /\\ Sounds good!
| http://www.alsa-project.org _\_v
Linux - Why use Windows if we have doors available?
_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel