From: Takashi Iwai Subject: Re: [ALSA - driver 0001450]: SPDIF out is limited with 48KHz Date: Mon, 17 Oct 2005 12:04:08 +0200 Message-ID: References: <200510112152.18159@goldspace.net> <43507772.3080402@redfish-solutions.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <43507772.3080402@redfish-solutions.com> Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Philip Prindeville Cc: Andrew Gaydenko , alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Fri, 14 Oct 2005 21:28:50 -0600, Philip Prindeville wrote: > > Takashi Iwai wrote: > > >At Tue, 11 Oct 2005 21:52:18 +0400, > >Andrew Gaydenko wrote: > > > > > >>Takashi, > >> > >>Unfortunately, routing problem still exists for (my host)-(bugtrack.alsa-project.org) > >>path. Is it possible to use the mailing list or my direct email (a@gaydenko.com) to > >>send the patch? > >> > >> > > > >BTS host seems instable for the time being. > > > >Anyway, the patch is below, and I already committed it to CVS tree now > >:) > > > > > >Takashi > > > >Index: alsa-kernel/pci/ice1712/ice1724.c > >=================================================================== > >RCS file: /home/iwai/cvs/alsa/alsa-kernel/pci/ice1712/ice1724.c,v > >retrieving revision 1.67 > >diff -u -r1.67 ice1724.c > >--- alsa-kernel/pci/ice1712/ice1724.c 12 Sep 2005 10:27:50 -0000 1.67 > >+++ alsa-kernel/pci/ice1712/ice1724.c 11 Oct 2005 15:18:42 -0000 > >@@ -675,9 +675,12 @@ > > SNDRV_PCM_INFO_MMAP_VALID | > > SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_SYNC_START), > > .formats = SNDRV_PCM_FMTBIT_S32_LE, > >- .rates = SNDRV_PCM_RATE_32000|SNDRV_PCM_RATE_44100|SNDRV_PCM_RATE_48000, > >+ .rates = (SNDRV_PCM_RATE_32000|SNDRV_PCM_RATE_44100| > >+ SNDRV_PCM_RATE_48000|SNDRV_PCM_RATE_88200| > >+ SNDRV_PCM_RATE_96000|SNDRV_PCM_RATE_176400| > >+ SNDRV_PCM_RATE_192000), > > .rate_min = 32000, > >- .rate_max = 48000, > >+ .rate_max = 192000, > > .channels_min = 2, > > .channels_max = 2, > > .buffer_bytes_max = (1UL << 18), /* 16bits dword */ > >@@ -905,6 +908,10 @@ > > case 44100: break; > > case 48000: nval |= 2 << 12; break; > > case 32000: nval |= 3 << 12; break; > >+ case 88200: nval |= 4 << 12; break; > >+ case 96000: nval |= 5 << 12; break; > >+ case 192000: nval |= 6 << 12; break; > >+ case 176400: nval |= 7 << 12; break; > > } > > if (val != nval) > > update_spdif_bits(ice, nval); > >@@ -1292,22 +1299,32 @@ > > > > static unsigned int encode_spdif_bits(snd_aes_iec958_t *diga) > > { > >- unsigned int val; > >+ unsigned int val, rbits; > > > > val = diga->status[0] & 0x03; /* professional, non-audio */ > > if (val & 0x01) { > > /* professional */ > > if ((diga->status[0] & IEC958_AES0_PRO_EMPHASIS) == IEC958_AES0_PRO_EMPHASIS_5015) > > val |= 1U << 3; > >- switch (diga->status[0] & IEC958_AES0_PRO_FS) { > >- case IEC958_AES0_PRO_FS_44100: > >- break; > >- case IEC958_AES0_PRO_FS_32000: > >- val |= 3U << 12; > >- break; > >- default: > >- val |= 2U << 12; > >- break; > >+ rbits = (diga->status[4] >> 3) & 0x0f; > >+ if (rbits) { > >+ switch (rbits) { > >+ case 2: val |= 5 << 12; break; /* 96k */ > >+ case 3: val |= 6 << 12; break; /* 192k */ > >+ case 10: val |= 4 << 12; break; /* 88.2k */ > >+ case 11: val |= 7 << 12; break; /* 176.4k */ > >+ } > >+ } else { > >+ switch (diga->status[0] & IEC958_AES0_PRO_FS) { > >+ case IEC958_AES0_PRO_FS_44100: > >+ break; > >+ case IEC958_AES0_PRO_FS_32000: > >+ val |= 3U << 12; > >+ break; > >+ default: > >+ val |= 2U << 12; > >+ break; > >+ } > > } > > } else { > > /* consumer */ > > > > > > > > I don't suppose the patch is anyway applicable to the DRS capable > VIA southbridges, is it? It's irrelevant. > Also... on a broader note... SPDIF is an asynchronous transport, right? I'm not 100% sure whether the definition is asynchronous, too... > The transmission rate is unrelated to the actual playback rate, since you > can carry compressed PCM, DTS, DolbyD, etc. all over the same > transport... No, the "rate" there is the transport rate. Note that currently ALSA PCM supports only the constant transport rate. Takashi ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl