From: Takashi Iwai Subject: Re: Backported sbxfi driver, possible fix Date: Tue, 28 Oct 2008 10:31:54 +0100 Message-ID: References: <4900A4FA.7020300@jasonline.co.uk> <4900DBBD.2020806@jasonline.co.uk> <49017FBF.4030005@jasonline.co.uk> <20081025130652.GA27621@rzle423.uni-duisburg.de> <20081025194255.GA27872@rzle423.uni-duisburg.de> <49038448.3090704@jasonline.co.uk> <5501535d0810251457k165cc4ceid2e34930a2bdc8ec@mail.gmail.com> <49061FA4.5010201@superbug.co.uk> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (ns.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id DBC6424133 for ; Tue, 28 Oct 2008 10:31:56 +0100 (CET) In-Reply-To: <49061FA4.5010201@superbug.co.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: James Courtier-Dutton Cc: alsa-devel@alsa-project.org, "Alexander E. Patrakov" List-Id: alsa-devel@alsa-project.org At Mon, 27 Oct 2008 20:08:04 +0000, James Courtier-Dutton wrote: > > Alexander E. Patrakov wrote: > > Takashi Iwai wrote: > > > >> Note: 44.1kHz is possible, but is more complex because it uses a method > >> whereby the channel ring marks each sample in the channel ring as valid > >> or not, so to get 44.1kHz, some samples are simply tagged invalid. The > >> "channel ring" is not the ring buffer that is used to get sound samples > >> to the card. The "channel ring" is used to pass samples between > >> different processing modules on the card. One of these processing > >> modules is the SRC, another is the INs/OUTs, another is the hardware > >> mixer, and yet another is the DSP. > > > > Do I understand correctly that the card internally resamples the sound > > to a different rate using the zero-order-hold method? If so, I'd rather > > not see this feature at all unless the "i_want_horrible_sound" parameter > > is passed, because software can do it better, and some program will > > surely default to using this hardware misfeature. > > > > > Alex, > > I added that comment (takashi cut and pasted my text). No resampling is > done. > Say you have a buffer that is running at 48kHz. > So you have say 480 samples at the 48kHz rate. > But if you want to transfer 44.1kHz rate samples over it, you only want > 441 samples to be there, so what to do with the left over 39 samples. > What the xfi does is next to each sample it adds a "valid" tag. > So, the xfi adds those 39 samples but marks them as "invalid". > The xfi then drops the 39 "invalid" samples, leaving only the 441 > "valid" samples just before sending them at 44.1kHz to the DAC. > Does this explain things a bit better. > FYI, the xfi actually works internally at 384kHz, so it is actually > marking a lot of samples as "invalid". Hm, so what is special about using 44.1kHz if many samples in the audio-ring are already marked as invalid even with 48kHz? It'd be helpful if you could provide a bit more information (or a pseudo-code) for supporting non-48/96kHz samples. thanks, Takashi