* aplay/arecord hang at 44100 Hz @ 2003-02-10 9:16 Josh Buhl 2003-02-11 9:41 ` Takashi Iwai 0 siblings, 1 reply; 9+ messages in thread From: Josh Buhl @ 2003-02-10 9:16 UTC (permalink / raw) To: alsa-devel Hello, When attempting to record at 44100Hz (arecord -f cd), the process hangs at 100% cpu load. It works fine if called at 48000 (arecord -f dat). Similarly, aplay hangs at 100% cpu load when trying to play a wav file recorded at 44100 Hz. If I use sox to resample the wav to 48000 Hz then aplay can play it just fine. Both esdcat and xmms _are_ able to play the same 44100Hz files which cause aplay to hang. I have the alsa modules compiled with ALSA_DEBUG="y" but I don't get any debug info, at least neither in /var/log/syslog nor in /var/log/messages, should I be looking elsewhere? I'm using alsa-0.9rc7 on Debian 3.0r1 running kernel 2.4.20 on an AMD 1800+ Elitegroup K7S5A with SIS 7012 sound on board (intel8x0 driver.) Josh ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: aplay/arecord hang at 44100 Hz 2003-02-10 9:16 aplay/arecord hang at 44100 Hz Josh Buhl @ 2003-02-11 9:41 ` Takashi Iwai 2003-02-11 16:47 ` Josh Buhl 0 siblings, 1 reply; 9+ messages in thread From: Takashi Iwai @ 2003-02-11 9:41 UTC (permalink / raw) To: Josh Buhl; +Cc: alsa-devel At Mon, 10 Feb 2003 10:16:08 +0100, Josh Buhl wrote: > > Hello, > > When attempting to record at 44100Hz (arecord -f cd), the process hangs > at 100% cpu load. It works fine if called at 48000 (arecord -f dat). > > Similarly, aplay hangs at 100% cpu load when trying to play a wav file > recorded at 44100 Hz. If I use sox to resample the wav to 48000 Hz then > aplay can play it just fine. Both esdcat and xmms _are_ able to play > the same 44100Hz files which cause aplay to hang. i guess it's a bug of either alsa-lib or aplay, not of the driver. could you check at which user function the operation stops? thanks, Takashi ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: aplay/arecord hang at 44100 Hz 2003-02-11 9:41 ` Takashi Iwai @ 2003-02-11 16:47 ` Josh Buhl 2003-02-11 17:03 ` Takashi Iwai 0 siblings, 1 reply; 9+ messages in thread From: Josh Buhl @ 2003-02-11 16:47 UTC (permalink / raw) To: alsa-devel Hi, > i guess it's a bug of either alsa-lib or aplay, not of the driver. > could you check at which user function the operation stops? > I'll be happy to provide any debugging info I can, but I'm not exactly sure what you mean by which user function. The error occurs for both user functions aplay and arecord, or do you mean something else? This is how far aplay gets: josh@spleen:/var/tmp$ aplay track_01.wav Playing WAVE 'track_01.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo but no sound, just 100% cpu load. josh@spleen:/var/tmp$ arecord -f cd -d 120 /tmp/blah.wav Recording WAVE '/tmp/blah.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo here arecord does write a header: RIFF$^@^@^@WAVEfmt^P^@^@^@^A^@^B^@D<AC>^@^@^P<B1>^B^@^D^@^P^@data^@^@^@^@ but then jumps to 100% cpu load and doesn't get any further. -josh ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: aplay/arecord hang at 44100 Hz 2003-02-11 16:47 ` Josh Buhl @ 2003-02-11 17:03 ` Takashi Iwai 2003-02-12 9:01 ` Josh Buhl 2003-02-12 9:29 ` Josh Buhl 0 siblings, 2 replies; 9+ messages in thread From: Takashi Iwai @ 2003-02-11 17:03 UTC (permalink / raw) To: Josh Buhl; +Cc: alsa-devel At Tue, 11 Feb 2003 17:47:26 +0100, Josh Buhl wrote: > > Hi, > > > i guess it's a bug of either alsa-lib or aplay, not of the driver. > > could you check at which user function the operation stops? > > > > I'll be happy to provide any debugging info I can, but I'm not exactly > sure what you mean by which user function. The error occurs for both > user functions aplay and arecord, or do you mean something else? please run aplay from gdb and break the operation to see what the program is doing there. or, a traditional debugging via printf() can be enough :) Takashi ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: aplay/arecord hang at 44100 Hz 2003-02-11 17:03 ` Takashi Iwai @ 2003-02-12 9:01 ` Josh Buhl 2003-02-12 9:29 ` Josh Buhl 1 sibling, 0 replies; 9+ messages in thread From: Josh Buhl @ 2003-02-12 9:01 UTC (permalink / raw) To: alsa-devel Here's a backtrace from gdb: (gdb) run Starting program: /home/josh/programs/debian/alsa-utils-0.9.0rc7/aplay/aplay ./track_01.wav [New Thread 16384 (LWP 1875)] Playing WAVE './track_01.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo Program received signal SIGTSTP, Stopped (user). [Switching to Thread 16384 (LWP 1875)] 0x401c7224 in ioctl () from /lib/libc.so.6 (gdb) bt #0 0x401c7224 in ioctl () from /lib/libc.so.6 #1 0x400947a8 in snd_seq_hw_ops () from /usr/lib/libasound.so.2 #2 0x40057912 in snd_pcm_hw_refine () from /usr/lib/libasound.so.2 #3 0x40055918 in snd_pcm_hw_param_set () from /usr/lib/libasound.so.2 #4 0x40056058 in snd_pcm_hw_param_refine_multiple () from /usr/lib/libasound.so.2 #5 0x40063eb7 in _snd_pcm_rate_open () from /usr/lib/libasound.so.2 #6 0x40057698 in snd_pcm_hw_refine_slave () from /usr/lib/libasound.so.2 #7 0x40064625 in _snd_pcm_rate_open () from /usr/lib/libasound.so.2 #8 0x40057912 in snd_pcm_hw_refine () from /usr/lib/libasound.so.2 #9 0x40054723 in snd_pcm_hw_param_set_first () from /usr/lib/libasound.so.2 #10 0x40055d57 in snd_pcm_hw_param_set_near () from /usr/lib/libasound.so.2 #11 0x4004fc4e in snd_pcm_hw_params_set_rate_near () from /usr/lib/libasound.so.2 #12 0x0804cdc7 in set_params () at aplay.c:800 #13 0x0804f1b6 in playback_go (fd=7, loaded=0, count=4294967295, rtype=2, name=0xbffffca0 "./track_01.wav") at aplay.c:1686 #14 0x0804f5d6 in playback (name=0xbffffca0 "./track_01.wav") at aplay.c:1807 #15 0x0804c092 in main (argc=2, argv=0xbffffb54) at aplay.c:514 (gdb) Takashi Iwai wrote: > At Tue, 11 Feb 2003 17:47:26 +0100, > Josh Buhl wrote: > >>Hi, >> >> >>>i guess it's a bug of either alsa-lib or aplay, not of the driver. >>>could you check at which user function the operation stops? >>> >> >>I'll be happy to provide any debugging info I can, but I'm not exactly >>sure what you mean by which user function. The error occurs for both >>user functions aplay and arecord, or do you mean something else? > > > please run aplay from gdb and break the operation to see what the > program is doing there. > > or, a traditional debugging via printf() can be enough :) > > > Takashi > > > ------------------------------------------------------- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! > http://www.vasoftware.com > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/alsa-devel > -- "When you wake up in the morning, Pooh," said Piglet at last, "what's the first thing you say to yourself?" "What's for breakfast?" said Pooh. "What do you say, Piglet?" "I say, 'I wonder what's going to happen exciting today?'" said Piglet. Pooh nodded thoughtfully. "It's the same thing," he said. -- A.A. Milne ----------------------------------------------------- http://www.nyfairuse.org/ WTO + WIPO = DMCA http://www.anti-dmca.org Innovation vs Patent Inflation http://swpat.ffii.org/ 120000 voices and 400 Firms against logic patents http://www.noepatents.org/ ----------------------------------------------------- ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: aplay/arecord hang at 44100 Hz 2003-02-11 17:03 ` Takashi Iwai 2003-02-12 9:01 ` Josh Buhl @ 2003-02-12 9:29 ` Josh Buhl 2003-02-12 11:48 ` Takashi Iwai 1 sibling, 1 reply; 9+ messages in thread From: Josh Buhl @ 2003-02-12 9:29 UTC (permalink / raw) To: alsa-devel Here's a backtrace after I compiled alsa-lib --with-debug=yes: Starting program: /home/josh/programs/debian/alsa-utils-0.9.0rc7/aplay/aplay ./track_01.wav [New Thread 16384 (LWP 18251)] Playing WAVE './track_01.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo Program received signal SIGTSTP, Stopped (user). [Switching to Thread 16384 (LWP 18251)] 0x401d0224 in ioctl () from /lib/libc.so.6 (gdb) bt #0 0x401d0224 in ioctl () from /lib/libc.so.6 #1 0x4009e4cc in __DTOR_END__ () from /usr/lib/libasound.so.2 #2 0x40059cc9 in snd_pcm_hw_refine (pcm=0x8059cc0, params=0xbfffedbc) at pcm_params.c:2165 #3 0x40057aa3 in snd_pcm_hw_param_set (pcm=0x8059cc0, params=0xbfffedbc, mode=SND_TRY, var=SNDRV_PCM_HW_PARAM_RATE, val=621005684, dir=0) at pcm_params.c:692 #4 0x400581ea in snd_pcm_hw_param_refine_multiple (pcm=0x8059cc0, params=0xbfffedbc, var=SNDRV_PCM_HW_PARAM_RATE, src=0xbffff690) at pcm_params.c:948 #5 0x40066d13 in snd_pcm_plug_hw_refine_schange (pcm=0x8059e08, params=0xbffff690, sparams=0xbfffedbc) at pcm_plug.c:655 #6 0x40059a3d in snd_pcm_hw_refine_slave (pcm=0x8059e08, params=0xbffff690, cprepare=0x40066b74 <snd_pcm_plug_hw_refine_cprepare>, cchange=0x400670bc <snd_pcm_plug_hw_refine_cchange>, sprepare=0x40066c10 <snd_pcm_plug_hw_refine_sprepare>, schange=0x40066cc0 <snd_pcm_plug_hw_refine_schange>, srefine=0x400673f4 <snd_pcm_plug_hw_refine_slave>) at pcm_params.c:2057 #7 0x40067468 in snd_pcm_plug_hw_refine (pcm=0x8059e08, params=0xbffff690) at pcm_plug.c:843 #8 0x40059cc9 in snd_pcm_hw_refine (pcm=0x8059e08, params=0xbffff690) at pcm_params.c:2165 #9 0x400567d9 in snd_pcm_hw_param_set_first (pcm=0x8059e08, params=0xbffff690, var=SNDRV_PCM_HW_PARAM_RATE, rval=0x80528c8, dir=0x0) at pcm_params.c:314 #10 0x40057efc in snd_pcm_hw_param_set_near (pcm=0x8059e08, params=0xbffff690, var=SNDRV_PCM_HW_PARAM_RATE, val=0x80528c8, dir=0x0) at pcm_params.c:816 #11 0x400519e5 in __snd_pcm_hw_params_set_rate_near (pcm=0x8059e08, params=0xbffff690, val=0x80528c8, dir=0x0) at pcm.c:3499 #12 0x0804cdc7 in set_params () at aplay.c:800 #13 0x0804f1b6 in playback_go (fd=7, loaded=0, count=4294967295, rtype=2, name=0xbffffca0 "./track_01.wav") at aplay.c:1686 #14 0x0804f5d6 in playback (name=0xbffffca0 "./track_01.wav") at aplay.c:1807 #15 0x0804c092 in main (argc=2, argv=0xbffffb54) at aplay.c:514 Takashi Iwai wrote: > At Tue, 11 Feb 2003 17:47:26 +0100, > Josh Buhl wrote: > >>Hi, >> >> >>>i guess it's a bug of either alsa-lib or aplay, not of the driver. >>>could you check at which user function the operation stops? >>> >> >>I'll be happy to provide any debugging info I can, but I'm not exactly >>sure what you mean by which user function. The error occurs for both >>user functions aplay and arecord, or do you mean something else? > > > please run aplay from gdb and break the operation to see what the > program is doing there. > > or, a traditional debugging via printf() can be enough :) > > > Takashi > -- "When you wake up in the morning, Pooh," said Piglet at last, "what's the first thing you say to yourself?" "What's for breakfast?" said Pooh. "What do you say, Piglet?" "I say, 'I wonder what's going to happen exciting today?'" said Piglet. Pooh nodded thoughtfully. "It's the same thing," he said. -- A.A. Milne ----------------------------------------------------- http://www.nyfairuse.org/ WTO + WIPO = DMCA http://www.anti-dmca.org Innovation vs Patent Inflation http://swpat.ffii.org/ 120000 voices and 400 Firms against logic patents http://www.noepatents.org/ ----------------------------------------------------- ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: aplay/arecord hang at 44100 Hz 2003-02-12 9:29 ` Josh Buhl @ 2003-02-12 11:48 ` Takashi Iwai 2003-02-12 12:18 ` Josh Buhl 0 siblings, 1 reply; 9+ messages in thread From: Takashi Iwai @ 2003-02-12 11:48 UTC (permalink / raw) To: Josh Buhl; +Cc: alsa-devel [-- Attachment #1: Type: text/plain, Size: 103 bytes --] Hi Josh, the debug trace really helps debugging. could you try the attached patch? thanks, Takashi [-- Attachment #2: rate-multi-fix.dif --] [-- Type: application/octet-stream, Size: 1232 bytes --] Index: alsa-lib/src/pcm/pcm_params.c =================================================================== RCS file: /suse/tiwai/cvs/alsa/alsa-lib/src/pcm/pcm_params.c,v retrieving revision 1.31 diff -u -r1.31 pcm_params.c --- alsa-lib/src/pcm/pcm_params.c 12 Feb 2003 11:37:09 -0000 1.31 +++ alsa-lib/src/pcm/pcm_params.c 12 Feb 2003 11:38:01 -0000 @@ -966,14 +966,19 @@ const snd_interval_t *it = hw_param_interval_c(src, var); const snd_interval_t *st = hw_param_interval_c(params, var); if (snd_interval_single(it)) { - unsigned int best = snd_interval_min(it), cur; - for (cur = best; ; cur += best) { + unsigned int best = snd_interval_min(it), cur, prev; + cur = best; + for (;;) { if (st->max < cur || (st->max == cur && st->openmax)) break; - if (it->min > cur || (it->min == cur && st->openmin)) - continue; - if (snd_pcm_hw_param_set(pcm, params, SND_TRY, var, cur, 0) == 0) - return 0; /* ok */ + if (it->min <= cur && ! (it->min == cur && st->openmin)) { + if (! snd_pcm_hw_param_set(pcm, params, SND_TRY, var, cur, 0)) + return; /* ok */ + } + prev = cur; + cur += best; + if (cur <= prev) + break; } } return snd_pcm_hw_param_refine_near(pcm, params, var, src); ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: aplay/arecord hang at 44100 Hz 2003-02-12 11:48 ` Takashi Iwai @ 2003-02-12 12:18 ` Josh Buhl 2003-02-12 12:20 ` Takashi Iwai 0 siblings, 1 reply; 9+ messages in thread From: Josh Buhl @ 2003-02-12 12:18 UTC (permalink / raw) To: alsa-devel; +Cc: Takashi Iwai I had to apply the diff by hand, because patch rejected it: josh@spleen:~/programs/debian/alsa-lib-0.9.0rc7$ patch -p1 < rate-multi-fix.dif patching file src/pcm/pcm_params.c Hunk #1 FAILED at 966. But guess what? Your patch works! aplay and arecord both work perfectly now! That was fast work! -josh Takashi Iwai wrote: > Hi Josh, > > the debug trace really helps debugging. > could you try the attached patch? > > > thanks, > > Takashi -- "When you wake up in the morning, Pooh," said Piglet at last, "what's the first thing you say to yourself?" "What's for breakfast?" said Pooh. "What do you say, Piglet?" "I say, 'I wonder what's going to happen exciting today?'" said Piglet. Pooh nodded thoughtfully. "It's the same thing," he said. -- A.A. Milne ----------------------------------------------------- http://www.nyfairuse.org/ WTO + WIPO = DMCA http://www.anti-dmca.org Innovation vs Patent Inflation http://swpat.ffii.org/ 120000 voices and 400 Firms against logic patents http://www.noepatents.org/ ----------------------------------------------------- ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: aplay/arecord hang at 44100 Hz 2003-02-12 12:18 ` Josh Buhl @ 2003-02-12 12:20 ` Takashi Iwai 0 siblings, 0 replies; 9+ messages in thread From: Takashi Iwai @ 2003-02-12 12:20 UTC (permalink / raw) To: Josh Buhl; +Cc: alsa-devel At Wed, 12 Feb 2003 13:18:20 +0100, Josh Buhl wrote: > > I had to apply the diff by hand, because patch rejected it: > > josh@spleen:~/programs/debian/alsa-lib-0.9.0rc7$ patch -p1 < > rate-multi-fix.dif > patching file src/pcm/pcm_params.c > Hunk #1 FAILED at 966. it's to cvs version. sorry, i should have mentioned that. > > But guess what? Your patch works! aplay and arecord both work perfectly now! glad to hear this. i'll commit the fix to cvs now. thanks, Takashi ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2003-02-12 12:20 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2003-02-10 9:16 aplay/arecord hang at 44100 Hz Josh Buhl 2003-02-11 9:41 ` Takashi Iwai 2003-02-11 16:47 ` Josh Buhl 2003-02-11 17:03 ` Takashi Iwai 2003-02-12 9:01 ` Josh Buhl 2003-02-12 9:29 ` Josh Buhl 2003-02-12 11:48 ` Takashi Iwai 2003-02-12 12:18 ` Josh Buhl 2003-02-12 12:20 ` Takashi Iwai
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.