Re: Segmentation fault when changing rate converter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At Sun, 7 Oct 2012 15:54:46 +0200,
Sebastian Kemper wrote:
> 
> Hello all,
> 
> I'm running xbmc 11.0 and tell it to use the device alsa:plug:mixman.
> This works fine.
> 
> But when I change the rate_converter in .asoundrc like this:
> 
> defaults.pcm.rate_converter "samplerate"
> 
> then xbmc segfaults:
> 
> X.Org X Server 1.12.2
> Release Date: 2012-05-29
> X Protocol Version 11, Revision 0
> Build Operating System: Linux 3.2.21 x86_64 Gentoo
> Current Operating System: Linux xbmc 3.4.12 #1 SMP Tue Oct 2 21:42:11 CEST 2012 x86_64
> Kernel command line: BOOT_IMAGE=/bzImage root=/dev/sda2 ro
> Build Date: 23 June 2012  10:05:41AM
>  
> Current version of pixman: 0.26.0
> 	Before reporting problems, check http://wiki.x.org
> 	to make sure that you have the latest version.
> Markers: (--) probed, (**) from config file, (==) default setting,
> 	(++) from command line, (!!) notice, (II) informational,
> 	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
> (==) Log file: "/var/log/Xorg.0.log", Time: Sun Oct  7 15:07:19 2012
> (==) Using config file: "/etc/X11/xorg.conf"
> (==) Using system config directory "/usr/share/X11/xorg.conf.d"
> The XKEYBOARD keymap compiler (xkbcomp) reports:
> > Warning:          Type "ONE_LEVEL" has 1 levels, but <RALT> has 2 symbols
> >                   Ignoring extra symbols
> Errors from xkbcomp are not fatal to the X server
> ALSA lib dlmisc.c:236:(snd1_dlobj_cache_get) Cannot open shared library /usr/lib64/alsa-lib/libasound_module_rate_ ��^C.so
> ALSA lib pcm_rate.c:1399:(snd_pcm_rate_open) Cannot find rate converter
> /usr/bin/xbmc: line 137: 28602 Segmentation fault      "$LIBDIR/xbmc/xbmc.bin" $SAVED_ARGS
> which: no lsb_release in (/bin:/usr/bin)
> Crash report available at /home/xbmc/xbmc_crashlog-20121007_150728.log
>  
> Notice the strange characters in the file it tries to open.
> 
> Here's the .asoundrc content:
> 
> defaults.pcm.rate_converter "samplerate"
> 
> pcm.mixman {
>         type dmix
>         ipc_key 1024
>         slave {
>                 pcm "hw:1,3"
>                 format S32_LE
>                 rate 48000
>         }
>         bindings {
>                 0 0
>                 1 1
>         }
> }
> 
> When using aplay -D plug:mixman changing the "rate_converter" as mentioned above works.
> 
> At first I thought that xbmc must be the problem, because there is no
> segmentation fault with aplay.  But the fact that .asoundrc is not read by
> xbmc makes me doubt that.
> 
> I've attached the output of the alsa-info.sh script. The aplay segfaults it
> shows are from playing around with my alsa configuration. I added the following
> to .asoundrc:
> 
> pcm.48khq {
> type plug
> slave {
> pcm "hw:0,0"
> rate 48000
> }
> rate_converter "samplerate_best"
> }
> 
> This is what happened:
> 
> Playing WAVE '09 - tam tam.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
> ALSA lib dlmisc.c:236:(snd1_dlobj_cache_get) Cannot open shared library /usr/lib64/alsa-lib/libasound_module_rate_.so
> ALSA lib pcm_rate.c:1399:(snd_pcm_rate_open) Cannot find rate converter
> Segmentation fault

The rate_converter definition seems dropped by some reason, then it
segfaults at the error path.  Does the patch below fix the segfault?
It won't fix the issue where no proper rate_convert is passed,
though.


Takashi

---
diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c
index a15c3af..4ba8521 100644
--- a/src/pcm/pcm_rate.c
+++ b/src/pcm/pcm_rate.c
@@ -1394,13 +1394,13 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
 		}
 	} else {
 		SNDERR("Invalid type for rate converter");
-		snd_pcm_close(pcm);
+		snd_pcm_free(pcm);
 		free(rate);
 		return -EINVAL;
 	}
 	if (err < 0) {
 		SNDERR("Cannot find rate converter");
-		snd_pcm_close(pcm);
+		snd_pcm_free(pcm);
 		free(rate);
 		return -ENOENT;
 	}
@@ -1409,7 +1409,7 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
 	open_func = SND_PCM_RATE_PLUGIN_ENTRY(linear);
 	err = open_func(SND_PCM_RATE_PLUGIN_VERSION, &rate->obj, &rate->ops);
 	if (err < 0) {
-		snd_pcm_close(pcm);
+		snd_pcm_free(pcm);
 		free(rate);
 		return err;
 	}
@@ -1418,7 +1418,7 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
 	if (! rate->ops.init || ! (rate->ops.convert || rate->ops.convert_s16) ||
 	    ! rate->ops.input_frames || ! rate->ops.output_frames) {
 		SNDERR("Inproper rate plugin %s initialization", type);
-		snd_pcm_close(pcm);
+		snd_pcm_free(pcm);
 		free(rate);
 		return err;
 	}

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user



[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux