From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: Backported sbxfi driver (UNTESTED!) Date: Fri, 24 Oct 2008 10:40:02 +0200 Message-ID: References: <48F739F4.5070303@nostalgicnetworxx.org> <48F74344.4090509@gmail.com> <5501535d0810220824o6b8bf427qd2c806783ec1e56f@mail.gmail.com> <5501535d0810220907p2102afc2t13e47ff5309c01bc@mail.gmail.com> <5501535d0810220924w66341ac6u4d4de4ed87243a7@mail.gmail.com> <48FF7E17.9080601@gmail.com> <5501535d0810230446j52de12aes885d066ea38cb240@mail.gmail.com> <4900659E.90809@jasonline.co.uk> <490071DC.6070607@jasonline.co.uk> <490088DC.7090205@jasonline.co.uk> <49009A26.3000201@jasonline.co.uk> <4900A4FA.7020300@jasonline.co.uk> <4900B523.3020801@jasonline.co.uk> <4900DBBD.2020806@jasonline.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 mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id B196D103859 for ; Fri, 24 Oct 2008 08:40:22 +0200 (CEST) In-Reply-To: <4900DBBD.2020806@jasonline.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: Jason Harvey Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Thu, 23 Oct 2008 21:17:01 +0100, Jason Harvey wrote: > > Takashi Iwai wrote: > > Just to be sure: is it the driver with my patch or without the patch? > > The patch seems broken anyway, so abandon it, and check only without > > the patch from now on. > > > Have reverted to unpatched version, now logging kernel messages to a file. > The attached is the output for debug=2 from running the mplayer with the > oss proc fix. > WARNING... the gzip expands to 4.5MB, which explains the overflow on the > dmesg ring buffer. > But only the first hundred lines and last ten are different, the rest > are all the same as far as I could see. > > The only things I noticed that does change is that the repeated lines > start like this :- > > Oct 23 20:45:28 sentry kernel: SBXFI: IRQ = > 0x500 > Oct 23 20:45:28 sentry kernel: SBXFI: POINTER = > 0x3e0 > Oct 23 20:45:28 sentry kernel: SBXFI: SET TIMER TICKS = > 16 > Oct 23 20:45:28 sentry kernel: SBXFI: POINTER = > 0x3e0 > Oct 23 20:45:28 sentry kernel: SBXFI: POINTER = 0x3e0 > > And that the pattern changes after a short time dropping one of the > POINTER lines. > Screen output below to show commands used. Thanks. I guess the problem was > Oct 23 20:45:28 sentry kernel: SBXFI: Allocate SRC 0 > Oct 23 20:45:28 sentry kernel: SBXFI: allocated TLB at 0 for 16 pages > Oct 23 20:45:28 sentry kernel: SBXFI: Setting TLB buffer page 0x1304a000 > Oct 23 20:45:28 sentry kernel: SBXFI: release TLB at 0 for 16 pages > Oct 23 20:45:28 sentry kernel: SBXFI: Disabling TLB buffer > Oct 23 20:45:28 sentry kernel: SBXFI: PLAYBACK PREPARE: rate=96000, period_size=1024, buffer_size=16384 So the stream is started at the state where the TLB is cleared. The fix patch is below (and I already committed it). Takashi commit 9fc82bbe4ca9142cf2ae5db64eefaabc10e7f071 Author: Takashi Iwai Date: Fri Oct 24 10:35:03 2008 +0200 sbxfi - Fix multiple hw_params calls The last change seems breaking the case of multiple hw_params calls. Although the TLB is cleared unconditionally beforehand, it's not re-asssigned because snd_pcm_lib_malloc_pages() returns 0. Now, call sbxfi_setup_tlb() unconditionally, too. Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/sbxfi/sbxfi.c b/sound/pci/sbxfi/sbxfi.c index 458294f..e268413 100644 --- a/sound/pci/sbxfi/sbxfi.c +++ b/sound/pci/sbxfi/sbxfi.c @@ -1383,12 +1383,7 @@ static int sbxfi_pcm_hw_params(struct snd_pcm_substream *substream, err = snd_pcm_lib_malloc_pages(substream, bytes); if (err < 0) return err; - if (!err) - return 0; /* buffer unchanged */ - err = sbxfi_setup_tlb(chip, port, bytes); - if (err < 0) - return err; - return 1; /* buffer changed */ + return sbxfi_setup_tlb(chip, port, bytes); } static int sbxfi_pcm_hw_free(struct snd_pcm_substream *substream)