Re: Virtual sound card

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

 



At Thu, 03 Aug 2006 19:22:57 +0400,
Krivenok Dmitry wrote:
> 
> 
> 
> -----Original Message-----
> From: Takashi Iwai <tiwai@xxxxxxx>
> To: Krivenok Dmitry <_asr_@xxxxxxxx>
> Date: Thu, 03 Aug 2006 16:41:46 +0200
> Subject: Re: Re[8]:  Virtual sound card
> 
> > 
> > At Thu, 03 Aug 2006 18:36:32 +0400,
> > Krivenok Dmitry wrote:
> > > 
> > > > > This is mplayer's log:
> > > > > krivenok-home ~ # strace mplayer Uno_momento.mp3  2>log2
> > > > > krivenok-home ~ # grep  snd log2
> > > > > open("/dev/snd/controlC0", O_RDWR)      = 5
> > > > > open("/dev/snd/pcmC0D0p", O_RDWR|O_NONBLOCK) = 6
> > > > > 
> > > > > OK :)
> > > > > 
> > > > > P.S.
> > > > > Is there a way to use separate files for in/out?
> > > > 
> > > > You can define different PCMs for playback and capture and bind them
> > > > using asym plugin, such as:
> > > > 
> > > > pcm.!hw {
> > > > 	type asym
> > > > 	playback.pcm {
> > > > 		type file
> > > > 		slave.pcm {
> > > > 			type hw
> > > > 			card 0
> > > > 		}
> > > > 		file "foo.out"
> > > > 	}
> > > > 	capture.pcm {
> > > > 		type file
> > > > 		slave.pcm {
> > > > 			type hw
> > > > 			card 0
> > > > 		}
> > > > 		file "foo.in"
> > > > 	}
> > > > }
> > > > 
> > > 
> > > It works with skype and mplayer, but aplay crashs (SegFault):
> > 
> > Ouch.  Could you get a backtrace via gdb?
> > 
> 
> aplay.c:921 snd_pcm_name(handle) == NULL, hence SegFault :(

Yep, try the patch below.


Takashi

diff -r 821d98a655de aplay/aplay.c
--- a/aplay/aplay.c	Thu Jul 27 11:02:00 2006 +0200
+++ b/aplay/aplay.c	Thu Aug 03 17:21:25 2006 +0200
@@ -918,8 +918,9 @@ static void set_params(void)
 	if ((float)rate * 1.05 < hwparams.rate || (float)rate * 0.95 > hwparams.rate) {
 		if (!quiet_mode) {
 			char plugex[64];
+			const char *pcmname = snd_pcm_name(handle);
 			fprintf(stderr, _("Warning: rate is not accurate (requested = %iHz, got = %iHz)\n"), rate, hwparams.rate);
-			if (strchr(snd_pcm_name(handle), ':'))
+			if (! pcmname || strchr(snd_pcm_name(handle), ':'))
 				*plugex = 0;
 			else
 				snprintf(plugex, sizeof(plugex), "(-Dplug:%s)",

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux