Questions tagged [libalsa]

The ALSA (Advanced Linux Sound Architecture) library

The ALSA (Advanced Linux Sound Architecture) library

http://www.alsa-project.org/main/index.php/Main_Page

68 questions
1
vote
1 answer

ALSA midi: getting precise timestamps on input

Bonjour, I'm struggling a little bit with getting as precise as possible timestamps with the ALSA sequencer API. I have a queue used for enabling timestamping of incoming messages, set-up like this: snd_seq_port_info_t*…
Jean-Michaël Celerier
  • 7,412
  • 3
  • 54
  • 75
1
vote
0 answers

PCM channel mapping to physical speakers/mics (ALSA library)

My requirements are: Reading number of channels in playback interface Read number of channels in each capture interface Mapping WAV channels to specific speakers in/outs When it comes to speakers it could posssibly be achieved by inspeciting…
Adam Stepniak
  • 815
  • 6
  • 21
1
vote
0 answers

Registering a Midi Device in Modern Kernel Versions

I am currently writing a Linux Kernel module that will create a virtual Midi device so that a user-space program can send midi signals to any DAW-like software. I found a wonderful function to help me in my task: int register_sound_midi(const struct…
1
vote
1 answer

snd_pcm_hw_params_set_buffer_size() error: "Invalid argument"

Why does the program below issue errors for snd_pcm_hw_params_set_period_size(), snd_pcm_hw_params_set_buffer_size(), and snd_pcm_hw_params_set_rate()? If I raise the value of SAMPLES to 768 it only issues an error to snd_pcm_hw_params_set_rate().…
stare
  • 150
  • 8
1
vote
1 answer

Is there any way to wait for alsa events through epoll mechanism?

I fetch alsa device fd by fd field of struct pollfd structure filled by snd_pcm_poll_descriptors... But when it comes to "demangle" event comming from epoll_wait, snd_pcm_poll_descriptors_revents which is no help since only struct pollfd fits to…
Lewis Anesa
  • 102
  • 3
  • 12
1
vote
0 answers

Function auto mute in alsamixer is used for what?

I'm now writing a program (c and c++) using alsamixer on ubuntu. But I have a problem that sometimes my alsamixer goes back to mute. I think the reason is the function auto mute of alsamixer. But I do not know what function auto mute of alsamixer is…
Thanh Nguyen
  • 45
  • 1
  • 7
1
vote
1 answer

How to change volume of Speaker using Alsa library?

I am controlling volume of Speaker using Alsa amixer library on Linux. The problem I have is that its not controlling volume in a proper scale between [0,100] percentage.This sample code I got from here Set ALSA master volume from C…
raj123
  • 564
  • 2
  • 10
  • 27
1
vote
1 answer

Is there a compilation flag in gcc to overcome the "error: invalid storage class"?

I am doing my own alsa project. Having changed OS (fresh installation / no upgrade) from PRETTY_NAME="Raspbian GNU/Linux 7 (wheezy)" NAME="Raspbian GNU/Linux" VERSION_ID="7" VERSION="7 (wheezy)" ID=raspbian ID_LIKE=debian 4.1.19-v7+ #858 SMP…
Karl
  • 51
  • 1
  • 7
1
vote
1 answer

Scheduled events to ALSA sequencer are not being outputted

In this example code I set up an ALSA client, create a sequencer queue and output port. Then I output a scheduled note on and note off event to this port and wait for a keystroke. At this point I set up midisnoop to read from the port. When…
johnnyO
  • 21
  • 3
1
vote
1 answer

ALSA sequencer queue does not run

My example code uses snd_seq_queue_status_get_tick_time() to check a running queue. But the result is that it always reports a zero tick time. #include #include int queue; snd_seq_t *seq_handle; snd_seq_tick_time_t…
johnnyO
  • 21
  • 3
1
vote
1 answer

Is it possible to get information about a busy Alsa device?

Currently I am attempting to get information about an Alsa device by calling the snd_pcm_open function then passing that to snd_pcm_info to get information about the device. I plan specifically to get the channel information from…
Greenbeard
  • 508
  • 5
  • 14
1
vote
1 answer

redefinition of 'struct timeval' in several headers

I have several issues to compile a C program to stream sound from Intel Edison to devices (iOS and Android). I made a C program : I use alsa/asoundlib.h and pthread.h in my program I don't include sys/time.h because ALSA does not allow this. I use…
maathor
  • 121
  • 1
  • 3
  • 12
1
vote
1 answer

Streaming bytes to ALSA playback device

I'm having a lot of trouble writing random bytes to an ALSA playback device using libasound. Eventually, my goal is to be able to route playback stream over the network and have it played on a remote device. The code presented in this question reads…
Guru Prasad
  • 4,053
  • 2
  • 25
  • 43
1
vote
0 answers

ALSA : How to route different audio streams to different playback hardware devices on a single sound card at the same time?

here I want different audio streams, simultaneously on two hardware playback devices (hw:0,0 and hw:0,1). Currently I am able to listen on them seperately but if I try playing them concurrently sound stops from hw:0,1 and only plays from hw:0,0…
1
vote
1 answer

Alsa snd_pcm_avail always returning a 0

I am trying to read data from my codec. For reasons in my project I would like to do nonblocking, but every time I read the number of bytes available on my codec it says zero. The algorithm is pretty simple: wait 1ms then check to see if there…
user846566
  • 373
  • 1
  • 3
  • 12