Community
cancel
Showing results for 
Search instead for 
Did you mean: 
FUliv
Novice
1,456 Views

Audio Streaming

Hi everyone,

I am stuck with a problem trying to play some audio smoothly on an Intel Edison using a TLV320Aic3107 on a custom board.

Using aplay I can play a wav file perfectly fine, after setting up the Codec via I2C. On kernel log I see opening and and closing of a stream.

kernel: snd_intel_sst: runtime_resume called

 

kernel: snd_intel_sst: FW Version 01.09.00.02

 

kernel: snd_intel_sst: Build date Jan 14 2014 Time 20:08:46

 

kernel: snd_intel_sst: Alloc for str 1 pipe 0x90

kernel: snd_intel_sst: Start for str 1 pipe 0x90

kernel: snd_intel_sst: Stop for str 1 pipe 0x90

kernel: snd_intel_sst: Free for str 1 pipe 0x90

kernel: snd_intel_sst: runtime_idle called

kernel: snd_intel_sst: runtime_suspend called

So far so good, but my application includes linphone which uses the library http://www.linphone.org/technical-corner/mediastreamer2/overview Mediastreamer2: media processing and streaming toolkit - open source sip phone to access the audio interface via ALSA.

What happens now is that playback of a wav file using the library methods produces a stutter in sound and observing the kernel log shows repeated opening and closing of a stream.

kernel: snd_intel_sst: runtime_resume called

 

kernel: snd_intel_sst: FW Version 01.09.00.02

 

kernel: snd_intel_sst: Build date Jan 14 2014 Time 20:08:46

 

kernel: snd_intel_sst: Alloc for str 1 pipe 0x90

 

kernel: snd_intel_sst: Start for str 1 pipe 0x90

 

kernel: snd_intel_sst: Stop for str 1 pipe 0x90

 

kernel: snd_intel_sst: Start for str 1 pipe 0x90

 

kernel: snd_intel_sst: Stop for str 1 pipe 0x90

 

kernel: snd_intel_sst: Start for str 1 pipe 0x90

 

kernel: snd_intel_sst: Stop for str 1 pipe 0x90

 

kernel: snd_intel_sst: Start for str 1 pipe 0x90

 

kernel: snd_intel_sst: Stop for str 1 pipe 0x90

 

kernel: snd_intel_sst: Start for str 1 pipe 0x90

 

kernel: snd_intel_sst: Stop for str 1 pipe 0x90

 

kernel: snd_intel_sst: Free for str 1 pipe 0x90

 

kernel: snd_intel_sst: runtime_idle called

 

kernel: snd_intel_sst: runtime_suspend called

 

My demo program is running fine on a connected USB sound card, hence the problem seems to be related to the ALSA driver.

So far I can only guess that the problem is related to ALSA buffer and period sizes - sadly I am not familiar with the internal workings of ALSA. The library tries to achieve a low latency but maybe this conflicts with the Intel Soc dummy audio driver.

What can cause this repeated opening and closing of the stream?

Does someone know what the ideal working value for ALSA period size (snd_pcm_hw_params_set_period_size_near) is?

Many thanks

Florian

 

3 Replies
idata
Community Manager
48 Views

Hi FSchroeder,

 

 

I've never experienced a stutter using ALSA. After doing some research I found out that this problem is sometimes related to the kernel version used. What image version are you using?

 

 

I found a thread with a discussion to a similar issue https://bbs.archlinux.org/viewtopic.php?id=129990 https://bbs.archlinux.org/viewtopic.php?id=129990 .The stutter was caused by a byte being written incorrectly. Take a look at the suggestions posted and let us know your results.

 

 

Sergio

 

FUliv
Novice
48 Views

Hello,

some update and information. First, my edison runs on a custom build image using poky 1.7.3 and the meta-intel-edison layer on master as well as the linphone layer ( git://git.linphone.org/meta-bc) for the mediastreamer library.

The latest commit (http://git.yoctoproject.org/cgit.cgi/meta-intel-edison/commit/?id=6ad94a4c2372bb817822b751f1767ff66b... meta-intel-edison - Layer for the Intel Edison Development Platform) includes kernel 3.10.98. For testing I switched back to 3.10.17 and the described problem does no longer occur. There are still warnings regarding period sizes, but the audio output is Ok and the SST log messages read as expected.

I have still no clue what actually causes this issue with the 3.10.98 kernel. Further, the wip-edison-3.19.5 branch contains a commit commented with "Overhaul sst for edison hardware" and other audio related changes, so spending too much time on 3.10.98 wouldn't be worth it, I guess.

 

 

So, the issue is still open, but for now using 3.10.17 kernel solves my problem.

Best regards

Florian

idata
Community Manager
48 Views

I agree, using 3.10.17 seems to be the easiest solution right now.

 

 

If you're interested to learn why it works on a version but not on another you can check the config files for each kernel and look if there's a change that might cause the stuttering sound. You can find more information here https://github.com/01org/edison-linux/tree/master/arch/x86 https://github.com/01org/edison-linux/tree/master/arch/x86

 

 

Sergio

 

Reply