Skip to contentSkip to conversation

While writing to speaker sometimes segmentation fault comes.

DISCUSSION ranjith vs 2 participants 4 messages Nov 22, 2013 – Dec 16, 2013 1 message not in the archive

lore
Share & tools
lore

ranjith vs

author
#1 lore raw
In reply to a message not in the archive

Hello,

I am streaming audio from vlc,in the following formats sampling frequency 44100 stereo 16 bit.On the receiver side receiveing pcm frames
and writing to speaker using alsa interface. But sometimes i'm getting segmentation fault in the snd_pcm_writei function. And one more thing is that eventhough I try to set the buffer size to 4096. It is setting it's own value.But i'm writing the buffer of length which I received from pcm_avail_upadte function.

Thanks & Regards,

Ranjith

#2 lore raw
Quoted 1 line · ranjith vs

i'm getting segmentation fault in the snd_pcm_writei function.

Then there's something wrong with the code that calls it.

I'd guess that you computed the frames parameter as bytes.

Quoted 2 lines

And one more thing is that eventhough I try to set the buffer size to 4096. It is setting it's own value.

The buffer size is constrained by the hardware capabilities.

Regards,
Clemens

author
#3 lore raw

Noise is coming from speaker when I do aplay

In reply to ranjith vs

Hello,

While doing arecord and aplay I'm able to hear the sound. But some little bit noise is there. How can I reduce the noise. I'm using in i.mx6 board linux.

Thanks & Regards,

Ranjith

#4 lore raw

Re: Noise is coming from speaker when I do aplay

Quoted 1 line · ranjith vs

While doing arecord and aplay I'm able to hear the sound. But some little bit noise is there. How can I reduce the noise.

That depends on where the noise comes from.

Try disabling playback of any analog inputs.

If that does not help, use a better power supply, or use better-designed hardware.

Regards,
Clemens