ALSA: Looping Sound Problem
I have written a small program that tests the ALSA library on an Embedded Linux board. The program configures ALSA, plays a single sound and then waits 1 minute before exiting.
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.
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. 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. Or that I might have not configured a software parameter correctly. snd_pcm_dump spits out the following information:
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.
I had some similar issues not using alsa-lib. But with alsa i and 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. But I am afraid without more info I can't be of more assistance.
精彩评论