aplay/arecord hang at 44100 Hz
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
At Mon, 10 Feb 2003 10:16:08 +0100,
Quoted 10 lines · Josh Buhl
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
Hi,
Quoted 3 lines
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
At Tue, 11 Feb 2003 17:47:26 +0100,
Quoted 10 lines · Josh Buhl
Hi,
Quoted 3 lines
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
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)
Quoted 31 lines · Takashi Iwai
At Tue, 11 Feb 2003 17:47:26 +0100,
Quoted 8 lines · Josh Buhl
Hi,
Quoted 3 lines
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel
Signature · 29 lines
"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
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
Quoted 21 lines · Takashi Iwai
At Tue, 11 Feb 2003 17:47:26 +0100,
Quoted 8 lines · Josh Buhl
Hi,
Quoted 3 lines
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
Signature · 29 lines
"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
Hi Josh,
the debug trace really helps debugging.
could you try the attached patch?
thanks,
Takashi
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
Quoted 9 lines · Takashi Iwai
Hi Josh,
the debug trace really helps debugging.
could you try the attached patch?thanks,
Takashi
Signature · 29 lines
"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
At Wed, 12 Feb 2003 13:18:20 +0100,
Quoted 7 lines · Josh Buhl
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.
Quoted 2 lines
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