[alsa-devel] Backported sbxfi driver (UNTESTED!)

Takashi Iwai tiwai at suse.de
Fri Oct 24 10:40:02 CEST 2008


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 <tiwai at suse.de>
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 <tiwai at suse.de>

---
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)


More information about the Alsa-devel mailing list