Patch

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Patch

Aurélien-6
This patch corrects some printf issues and the initialization of the
CMI-9880.

No sound yet, but no more kernel panic.

Sincerely,


Aurilien.
--- ori_azalia.c Fri Jul 21 22:41:51 2006
+++ azalia.c Tue Sep  5 01:27:44 2006
@@ -1485,7 +1485,6 @@
  return err;
  this->d.audio.bits_rates = result;
  }
- this->d.audio.bits_rates = result;
  } else {
  this->d.audio.encodings =
     codec->w[codec->audiofunc].d.audio.encodings;
@@ -1788,7 +1787,7 @@
 
  if (sts & (HDA_SD_STS_DESE | HDA_SD_STS_FIFOE))
  printf("%s: stream %d: sts=%b\n", XNAME(this->az),
-    this->number, sts, HDA_SD_STS_BITS);
+    this->number, sts);
  if (sts & HDA_SD_STS_BCIS)
  this->intr(this->intr_arg);
  return (1);
@@ -1876,9 +1875,15 @@
  if (smode & AUMODE_RECORD && r != NULL) {
  if (r->encoding == AUDIO_ENCODING_ULAW) { /*XXX*/
  r->encoding = AUDIO_ENCODING_SLINEAR_LE;
- r->precision = 16;
- r->channels = 2;
- r->sample_rate = 44100;
+ if ((codec->nformats > 0) && (codec->formats[i].frequency_type > 0)) {
+ r->precision = codec->formats[0].precision;
+ r->channels = codec->formats[0].channels;
+ r->sample_rate = codec->formats[0].frequency[0];
+ } else {
+ r->precision = 16;
+ r->channels = 2;
+ r->sample_rate = 44100;
+ }
  }
  for (i = 0; i < codec->nformats; i++) {
  if (r->encoding != codec->formats[i].encoding)
@@ -1900,7 +1905,7 @@
  break;
  }
  if (j == codec->formats[i].frequency_type) {
- printf("didn't find Record rate\n",
+ printf("didn't find Record rate %u\n",
     r->sample_rate);
  return (EINVAL);
  }
@@ -1909,9 +1914,15 @@
  if (smode & AUMODE_PLAY && p != NULL) {
  if (p->encoding == AUDIO_ENCODING_ULAW) { /*XXX*/
  p->encoding = AUDIO_ENCODING_SLINEAR_LE;
- p->precision = 16;
- p->channels = 2;
- p->sample_rate = 44100;
+ if ((codec->nformats > 0) && (codec->formats[i].frequency_type > 0)) {
+ p->precision = codec->formats[0].precision;
+ p->channels = codec->formats[0].channels;
+ p->sample_rate = codec->formats[0].frequency[0];
+ } else {
+ p->precision = 16;
+ p->channels = 2;
+ p->sample_rate = 44100;
+ }
  }
  for (i = 0; i < codec->nformats; i++) {
  if (p->encoding != codec->formats[i].encoding)
@@ -1923,8 +1934,8 @@
  break;
  }
  if (i == codec->nformats) {
- printf("can't find playback format\n",
-    r->encoding, r->precision, r->channels);
+ printf("can't find playback format %u/%u/%u\n",
+    p->encoding, p->precision, p->channels);
  return (EINVAL);
  }
  for (j = 0; j < codec->formats[i].frequency_type; j++) {

Reply | Threaded
Open this post in threaded view
|

Re: Patch

Aurélien-6
This part of the diff was a mistake, please forgot it.


> @@ -1788,7 +1787,7 @@
>  
>   if (sts & (HDA_SD_STS_DESE | HDA_SD_STS_FIFOE))
>   printf("%s: stream %d: sts=%b\n", XNAME(this->az),
> -    this->number, sts, HDA_SD_STS_BITS);
> +    this->number, sts);
>   if (sts & HDA_SD_STS_BCIS)
>   this->intr(this->intr_arg);
>   return (1);