alsa

How do you do ALSA in Mono?

Does anyone know how to access ALSA (low-level audio API) in Linux using Mono? NOTE: I'm hoping to access ALSA using PInvoke. ...

Finding processes using ALSA sound fast

Currently the way /usr/sbin/alsa in Debian knows the processes using the sound card looks like: echo $( \ lsof +D /dev -F rt \ | awk '/^p/ {pid=$1} /^t/ {type=$1} /^r0x(74|e)..$/ && type == "tCHR" {print pid}' \ | cut -c 2- \ | uniq \ ) Which is rather ugly and depends on lsof. I am looking for a POSIX solution without lsof, perha...

Real Time Audio Analysis In Linux

I'm wondering what is the recommended audio library to use? I'm attempting to make a small program that will aid in tuning instruments. (Piano, Guitar, etc.). I've read about ALSA & Marsyas audio libraries. I'm thinking the idea is to sample data from microphone, do analysis on chunks of 5-10ms (from what I've read). Then perform a FF...

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 unclean sounds? This far I've gotten to do this, it produces quite plain sound from whic...

Using ALSA's function snd_pcm_writei can I free the sample buffer right away?

Using ALSA to play audio, after calling snd__pcm__writei, can I free the sound sample buffer right away or do I need to wait until the sound is finished playing before I can free the sample buffer? For example: unsigned short *buffer; buffer = malloc(size of sample to play); ...load data into buffer... snd_pcm_writei (playback_handle,...

Multiple ALSA sound stream in Embedded Linux ?

Hi Friends, Currently In my embedded linux I can not open multiple ALSA sound stream. What I need is to have different sound playing at a time. Like one application is playing video and other playing some wav file at a same time. Thanks, Sunny. ...

If we could rewrite ALSA from scratch, what would it look like?

Many people agree that ALSA is probably the biggest weakness of the GNU/Linux operating system. ALSA is massive, poorly understood, and badly documented. Some design decisions that it took early on also proved to be fatal. The reason is simple: historically, soundcards didn't behave predictably (in fact, some of them included hardware mi...

ALSA not working when linked through a library

Hi, I'm experiencing a very strange behavior. I'm using alsa 1.0.18 on a powerpc platform. If I run the following simple code from the main of a .c file, it works perfectly, but if I put into a shared .so library (libaudio.so), then I link the main with -laudio -lasound, then the hwparams structure is not filled with anything, while th...

Where can I get these header files?

I'm attempting to compile SndObj, and I need some header files. Which Debian packages do I need to obtain all the missing header files? Checking for C header file alsa/asoundlib.h... (cached) no Checking for C header file soundcard.h... (cached) no Checking for C header file jack/jack.h... (cached) no Checking for C header file m_pd.h.....

ALSA dmix plugin and sample rate problems.

I'm using the ALSA dmix plugin on an embedded project, and mixing mp3 files by playing them with mpg321-alsa. In my asound.conf I've set my dmix sample rate to 44100Hz. If I try to play any mp3 file sampled at a rate other than 44100Hz (or a rate that divides evenly into 44100Hz) then either the audio quality is degraded or even worse t...

Warning/error from ALSA's pcm_min.c example. Possible problem?

Dear developers, When I compile ALSA's pcm_min.c example with gcc -Wall -lasound pcm_min.c -o pcm_min Everything is fine, but running it, I get the white noise as expected, but I also get this warning/error: Short write (expected 16384, wrote 7616) Which comes from the last if-statement. #include <alsa/asoundlib.h> static char *...

Failing Over Between Sound Devices In ALSA

I have a USB headset which I occasionally plug into my laptop. When I do so, I have to put the following in ~/.asoundrc to get it to work: defaults.ctl.card 1 defaults.pcm.card 1 defaults.timer.card 1 This causes a couple of problems. Firstly, any running programs which are using ALSA continue to use the laptop's internal sound card...

I'm looking for a cross-platform Python library that can play MP3 and OGG and support ALSA or similar.

There are several different audio libraries, however, none of them meet my exact needs: - It needs to be cross-platform. - It needs to be able to use the ALSA, PulseAudio or any other common default mixer under Linux. - It needs to be able to autodetect the sample frequency. - It needs to be (fairly) simple in usage, if instead someone c...

How to find out ALSA audio device capabilities programmatically in Linux without opening the device

How do I find out the capabilities of ALSA devices without opening the device first? Problem is, I need to supply the parameters to the snd_pcm_open() function to use the test functions which to me is silly. Why ask whether this is a playback or record device if I have to tell it to the open function first? As an example, I would like ...

simplest way of recording 8 bit signed mono 16khz sound with alsa (in a way it's compatible with pulse)?

I'm totally lost, does anyone have a very simple example of how to record a sound using ALSA with c++? the only thing i need is the raw samples as signed bytes for feeding them to another part of my program. All the examples i found googling seem to have issues with PulseAudio or don't cover what i need. ...

ALSA: How can I find a device in the device list and still I get "No such file or directory" when opening it?

It seems I don't understand the ALSA architecture, even after reading most of the documentation on offer: I list all the available ALSA devices using snd_device_name_hint() and snd_device_name_get_hint(). This lists, among others "pulse" under hwdep class so it looks like PulseAudio is available in my system. But when I try to open it w...

Why are many of the Linux ALSA PCI struct and functions prefixed with azx?

I am digging deep into the ALSA HDA codec HDA source code to resolve an issue and would like to know why so many of the structures and functions are prefixed with azx. Can anybody point me any websites/docs? I would also be interested into any sites that give some background information on codecs, CORB/RIRB and BDL etc ...

How to use ALSA's snd_pcm_writei() ?

Hi everybody, Can someone explain how snd_pcm_writei snd_pcm_sframes_t snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size) works? I have used it like so: for (int i = 0; i < 1; i++) { f = snd_pcm_writei(handle, buffer, frames); ... } Full source code at http://pastebi...

how to provide alsa support to a game developed in allegro ?

i have developed a 2-dgame in allegro but there is no background music as the ALSA is not being detected . install_sound(ALSA_AUTODETECT,DIGI_AUTODETECT,MIDI_AUTODETECT,NULL); I have included this line in my graphics.h but to no avail . ...

Linux, C++ audio capturing (just microphone) library

I'm developing a musical game, it's like a singstar but instead of singing, you have to play the recorder. It's called oFlute, and it's still in early development stage. In the game, I capture the microphone input, then run a simple FFT analysis and compare the results to typical recorder's frequencies, thus getting the played note. A...