[alsa-devel] Alsa mmap and asynchronous callbacks

Bruce abruceperson at gmail.com
Fri Sep 20 05:03:40 CEST 2013


I tried posting a query related to async callbacks on the alsa-user 
list, and the Hammerfall forum, but noone appeared to know what I was 
talking about. I'm hoping someone here can at least give me some clues.

I wrote an application, based around the alsa example code 
alsa-lib/test/pcm.c using mmap and asynchronous callback notifications. 
This application runs fine with 32 channels in and 2 out on a Hammerfall 
MADI system and under alsa 1.0.15. It now works on 2 different machines 
setup with SUSE 10, then with alsa (and card driver) upgraded to 1.0.15.
alsamixer is used to setup the soundcard in 96kHz mode (double speed).
/Note:/ For some reason (I can't recall) I never managed to get the  
playback async callback to work at the same time as capture callback, so 
I simply called the playback "top-up" routine from the capture async 
routine. That works fine.
The application was used for some years !

SUSE 11 with alsa 1.0.18, same machine, same sound card, application 
hangs after a few callbacks. No more asynchronous callbacks occur after 
approx 1s of playback/record. However, the callbacks are working for a 
short time.
alsamixer looks quite different for the Hammerfall with this newer alsa, 
and it does appear to be the change of alsa driver that causes the problem.

SUSE 11/Ubuntu with alsa 1.0.27. I tried this configuration in order to 
try a different Xonar sound card. The application was modified for only 
2 channels, and interleaved instead of non-interleaved sample format (as 
required by the hardware if not using plughw). Both Xonar and Hammerfall 
hang in the same way.

aplay and alsamixer both work with both soundcards.

The alsa calls I'm using do not appear to be in the deprecated list 
(except  "snd_pcm_sw_params_set_xfer_align" in 1.0.27).

Would you like me to post code fragments ?

/Note: /As a workaround, I attempted to install the working 1.0.15 under 
the later kernal in Suse 11. Unfortunately ./configure fails in 
alsa-driver due to differing kernel hooks. It is not realistic to stay 
with the very old SUSE 10; much of the machine hardware is not recognised.


More information about the Alsa-devel mailing list