RE: [Wengophone-devel] Native Alsa support on Linux

2007-01-26 Thread Didier LINK
Le jeudi 25 janvier 2007 à 23:50 +0100, Jerome WAGNER a écrit :
 Hello,

Hello,

 
 Minh and Julien have integrated your patches in REV 9451.

Thanks for this,

 
 I patched something in 9452 that might correct the rctx == NULL problem.
 (old refactoring that was not ported to the pure alsa backend)

Very good, this particular issue is solved but the alsa portaudio always
segfault like in ticket #1271.

 
 I hope this can help (and I hope it will compile under Linux as I don't have
 one under my hands right now)

It compile and run, that's the first time that I can launch, test the
333, quit the application without a segfault ! Very interesting !

But I've no sound during the test. For the moment I search for a mixer
problem on my computer and without success I will investigate in the
Alsa code of wengophone.

 
 Jerome
 Ps: rev 9452 compiles under windows. If I break anything under linux, I am
 very sorry.

It's ok !!

Cheers.

Didier


___
Wengophone-devel mailing list
Wengophone-devel@lists.openwengo.com
http://dev.openwengo.com/mailman/listinfo/wengophone-devel


Re: [Wengophone-devel] Native Alsa support on Linux

2007-01-25 Thread Vadim Lebedev



Didier LINK wrote:


Le mercredi 24 janvier 2007 à 02:08 +0100, Jerome WAGNER a écrit :
 


Hello,
   



Hello all,

 


Yes I think you are right ; forcing the audio device in your case leads to a
bug.

select_audio_device is supposed override the deviceId when it is forced, but
I guess that the const char * stops this from working.
   



The const is not the main problem here, the pointer is not the same
after the function call and we need to copy the good string with strcpy.

 


Maybe you can try and patch it this way (making sure that when we get out of
select_audio_device, the deviceId has been changed)
   



See attached a little patch to solve this case. It works for me, can you
review it and commit to the svn if it looks good ?

I can begin to go further with the alsa support now ;)

Thanks.

Didier Link

 


Hi Didier,

While your code is correct, i don'r really see what was wrong with 
original code
It was designed in such way as not to modify deviceId string, so it 
should work


Vadim

 




Index: wengophone-2.1/wifo/phapi/phmedia.c
===
--- wengophone-2.1/wifo/phapi/phmedia.c (révision 9392)
+++ wengophone-2.1/wifo/phapi/phmedia.c (copie de travail)
@@ -59,18 +59,23 @@
int ph_msession_start(struct ph_msession_s *s, const char *deviceid)
{
  int ret1,ret2 = -1;
+  char *devName;

+  devName = strdup(deviceid);
+
  DBG_MEDIA_ENGINE(MEDIA_ENGINE: entering ph_msession_start\n);

  g_mutex_lock(s-critsec_mstream_init);

-  ret1 = ph_msession_audio_start(s, deviceid);
+  ret1 = ph_msession_audio_start(s, devName);
#ifdef PHAPI_VIDEO_SUPPORT
  ret2 = ph_msession_video_start(s, deviceid);
#endif

  g_mutex_unlock(s-critsec_mstream_init);

+  free(devName);
+
  if (!ret1  !ret2)
  {
return 0;
Index: wengophone-2.1/wifo/phapi/phmedia-audio.c
===
--- wengophone-2.1/wifo/phapi/phmedia-audio.c   (révision 9392)
+++ wengophone-2.1/wifo/phapi/phmedia-audio.c   (copie de travail)
@@ -2081,7 +2081,17 @@

  if (forcedDeviceId)
  {
-deviceId = forcedDeviceId;
+   // Ensure that the destination buffer has the good size sor strcpy
+   if (strlen(forcedDeviceId)  strlen(deviceId))
+   {
+   if ((realloc(deviceId, 
+   strlen(forcedDeviceId) * sizeof(char))) == NULL)

+   {
+   DBG_DYNA_AUDIO_DRV(error in realloc() ; 
phmedia-audio.c:2085\n);
+   }
+   }
+
+ strcpy(deviceId, forcedDeviceId);
  }

  if (!deviceId || !deviceId[0])
 




___
Wengophone-devel mailing list
Wengophone-devel@lists.openwengo.com
http://dev.openwengo.com/mailman/listinfo/wengophone-devel


___
Wengophone-devel mailing list
Wengophone-devel@lists.openwengo.com
http://dev.openwengo.com/mailman/listinfo/wengophone-devel


RE: [Wengophone-devel] Native Alsa support on Linux

2007-01-25 Thread Jerome WAGNER
Hello,

From Didier's earlier traces, you can see that using alsa: in the
FORCE_xxx env variable was leading to :
- correct activation and usage of the alsa driver functions
- but name containing pa:xxx values

Jérôme

-Message d'origine-
De : Vadim Lebedev [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 25 janvier 2007 10:38
À : Didier LINK
Cc : Jerome WAGNER; 'Wengophone Devel'
Objet : Re: [Wengophone-devel] Native Alsa support on Linux



Didier LINK wrote:

Le mercredi 24 janvier 2007 à 02:08 +0100, Jerome WAGNER a écrit :
  

Hello,



Hello all,

  

Yes I think you are right ; forcing the audio device in your case leads to
a
bug.

select_audio_device is supposed override the deviceId when it is forced,
but
I guess that the const char * stops this from working.



The const is not the main problem here, the pointer is not the same
after the function call and we need to copy the good string with strcpy.

  

Maybe you can try and patch it this way (making sure that when we get out
of
select_audio_device, the deviceId has been changed)



See attached a little patch to solve this case. It works for me, can you
review it and commit to the svn if it looks good ?

I can begin to go further with the alsa support now ;)

Thanks.

Didier Link

  

Hi Didier,

While your code is correct, i don'r really see what was wrong with 
original code
It was designed in such way as not to modify deviceId string, so it 
should work

Vadim

  



Index: wengophone-2.1/wifo/phapi/phmedia.c
===
--- wengophone-2.1/wifo/phapi/phmedia.c (révision 9392)
+++ wengophone-2.1/wifo/phapi/phmedia.c (copie de travail)
@@ -59,18 +59,23 @@
 int ph_msession_start(struct ph_msession_s *s, const char *deviceid)
 {
   int ret1,ret2 = -1;
+  char *devName;
 
+  devName = strdup(deviceid);
+
   DBG_MEDIA_ENGINE(MEDIA_ENGINE: entering ph_msession_start\n);
 
   g_mutex_lock(s-critsec_mstream_init);
 
-  ret1 = ph_msession_audio_start(s, deviceid);
+  ret1 = ph_msession_audio_start(s, devName);
 #ifdef PHAPI_VIDEO_SUPPORT
   ret2 = ph_msession_video_start(s, deviceid);
 #endif
 
   g_mutex_unlock(s-critsec_mstream_init);
 
+  free(devName);
+
   if (!ret1  !ret2)
   {
 return 0;
Index: wengophone-2.1/wifo/phapi/phmedia-audio.c
===
--- wengophone-2.1/wifo/phapi/phmedia-audio.c   (révision 9392)
+++ wengophone-2.1/wifo/phapi/phmedia-audio.c   (copie de travail)
@@ -2081,7 +2081,17 @@
 
   if (forcedDeviceId)
   {
-deviceId = forcedDeviceId;
+   // Ensure that the destination buffer has the good size sor strcpy
+   if (strlen(forcedDeviceId)  strlen(deviceId))
+   {
+   if ((realloc(deviceId, 
+   strlen(forcedDeviceId) * sizeof(char))) == NULL)
+   {
+   DBG_DYNA_AUDIO_DRV(error in realloc() ;
phmedia-audio.c:2085\n);
+   }
+   }
+
+ strcpy(deviceId, forcedDeviceId);
   }
 
   if (!deviceId || !deviceId[0])
  



___
Wengophone-devel mailing list
Wengophone-devel@lists.openwengo.com
http://dev.openwengo.com/mailman/listinfo/wengophone-devel


___
Wengophone-devel mailing list
Wengophone-devel@lists.openwengo.com
http://dev.openwengo.com/mailman/listinfo/wengophone-devel


RE: [Wengophone-devel] Native Alsa support on Linux

2007-01-25 Thread Jerome WAGNER
Hello,

Minh and Julien have integrated your patches in REV 9451.

I patched something in 9452 that might correct the rctx == NULL problem.
(old refactoring that was not ported to the pure alsa backend)

I hope this can help (and I hope it will compile under Linux as I don't have
one under my hands right now)

Jerome
Ps: rev 9452 compiles under windows. If I break anything under linux, I am
very sorry.


-Message d'origine-
De : Didier LINK [mailto:[EMAIL PROTECTED] 
Envoyé : mercredi 24 janvier 2007 21:09
À : Jerome WAGNER
Cc : 'Wengophone Devel'
Objet : RE: [Wengophone-devel] Native Alsa support on Linux



(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi
 /phmedia-alsa.c:316) alsa_stream_open: (name: alsa: in=0 out=0, rate:
16000,
 framesize: 640)
 
 (confirming that the alsa driver is given an alsa name)
 
 After that you should look on line (122) of phmedia-alsa:
   rc = snd_pcm_open(handle, name, type, 0);
 
 It seems to me that using name is a bug here
 And this would be why it tells you
 unable to open  in=0 out=0 pcm device

Thats true, with a little bit of debugging I've found some improvements
to the code (file is attached). Now it parse correctly the in= and out=
options. The syntaxes that work for me are :

*  PH_FORCE_AUDIO_DEVICE=alsa:in=hw:0 out=hw:0
*  PH_FORCE_AUDIO_DEVICE=alsa:in=default out=default

This accept only some specific value. See [1] for some examples, close
to the end of the page (PCM naming conventions).

The device initialization works like a charm. The phlogger debug
informations file is attached.

But, yes sorry ..., the session ending abruptly by a segfault. I've
paste the backtrace in the ticket #1271 [2].

For the moment Alsa is broken by a problem in ph_downsample or
ph_upsample problem. The same rctx param is null and lead to a
segfault.

I hope my try help you and I'm open to all suggestions and test
cases/patches etc etc.

Best regards.

Didier Link


[1] http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html

[2] http://dev.openwengo.com/trac/openwengo/trac.cgi/ticket/1271


___
Wengophone-devel mailing list
Wengophone-devel@lists.openwengo.com
http://dev.openwengo.com/mailman/listinfo/wengophone-devel


RE: [Wengophone-devel] Native Alsa support on Linux

2007-01-24 Thread Didier LINK
Le mercredi 24 janvier 2007 à 02:08 +0100, Jerome WAGNER a écrit :
 Hello,

Hello all,

 
 Yes I think you are right ; forcing the audio device in your case leads to a
 bug.
 
 select_audio_device is supposed override the deviceId when it is forced, but
 I guess that the const char * stops this from working.

The const is not the main problem here, the pointer is not the same
after the function call and we need to copy the good string with strcpy.

 
 Maybe you can try and patch it this way (making sure that when we get out of
 select_audio_device, the deviceId has been changed)

See attached a little patch to solve this case. It works for me, can you
review it and commit to the svn if it looks good ?

I can begin to go further with the alsa support now ;)

Thanks.

Didier Link


Index: wengophone-2.1/wifo/phapi/phmedia.c
===
--- wengophone-2.1/wifo/phapi/phmedia.c (révision 9392)
+++ wengophone-2.1/wifo/phapi/phmedia.c (copie de travail)
@@ -59,18 +59,23 @@
 int ph_msession_start(struct ph_msession_s *s, const char *deviceid)
 {
   int ret1,ret2 = -1;
+  char *devName;
 
+  devName = strdup(deviceid);
+
   DBG_MEDIA_ENGINE(MEDIA_ENGINE: entering ph_msession_start\n);
 
   g_mutex_lock(s-critsec_mstream_init);
 
-  ret1 = ph_msession_audio_start(s, deviceid);
+  ret1 = ph_msession_audio_start(s, devName);
 #ifdef PHAPI_VIDEO_SUPPORT
   ret2 = ph_msession_video_start(s, deviceid);
 #endif
 
   g_mutex_unlock(s-critsec_mstream_init);
 
+  free(devName);
+
   if (!ret1  !ret2)
   {
 return 0;
Index: wengophone-2.1/wifo/phapi/phmedia-audio.c
===
--- wengophone-2.1/wifo/phapi/phmedia-audio.c   (révision 9392)
+++ wengophone-2.1/wifo/phapi/phmedia-audio.c   (copie de travail)
@@ -2081,7 +2081,17 @@
 
   if (forcedDeviceId)
   {
-deviceId = forcedDeviceId;
+   // Ensure that the destination buffer has the good size sor strcpy
+   if (strlen(forcedDeviceId)  strlen(deviceId))
+   {
+   if ((realloc(deviceId, 
+   strlen(forcedDeviceId) * sizeof(char))) == NULL)
+   {
+   DBG_DYNA_AUDIO_DRV(error in realloc() ; phmedia-audio.c:2085\n);
+   }
+   }
+
+ strcpy(deviceId, forcedDeviceId);
   }
 
   if (!deviceId || !deviceId[0])


signature.asc
Description: Ceci est une partie de message	numériquement signée
___
Wengophone-devel mailing list
Wengophone-devel@lists.openwengo.com
http://dev.openwengo.com/mailman/listinfo/wengophone-devel

RE: [Wengophone-devel] Native Alsa support on Linux

2007-01-24 Thread Jerome WAGNER
Hello,

Thank you Didier for this patch. It will be reviewed very soon.

use
http://dev.openwengo.com/trac/openwengo/trac.cgi/ticket/1292
to follow the integration

Thanks
Jerome

-Message d'origine-
De : Didier LINK [mailto:[EMAIL PROTECTED] 
Envoyé : mercredi 24 janvier 2007 16:04
À : Jerome WAGNER
Cc : 'Wengophone Devel'
Objet : RE: [Wengophone-devel] Native Alsa support on Linux

Le mercredi 24 janvier 2007 à 02:08 +0100, Jerome WAGNER a écrit :
 Hello,

Hello all,

 
 Yes I think you are right ; forcing the audio device in your case leads to
a
 bug.
 
 select_audio_device is supposed override the deviceId when it is forced,
but
 I guess that the const char * stops this from working.

The const is not the main problem here, the pointer is not the same
after the function call and we need to copy the good string with strcpy.

 
 Maybe you can try and patch it this way (making sure that when we get out
of
 select_audio_device, the deviceId has been changed)

See attached a little patch to solve this case. It works for me, can you
review it and commit to the svn if it looks good ?

I can begin to go further with the alsa support now ;)

Thanks.

Didier Link



___
Wengophone-devel mailing list
Wengophone-devel@lists.openwengo.com
http://dev.openwengo.com/mailman/listinfo/wengophone-devel


RE: [Wengophone-devel] Native Alsa support on Linux

2007-01-24 Thread Didier LINK

 (DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi
 /phmedia-alsa.c:316) alsa_stream_open: (name: alsa: in=0 out=0, rate: 16000,
 framesize: 640)
 
 (confirming that the alsa driver is given an alsa name)
 
 After that you should look on line (122) of phmedia-alsa:
   rc = snd_pcm_open(handle, name, type, 0);
 
 It seems to me that using name is a bug here
 And this would be why it tells you
 unable to open  in=0 out=0 pcm device

Thats true, with a little bit of debugging I've found some improvements
to the code (file is attached). Now it parse correctly the in= and out=
options. The syntaxes that work for me are :

*  PH_FORCE_AUDIO_DEVICE=alsa:in=hw:0 out=hw:0
*  PH_FORCE_AUDIO_DEVICE=alsa:in=default out=default

This accept only some specific value. See [1] for some examples, close
to the end of the page (PCM naming conventions).

The device initialization works like a charm. The phlogger debug
informations file is attached.

But, yes sorry ..., the session ending abruptly by a segfault. I've
paste the backtrace in the ticket #1271 [2].

For the moment Alsa is broken by a problem in ph_downsample or
ph_upsample problem. The same rctx param is null and lead to a
segfault.

I hope my try help you and I'm open to all suggestions and test
cases/patches etc etc.

Best regards.

Didier Link


[1] http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html

[2] http://dev.openwengo.com/trac/openwengo/trac.cgi/ticket/1271

(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phaudiodriver.c:39) registering audio driver of kind alsa ...
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phaudiodriver.c:58) ...registration ok
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phaudiodriver.c:39) registering audio driver of kind pa ...
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phaudiodriver.c:58) ...registration ok
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phaudiodriver.c:39) registering audio driver of kind null ...
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phaudiodriver.c:58) ...registration ok
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phaudiodriver.c:39) registering audio driver of kind file ...
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phaudiodriver.c:58) ...registration ok
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phmedia-alsa.c:314) alsa_stream_open: (name: alsa:in=hw:0 out=hw:0, rate: 16000, framesize: 640)
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phmedia-alsa.c:94) alsa_dev_open: (name: alsa:in=hw:0 out=hw:0, rate: 16000, framesize: 320)
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phmedia-alsa.c:206) PCM handle name = 'hw:0'
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phmedia-alsa.c:207) PCM state = PREPARED
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phmedia-alsa.c:209) access type = RW_INTERLEAVED
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phmedia-alsa.c:211) format = 'S16_LE' (Signed 16 bit Little Endian)
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phmedia-alsa.c:213) subformat = 'STD' (Standard)
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phmedia-alsa.c:217) channels = 1
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phmedia-alsa.c:219) rate = 16000 bps
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phmedia-alsa.c:221) period time = 2 us
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phmedia-alsa.c:223) period size = 320 frames
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phmedia-alsa.c:225) buffer time = 204 us
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phmedia-alsa.c:227) buffer size = 32640 frames
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phmedia-alsa.c:229) periods per buffer = 102 frames
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phmedia-alsa.c:231) exact rate = 16000/1 bps
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phmedia-alsa.c:233) significant bits = 16
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phmedia-alsa.c:235) tick time = 1000 us
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phmedia-alsa.c:237) is batch = 0
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phmedia-alsa.c:239) is block transfer = 1
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phmedia-alsa.c:241) is 

RE: [Wengophone-devel] Native Alsa support on Linux

2007-01-23 Thread Jerome WAGNER
Hello Didier,

What result did you have for direct ALSA support ?

I added a small wiki page [1] regarding the activation and debug of the ALSA
support. Maybe this will help. Maybe I made a mistake about the in=0 and
out=0 thing. I hope not.

Jerome

[1]
http://dev.openwengo.com/trac/openwengo/trac.cgi/wiki/PhApiAudioDriverAlsa



-Message d'origine-
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] De la part de Didier
LINK
Envoyé : mardi 23 janvier 2007 09:44
À : Wengophone Devel
Objet : [Wengophone-devel] Native Alsa support on Linux

Hi all,

We have discussed during the openwengo summit about the native support
of Alsa by the wengophone. For testing this feature I need some
informations : how to enable direct Alsa using by phapi ? I've found the
PH_FORCE_AUDIO_DEVICE environment variable but no luck in my tests.

For reference, I found this on dmix support [1] related on our
discussion on this subject:

NOTE: For ALSA 1.0.9rc2 and higher you don't need to setup dmix. Dmix
is enabled as default for soundcards which don't support hw mixing.

Thanks for your help and for the nice summit last week !!

Didier Link

[1] http://alsa.opensrc.org/DmixPlugin



___
Wengophone-devel mailing list
Wengophone-devel@lists.openwengo.com
http://dev.openwengo.com/mailman/listinfo/wengophone-devel


RE: [Wengophone-devel] Native Alsa support on Linux

2007-01-23 Thread Didier LINK
Le mardi 23 janvier 2007 à 14:18 +0100, Jerome WAGNER a écrit :
 Hello Didier,

Hi Jerome and all wengonautes,

 
 What result did you have for direct ALSA support ?

Thanks for the wiki page I've tried to use the env variable and the
debug define but without success.

The debug log say that Alsa is loaded :

(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phaudiodriver.c:39)
 registering audio driver of kind alsa ...
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phaudiodriver.c:58)
 ...registration ok
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phaudiodriver.c:39)
 registering audio driver of kind pa ...
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phaudiodriver.c:58)
 ...registration ok
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phaudiodriver.c:39)
 registering audio driver of kind null ...
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phaudiodriver.c:58)
 ...registration ok
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phaudiodriver.c:39)
 registering audio driver of kind file ...
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi/phaudiodriver.c:58)
 ...registration ok

But with 
PH_FORCE_AUDIO_DEVICE=alsa: in=0 out=0 wengophone always use the OSS
driver of portaudio :

(debug) 18:07:01 int main(int, char**): WengoPhone started
(debug) 18:07:01 static std::listAudioDevice,
std::allocatorAudioDevice  AudioDeviceManager::getOutputDeviceList():
output device found=(default) /dev/dsp OSS
(debug) 18:07:01 static std::listAudioDevice,
std::allocatorAudioDevice  AudioDeviceManager::getInputDeviceList():
input device found=(default) /dev/dsp OSS
(debug) 18:07:01 static std::listAudioDevice,
std::allocatorAudioDevice  AudioDeviceManager::getOutputDeviceList():
output device found=(default) /dev/dsp OSS

Maybe there is another place to force the use of direct Alsa driver ?

Thanks for your help.

Didier



signature.asc
Description: Ceci est une partie de message	numériquement signée
___
Wengophone-devel mailing list
Wengophone-devel@lists.openwengo.com
http://dev.openwengo.com/mailman/listinfo/wengophone-devel

RE: [Wengophone-devel] Native Alsa support on Linux

2007-01-23 Thread Jerome WAGNER
Hello,

Yes I think you are right ; forcing the audio device in your case leads to a
bug.

select_audio_device is supposed override the deviceId when it is forced, but
I guess that the const char * stops this from working.

Maybe you can try and patch it this way (making sure that when we get out of
select_audio_device, the deviceId has been changed)

Like you get with your patch you should get something like

(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi
/phmedia-alsa.c:316) alsa_stream_open: (name: alsa: in=0 out=0, rate: 16000,
framesize: 640)

(confirming that the alsa driver is given an alsa name)

After that you should look on line (122) of phmedia-alsa:
  rc = snd_pcm_open(handle, name, type, 0);

It seems to me that using name is a bug here
And this would be why it tells you
unable to open  in=0 out=0 pcm device

The snd_pcm_open (a native alsa primitive if I understand it right) should
be given a device name that is compatible with it.

The principle in phapi is that

alsa:in=0 out=0

Is a shortcut device id string. This string is parsed to get the in= and the
out= values. These values are used as native driver ids.

You can also look at the portaudio impl : phmedia-portaudio.c (192). It has
been coded in yet another way (!)

I hope this will help you in your quest !

Jerome







-Message d'origine-
De : Didier LINK [mailto:[EMAIL PROTECTED] 
Envoyé : mercredi 24 janvier 2007 01:25
À : Jerome WAGNER
Cc : 'Wengophone Devel'
Objet : RE: [Wengophone-devel] Native Alsa support on Linux

Le mardi 23 janvier 2007 à 20:03 +0100, Jerome WAGNER a écrit :
 Hello Didier,
 
 (debug) 18:07:01 static std::listAudioDevice,
 std::allocatorAudioDevice  AudioDeviceManager::getOutputDeviceList():
 output device found=(default) /dev/dsp OSS
 
 Means that the GUI is binded on OSS.

Ok, I see, it's disturbing to initialize all the devices type at once.

 
 Do you have DBG_DYNA_AUDIO_DRV logs when you start a call ? They should
 mention the usage of the ALSA backend because of the FORCE_xxx thing.

The tests with portaudio works with a call, not a very good sound at all
but it work. With the Alsa backend I've no sound and the log is:

(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi
/phaudiodriver.c:39) registering audio driver of kind alsa ...
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi
/phaudiodriver.c:58) ...registration ok
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi
/phaudiodriver.c:39) registering audio driver of kind pa ...
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi
/phaudiodriver.c:58) ...registration ok
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi
/phaudiodriver.c:39) registering audio driver of kind null ...
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi
/phaudiodriver.c:58) ...registration ok
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi
/phaudiodriver.c:39) registering audio driver of kind file ...
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi
/phaudiodriver.c:58) ...registration ok
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi
/phmedia-alsa.c:310) alsa_stream_open: (name: pa:IN=0 OUT=0, rate: 16000,
framesize: 640)
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi
/phmedia-alsa.c:94) alsa_dev_open: (name: pa:IN=0 OUT=0, rate: 16000,
framesize: 320)
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi
/phmedia-alsa.c:132) unable to open pa:IN=0 OUT=0 pcm device: Aucun
fichier ou répertoire de ce type
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi
/phmedia-alsa.c:310) alsa_stream_open: (name: pa:IN=0 OUT=0, rate: 16000,
framesize: 640)
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi
/phmedia-alsa.c:94) alsa_dev_open: (name: pa:IN=0 OUT=0, rate: 16000,
framesize: 320)
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi
/phmedia-alsa.c:132) unable to open pa:IN=0 OUT=0 pcm device: Aucun
fichier ou répertoire de ce type

It's a problem in the name of the device, I've used alsa: in=0 out=0
in the variable PH_FORCE_AUDIO_DEVICE but the result is a mix between
initialization of Alsa with portaudio parameters.

In a gdb session I see that the deviceId is picked from a phcfg
structure:

ph_msession_start(s, phcfg.audio_dev) in wifo/phapi/phapi-old.c:3395

I think in this context of forcing the device driver it's a bug :)

I've tried the attached patch but it's just a step further, the
phlogger.log contain :

(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi
/phmedia-alsa.c:316) alsa_stream_open: (name: alsa: in=0 out=0, rate: 16000,
framesize: 640)
(DBG_DYNA_AUDIO_DRV:/home/didier/temp/openwengo-ng/wengophone-2.1/wifo/phapi
/phmedia-alsa.c