linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Linphone-developers] sound card


From: Benjamin
Subject: Re: [Linphone-developers] sound card
Date: Fri, 16 Jun 2006 18:54:53 +0200
User-agent: Thunderbird 1.5.0.4 (X11/20060612)

Hi Edwin,

Edwin Cordeiro wrote:
Hi,

I have a few questions:
1) In which part of the code the sound card is configured or selected? Because linphone can't find a sound card on my ARM Linux system and I was thinking to get and send the audio from/to pipes for comunication with annother program.
Mh, that depends a bit on what version of linphone you're using, specifically if it's mediastreamer/mediastreamer2,
are you talking about OSS or ALSA?

Try out http://download.savannah.nongnu.org/releases/linphone/unstable/source/linphone-1.3.99.5.tar.gz or the latest CVS.

For ALSA, check out <srcdir>/mediastreamer2/alsa.c

....
static void alsa_card_detect(MSSndCardManager *m){
   int i;
   for (i=-1;i<10;i++){
       MSSndCard *card=alsa_card_new(i);
       if (card!=NULL)
           ms_snd_card_manager_add_card(m,card);
       else
           return;
   }
}
....

static MSSndCard * alsa_card_new(int id)
{
   MSSndCard * obj;
   char *name=NULL;
   AlsaData *ad;
   int err;
   if (id!=-1){
       err=snd_card_get_name(id,&name);
       if (err<0) {
           return NULL;
       }
   }
   obj=ms_snd_card_new(&alsa_card_desc);
   ad=(AlsaData*)obj->data;
   if (id==-1) {
       /* the default pcm device */
       obj->name=ms_strdup("default device");
       ad->pcmdev=ms_strdup("default");
       ad->mixdev=ms_strdup("default");
   }else{
       obj->name=ms_strdup(name);
       ad->pcmdev=ms_strdup_printf("plughw:%i,0",id);
       ad->mixdev=ms_strdup_printf("hw:%i",id);
   }
   free(name);
   /*ms_message("alsa device %s found",obj->name);*/
   return obj;
}


maybe add some debug output here.

For OSS, check out oss.c ( surprise ;-) ), but I haven't used oss for a long time, so I don't know how the support
works in linphone.

Have you created all the necessary devicefiles in /dev/... ? In the alsa-driver package, there's a script called "snddevices" for that...

You could run linphone on the console with debugging output:

$>  MEDIASTREAMER_DEBUG=666 linphonec -d 6

Not sure about the pipe stuff, I don't know if linphone reads anything from stdin.

2) What file type of sound is sent and received, for a playback? Is it pcm or .wav or another one?
I don't really understand what you are talking about here... normally you have:

SOUNDCARD -> 16bit linear PCM samples in host endianess at a given sample rate -> some codec like SPEEX, GSM, etc. -> codec specific bitstream in frames -> RTP packet -> network connection

and backwards.

regards,
Benjamin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]