[英]ALSA: Looping Sound Problem
I have written a small program that tests the ALSA library on an Embedded Linux board. 我编写了一个小程序,用于在嵌入式Linux板上测试ALSA库。 The program configures ALSA, plays a single sound and then waits 1 minute before exiting. 程序配置ALSA,播放单个声音,然后在退出前等待1分钟。
Here is what I am observing: after playing the sound, there is silent pause and then the sound is played again. 这就是我所观察到的:播放声音后,会有静音暂停,然后再次播放声音。 I am 100% positive that the program itself is not playing it again. 我100%肯定该程序本身不再播放它。
To further investigate, I did another experiment: With aplay on the same board, I played a different sound. 为了进一步调查,我做了另一个实验:在同一块板上播放,我播放了不同的声音。 This worked fine. 这很好。 Next I executed my hello world program again. 接下来,我再次执行了我的hello world程序。 This time in addition to the periodic sound, I heard remnants other the sound played by aplay. 这次除了周期性的声音,我还听到了其他声音播放的声音。
I suspect that a buffer either in alsa-lib or the sound driver is not getting cleared. 我怀疑alsa-lib或声音驱动程序中的缓冲区没有被清除。 Or that I might have not configured a software parameter correctly. 或者我可能没有正确配置软件参数。 snd_pcm_dump spits out the following information: snd_pcm_dump吐出以下信息:
stream : PLAYBACK
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 1
rate : 8000
exact rate : 8000 (8000/1)
msbits : 16
buffer_size : 32768
period_size : 2048
period_time : 256000
tstamp_mode : NONE
period_step : 1
avail_min : 2048
period_event : 0
start_threshold : 1
stop_threshold : 32768
silence_threshold: 0
silence_size : 0
boundary : 1073741824
I should also mention that I do not see any of this is I run it under Ubuntu. 我还要提一下,我没有看到任何这是我在Ubuntu下运行它。
I had some similar issues not using alsa-lib. 我有一些类似的问题没有使用alsa-lib。 But with alsa i and ubuntu ts self. 但是有了alsa i和ubuntu ts self。 I found painstakingly going through the drivers and testing them to be the best option also using something like speaker-test -c2 -twav to be a big help As for your salsa implementation I don't see anything to look at. 我发现辛苦地经过司机并测试它们是最好的选择,也使用扬声器测试-c2 -twav之类的东西作为一个很大的帮助至于你的莎莎舞实施我看不到任何东西。 But I am afraid without more info I can't be of more assistance. 但我担心没有更多的信息我不能得到更多的帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.