Questions tagged [alsa]

ALSA stands for Advanced Linux Sound Architecture and is a kernel component that supports sound in Linux systems.

ALSA stands for Advanced Linux Sound Architecture and is a kernel component that supports sound in Linux systems. In the 2.6 version of the Linux kernel, ALSA replaced OSS (Open Sound System).

According to the project's website, ALSA does the following key features:

  • Efficient support for all types of audio interfaces, from consumer sound cards to professional multichannel audio interfaces.
  • Fully modularized sound drivers.
  • SMP and thread-safe design.
  • User space library (alsa-lib) to simplify application programming and provide higher level functionality.
  • Support for the older Open Sound System (OSS) API, providing binary compatibility for most OSS programs.

Independent ALSA and linux audio support site with info on audio hardware and drivers

1077 questions
8
votes
2 answers

Audio capturing using ALSA library - snd_pcm_open => No such file or directory

I'm trying to implement audio capturing on a SoC using ALSA library. I've a precompiled libasound.so.2.0.0 a asoundlib.h together with other headers. now I have int returnCode; snd_pcm_t *pcm_Handle; char *pcm_device_name = "hw:0,0"; returnCode =…
Micka
  • 19,585
  • 4
  • 56
  • 74
8
votes
2 answers

Linux how to record sound in RAM buffer and playback audio with custom delay

I need to send audio from a radio to a secondary system using an embedded linux system. The secondary system needs to set up a communication channel which takes a few seconds. So if I don't want to lose the beginning of the audio, I need a way to…
leszek.hanusz
  • 5,152
  • 2
  • 38
  • 56
8
votes
1 answer

How to Properly Write Received UDP Audio Data to ALSA with C++ on Raspberry Pi

I have 2 Raspberry Pis and 1 of them transmits UDP frames of Audio data to the other Raspberry Pi. The UDP Packets received are 160 Bytes each. The transmitting Raspberry Pi is sending 8KHz 8-bit Mono samples. The receiving Raspberry Pi uses Qt…
PhilBot
  • 748
  • 18
  • 85
  • 173
8
votes
1 answer

Why is tinyALSA preferred over libasound?

In latest Android releases, the AOSP release typically comes with tinyALSA and tinyCompress. In this question, Simon has mentioned that all Nexus devices shall support tinyALSA. My question is why is android not integrating libasound which has all…
Ganesh
  • 5,880
  • 2
  • 36
  • 54
8
votes
2 answers

Audio not working on Android running on Virtualbox?

I installed Android on Virtualbox, I'm using Android x86 downloaded from http://www.android-x86.org/download I chose version 2.3 the eeepc version (android-x86-2.3-RC1-eeepc.iso). The problem is the sound is not working, I tried all 3 choices in…
Pierre
  • 12,468
  • 6
  • 44
  • 63
8
votes
2 answers

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: printf("%d",snd_pcm_avail (spkhandle)); …
Lunar Mushrooms
  • 8,358
  • 18
  • 66
  • 88
7
votes
4 answers

How to synthesize sounds?

I'd like to produce sounds that would resemble audio from real instruments. The problem is that I have very little clue how to get that. What I know this far from real instruments is that sounds they output are rarely clean. But how to produce such…
Cheery
  • 24,645
  • 16
  • 59
  • 83
7
votes
2 answers

How to mix multiple PCM streams using ALSA

I have two different streams of PCM samples. Is it possible to somehow mix them and play with ALSA on the same output device? I read it may be possible using the mixer but I'm finding it difficult to understand given the lack of documentation. Could…
Luca Carlon
  • 9,546
  • 13
  • 59
  • 91
7
votes
3 answers

Finding all the devices I can use to play PCM with ALSA

I use ALSA to play PCM samples. I open the PCM stream with this function: int snd_pcm_open(snd_pcm_t** pcmp, const char* name, snd_pcm_stream_t stream, int mode); I'm currently using "default" as the name parameter. I would…
Luca Carlon
  • 9,546
  • 13
  • 59
  • 91
7
votes
1 answer

how to install portaudio on pi properly

I am working on a project that involves recording from a mic on a raspberry pi. for now i am getting this error while the program is running. python3: src/hostapi/alsa/pa_linux_alsa.c:3641: PaAlsaStreamComponent_BeginPolling: Assertion `ret ==…
Eshaka
  • 974
  • 1
  • 14
  • 38
7
votes
1 answer

Docker : sharing /dev/snd on multiple containers leads to "device or resource busy"

When adding host device (--device /dev/snd) to a Docker container, I sometimes encounter Device or resource busy errors. Example I have reproduced the issue with a minimal example involving audio (alsa). Here's my Dockerfile (producing an image…
norbjd
  • 10,166
  • 4
  • 45
  • 80
7
votes
1 answer

PyAudio trying to use JACK

I'm running PyAudio under Python 2.6.6 and would like it to use ALSA and not JACK. In [1]: import pyaudio In [2]: pa = pyaudio.pa In [3]: pa.initialize() Cannot connect to server socket err = No such file or directory Cannot connect to server…
Gus
  • 4,375
  • 5
  • 31
  • 50
7
votes
1 answer

Alsa: how to duplicate a stream on 2 outputs and save system configs?

My sound card is Audigy SE [SB0570]. I want to play the same stereo stream not only on speakers but on headphones too, simultaneously. I try this config on my empty ~/.asoundrc pcm.quad { type multi slaves.a.pcm "hw:0,0" #green hole …
Kroll
  • 649
  • 2
  • 6
  • 17
7
votes
1 answer

How to configure different ALSA defaults for capture through one device and playback through another?

I'm looking for some help in configuring the audio on a Raspberry Pi as all my Googling efforts have fallen short so far! My setup: Raspberry PI 3 (running Debian Jessie) USB WebCam (Logitech) which I'm using to capture audio External speaker in…
jgauld
  • 639
  • 5
  • 10
7
votes
2 answers

Multiple files created by arecord

I've made custom distribution using buildroot, with hard-flow for ARMv7 processor. Everything is working except.... # arecord -D hw:0,0 -fdat -d 5 test.wav This makes multiple files. Thousands of them. -rw-r--r-- 1 root root 958508…
selfbg
  • 317
  • 1
  • 4
  • 14