I’m new to sound programming and ALSA. I’d like to create a little application, that for example prints out to the console when a frame of data is written to ALSA with snd_pcm_writei(…). Is that possible and if so, how? Currently I’m thinking of registering a callback to ALSA so when a…
Tag: alsa
Controlling Jabra 710 USB speaker volume from linux host
I am using Linux (2.6.39 kernel) and trying to find a way that would allow me to send volume increment/decrement commands from my host Linux OS to the Jabra device. I saw this functionality is possible both in Windows and Ubuntu, where controlling of the volume from the PC alters the Jabra volume. I am able t…
How to properly set up ALSA device
Edit: This question is different than the proposed duplicate because I’m asking How do you set the period/buffer size that will work with multiple targets each with different sound hardware?. I have created some code that attempts to set up ALSA before playback of an OGG file. The code below works on on…
Audio Channel change/swap automatically
I am working with digital TV in Linux platform. Currently I am facing with one issue in audio. When I give stereo audio to Function and after long time running the audio channels get swapped. That is, right channel audio hearing in Left channel and Left in Right. I dumped the PCM data in to a file before givi…
Setting channel volume in ALSA
My app plays raw PCM audio data through various channels using ALSA. I’m allocating a new audio channel by using snd_pcm_open(), then setting the PCM format via the snd_pcm_hw_params_xxx() calls and finally feeding raw PCM audio data to ALSA by using the snd_pcm_writei() API. This is all working fine so…
ALSA vs PulseAudio – Latency Concerns
Good day, I have been debating some details with a colleague about ALSA vs PulseAudio, and need some help coming to a conclusion with it. It’s to my understanding that ALSA is relatively low-level, and talks directly to the hardware, while PulseAudio sits on top of ALSA as a service. Additionally, it…
ALSA: Ways to prevent underrun for speaker
I am playing a single channel audio in non-interleaved mode. I am getting underrun when I am writing audio data into speaker : ALSA lib pcm.c:7339:(snd_pcm_recover) underrun occurred Here is how I write: What are the different ways/parameter configurations to prevent ALSA under run ? (I am using Linux 3.0, AR…