[pjsip] ALSA audio sharing
damir.arbula at gmail.com
Sat Apr 10 05:26:31 CDT 2010
Problem solved or at least avoided :)
Little change in asound.conf file and audio sharing is working perfect! In
dmix0 slave and dsnoop0 slave these parameters are added:
If period_size is not equal 320 conference.c line 1792 breaks the program,
and if buffer size is not multiple of 320 then function
snd_pcm_hw_params_set_period_size_near changes period size and program
breaks with same error.
From: Damir Arbula [mailto:damir.arbula at gmail.com]
Sent: Saturday, April 10, 2010 12:35 AM
To: 'pjsip at lists.pjsip.org'
Subject: ALSA audio sharing
Little update on the problem: it seems that reason for auddemo working with
virtual alsa devices and pjsua not working lies in pjsua's use of conference
bridge. If pjsua use real device hw:0,0 there is no problem but also no
sharing possibility. If it uses virtual device then function
snd_pcm_hw_params_set_period_size_near in alsa_dev.c (line 562, 678) changes
the period size parameter from 320 to 2000 which (presumably) somehow result
in conflict in conference bridge (line 1792).
I did not have enough time and more important skill (not a programmer) to
look into this problem but my long shot attempt would be to say that if alsa
virtual devices are going to be used in pjsip then something in conference
bridge has to be adjusted?
Date: Thu, 8 Apr 2010 15:14:29 +0200
From: "Damir Arbula" <damir.arbula at gmail.com>
To: <pjsip at lists.pjsip.org>
is there a way to get the trunk version with native ALSA support to work in
audio device sharing mode (defined in asound.conf). Auddemo is working,
record and play are working with audio device being busy in other process
but when I try pjsua it breaks after I try to make a call on line 1792,
get frame: Assertion 'frame->size == conf->samples_per_frame *
conf->bits_per_sample / 8' failed
P.S. Below are the alsa_dev.c change and asound.conf
/*#define ALSA_DEVICE_NAME "plughw:%d,%d"*/
#define ALSA_DEVICE_NAME "pasym0"
More information about the pjsip