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

Takashi Iwai tiwai at suse.de
Thu Oct 23 17:54:15 CEST 2008


At Thu, 23 Oct 2008 13:45:16 +0100,
Jason Harvey wrote:
> 
> Takashi Iwai wrote:
> >
> > It'd be great if you can capture the whole Oops log.
> > That was entirely missing for all the time.
> >   
> Oops attached.

Thanks.

> Caused when trying to use mplayer to play a wav that aplay played perfectly.
> 
> Happy to try anything to help.

What is the last kernel message from sbxfi driver?
Usually it prints some messages (as debug=1 as default).

> [root at sentry ~]# mplayer wn.wav
> MPlayer dev-SVN-r26936-4.3.0 (C) 2000-2008 MPlayer Team
> CPU: Intel(R) Celeron(R) CPU 2.53GHz (Family: 15, Model: 4, Stepping: 9)
> CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
> Compiled with runtime CPU detection.
> mplayer: could not connect to socket
> mplayer: No such file or directory
> Failed to open LIRC support. You will not be able to use your remote 
> control.
> 
> Playing wn.wav.
> Audio file file format detected.
> ==========================================================================
> Opening audio decoder: [pcm] Uncompressed PCM audio decoder
> AUDIO: 48000 Hz, 2 ch, s16le, 1536.0 kbit/100.00% (ratio: 192000->192000)
> Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
> ==========================================================================
> AO: [pulse] Init failed: Connection refused
> *** PULSEAUDIO: Unable to connect: Connection refused
> *** Is your sound server running?
> *** See: http://www.pulseaudio.org/wiki/Troubleshooting
> [AO_ALSA] Playback open error: Connection refused

Hmm... connection refused?  So it doesn't hang up at this moment yet.

The Oops shows somewhere in the hrtimer handler, so basically it's
irrelevant from sbxfi itself.  A possibility is that the driver made
some memory corruption.  Then it's a bit tough to catch.

Anyway, could you try the patch below?

And, if it's reproducible (just try mplayer first without aplay),
then you can add printk()'s and delays in each PCM callback to see
where this happens, for example.


thanks,

Takashi


diff --git a/sound/pci/sbxfi/sbxfi.c b/sound/pci/sbxfi/sbxfi.c
index dfdb64d..77558d1 100644
--- a/sound/pci/sbxfi/sbxfi.c
+++ b/sound/pci/sbxfi/sbxfi.c
@@ -914,11 +914,13 @@ static int sbxfi_setup_tlb(struct sbxfi *chip, struct sbxfi_port *port,
 	}
 	port->tlb_pages = pages;
 
+	LOG(1, "Allocated TLB at %d for %d pages (%d bytes)\n",
+	    port->tlb_index, port->tlb_pages, bytes);
 	pgtbl = (u32*)chip->tlb.area;
 	pgtbl += port->tlb_index;
 	for (p = 0; p < pages; p++, pgtbl++)
 		*pgtbl = snd_pcm_sgbuf_get_addr(substream, p * SBXFI_PAGE_SIZE);
-
+	LOG(1, "TLB setup done\n");
 	return 0;
 }
 
@@ -1354,16 +1356,11 @@ static int sbxfi_pcm_hw_params(struct snd_pcm_substream *substream,
 	unsigned int bytes = params_buffer_bytes(hw_params);
 	int err;
 
-	err = snd_pcm_lib_malloc_pages(substream, bytes);
-	if (err < 0)
-		return err;
-	if (!err)
-		return 0; /* buffer unchanged */
 	sbxfi_clear_tlb(chip, port);
-	err = sbxfi_setup_tlb(chip, port, bytes);
+	err = snd_pcm_lib_malloc_pages(substream, 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