**** BEGIN LOGGING AT Fri Feb 26 02:59:57 2010 Feb 26 03:13:28 zhenhua: Because snprintf returns the number that _would_ be written, not actually written Feb 26 03:13:34 so the return value can be bigger than buffer size Feb 26 03:16:29 On success, returns the number of characters that would have been written had size been sufficiently large, not counting the terminating nul character. Feb 26 03:16:54 Yes, so if you use len = snprintf you can't just use len directly Feb 26 03:17:14 Since you might have had an overflow Feb 26 03:17:28 let me think a little. Feb 26 03:17:34 my CPU is slow Feb 26 03:18:56 zhenhua: The #define changes sound fine Feb 26 03:22:26 denkenz: i still don't under why need sizeof(buf)-1 instead of sizeof(buf). Feb 26 03:22:40 the return val of snprintf doesn't count \0 Feb 26 03:23:24 i have almost updated my patch and will send u soon. Feb 26 03:24:46 s/under/understand Feb 26 03:30:11 for g_at_server_send_result, the buf is 1024 bytes which is enough big i think. Feb 26 03:30:47 why we need MIN(len, sizeof(buf)-1)? i see many other code also use snprintf as well. Feb 26 03:31:14 * zhenhua go for launch Feb 26 05:40:51 denkenz: i wrote a small overflow case and got u now.:-). however, i am not convinced it would happen in g_at_server_send_result Feb 26 06:55:33 maybe, but since you're using snprintf, then be paranoid Feb 26 07:00:57 denkenz: do we still need seperate patch for #define BUF_SIZE 4096? Feb 26 07:03:26 the patch is only move 4096 to #define BUF_SIZE 4096 Feb 26 07:08:15 denkenz: see driver/atmodem/call-barring.c at_call_barring_set(). look like it's possible to overflow. Feb 26 16:32:55 denkenz: finally got a test platform running with that SIM card and the Option GTM378 modem... Feb 26 16:33:39 but it shows up as "/Serial_Number" and only has org.ofono.SimManager exposed as a service Feb 26 16:34:36 so this is a FAIL for me... though prolly still user error Feb 26 16:35:10 I suspect I may need something sane in modem.conf at least (which I have not touched), but not sure what Feb 26 16:35:15 any suggestions? Feb 26 16:40:16 sabotage: Hold on, only SimManager? Feb 26 16:40:29 sabotage: Are you sure you don't have a sim lock turned on? Feb 26 16:42:17 sabotage: And feel free to pastebin the AT trace when you power the modem on Feb 26 16:58:46 sorry, was AFK... Feb 26 16:59:06 lemme re-run ofonod with debug on and paste it Feb 26 16:59:30 and I think you answered my other Q... I need to enable generic at in modem.conf, yes? Feb 26 16:59:57 if it shows up as /serial number it is recognized by udev Feb 26 17:00:07 I don't think you need to mess with modem.conf at all Feb 26 17:01:26 hmm -d option has changed since I las used it Feb 26 17:01:50 what are the options to -d? Feb 26 17:04:09 denkenz: this is all I get... Feb 26 17:04:10 Unable to read IMSI, emergency calls only Feb 26 17:04:23 with -d 1 Feb 26 17:05:36 ok, well be that way ;) Feb 26 17:06:14 ok, so -d 1 is not apparently how to enable debugging Feb 26 17:07:17 it changed, ofonod -n -d '*' Feb 26 17:07:30 I see an example in HACKING for 'plugins/*' Feb 26 17:07:31 You can debug by file now ;) Feb 26 17:07:33 oh, ok Feb 26 17:07:38 will try that Feb 26 17:07:42 nice Feb 26 17:11:54 denkenz: http://pastebin.ca/1812042 Feb 26 17:13:11 Interesting, now export OFONO_AT_DEBUG=1 and rerun with ofonod -n Feb 26 17:14:11 I get no debug other than version and emergency calls only messages Feb 26 17:17:43 denkenz: ^^^ Feb 26 17:18:36 and BTW, I wouldn't know if I have a sim lock turned on or not, since I don't know what it is ;) Feb 26 17:19:41 No, you should be getting an at command trace Feb 26 17:19:56 export OFONO_AT_DEBUG=1; ofonod -n; enable_modem doesn't do it? Feb 26 17:21:36 nope Feb 26 17:22:24 wtf Feb 26 17:23:29 when I run with -nd '*' again, and then run enable-modem, I get an error about it being in progress already Feb 26 17:23:33 dbus.exceptions.DBusException: org.ofono.Error.InProgress: Operation already in progress Feb 26 17:23:57 and I had already noticed that the modem was coming up enabled by default Feb 26 17:24:02 which I thought seemed odd Feb 26 17:24:08 or at least different Feb 26 17:24:32 ok kill ofono and redo it Feb 26 17:27:18 same Feb 26 17:28:38 ok, can you tell what tty the GTM is sitting on? Feb 26 17:28:49 yeah Feb 26 17:28:52 ttyS0 Feb 26 17:28:52 if so, can you open it up with minicom? Feb 26 17:29:07 yeesh... been forever since I used that :P Feb 26 17:29:21 gimme some time to re-learn the basics Feb 26 17:29:48 minicom -s and follow the menus Feb 26 17:30:38 installing ... Feb 26 17:31:01 FWIW, I can see serial#, manufacturer, vendor, etc... info Feb 26 17:31:17 via d-feet or dbus-send Feb 26 17:31:49 Yeah, so you're definitely seeing some AT commands flying Feb 26 17:31:59 Hence my wtf at OFONO_AT_DEBUG not giving anything Feb 26 17:33:05 you did restart ofono after exporting right? Feb 26 17:33:50 yes, several times... Feb 26 17:34:03 oh! *sugar*!!!! Feb 26 17:34:05 UE Feb 26 17:34:22 I'm running sudo... which does not copy env Feb 26 17:34:25 fudge! Feb 26 17:34:32 ok, one sec... ;) Feb 26 17:39:06 ok denkenz, fixed user error, now seeing interesting output ;) Feb 26 17:39:09 http://pastebin.ca/1812082 Feb 26 17:43:10 ok, your GTM is weird, it is responding with error to CIMI Feb 26 17:44:05 Can you try manually in minicom? maybe it is simply a timing issue with the SIM not being ready Feb 26 17:44:30 try AT+CFUN=0, wait 5 secs, AT+CIMI Feb 26 17:44:37 also try AT+CIMI? and AT+CIMI=? Feb 26 17:48:09 back from afk... Feb 26 18:01:48 denkenz: I may just be minicom handicapped, but I can't get the modem into a state were I can enter commands at all Feb 26 18:02:14 likely I need to modify the init string I guess, but no idea what it should be Feb 26 18:02:18 Are you sure you're opening the right port? Feb 26 18:02:34 far as I know Feb 26 18:03:40 double checking Feb 26 18:03:48 So there are 2 ports according to ofono log Feb 26 18:04:01 It seems to follow the standard HSO breakdown Feb 26 18:04:41 Which would mean the ttys are most likely /dev/ttyHS0-4 Feb 26 18:07:00 hmm, ok, somehow I got the idea it was on ttyS0... Feb 26 18:07:02 fixing Feb 26 18:08:27 ugh!, X hung... need to restart Feb 26 18:08:42 lol Feb 26 18:09:05 I suspect it is something simple, like the GTM firmware needing AT+CIMI? instead of AT+CIMI Feb 26 18:09:17 Or maybe it needs to fire off some notification that SIM is ready Feb 26 19:43:14 denkenz: on an unrelated topic... where does the responsibility lay in app,ofono,modem scope for connecting voice call audio stream into OS audio system? Feb 26 19:44:09 IOW, when a call is connected, who owns hooking up the modem audio to the audio stream engine (aka PulseAudio in the Moblin case)? Feb 26 19:50:55 the Dialer Feb 26 19:51:10 o_O Feb 26 19:51:12 sabotage: oFono has no clue whether you want it on the headset / bluetooth, etc Feb 26 19:51:14 how? Feb 26 19:51:21 where do I get the stream from Feb 26 19:51:35 sabotage: In Moblin all of this is taken care (supposedly) by AudioManager / PulseAudio Feb 26 19:51:52 ok, now we get to the meat of the problem ;) Feb 26 19:51:56 and my real question Feb 26 19:52:32 according to the AM docs, the modem driver mus first register with AM, set it's dbus callback methods and perform the PA streem connection Feb 26 19:52:47 all the app does is inform which dest to send it to Feb 26 19:52:55 Yeah the AM guys are smoking stuff Feb 26 19:53:00 set/get gain and mute Feb 26 19:54:24 In the end it is pulse or the app itself that is responsible Feb 26 19:54:28 so aside from any dope I may or may not be smoking... if I *were* to hook up the streams, how? Feb 26 19:54:46 Depends on the situation Feb 26 19:54:53 I see no APIs that expose a way for me to do this Feb 26 19:54:58 e.g. in oFono HFP client case it is BlueZ / Pulse Feb 26 19:55:19 ok, but not my most pressing or relevant case ;) Feb 26 19:55:27 Basically it depends entirely on the hardware setup Feb 26 19:55:42 I need incoming/outgoing call via current active modem Feb 26 19:56:36 Again, AudioManager is supposed to take care of this Feb 26 19:56:50 The problem is they got tainted by the stupidity of the *other* stack Feb 26 19:57:03 * sabotage fears there is a *huge* disconnect between those pushing/coding/requiring the use of AM and the Ofono modem driver developers and or ofono architecture :( Feb 26 19:57:22 Not really, the AM guys just have no idea what they're doing :) Feb 26 19:57:38 AM "does" this, but only in direct coordination with modem driver Feb 26 19:57:44 I looked at their code and shuddered Feb 26 19:57:51 fair enough Feb 26 19:58:10 Seriously, the flow is: Feb 26 19:58:11 * sabotage sends denkenz the SAS which defines what they are supposed to be coding to Feb 26 19:58:52 Dialer tells AM to activate modem path -> AM tells platform driver to activate modem path -> platform driver may or may not call into oFono driver to activate audio path Feb 26 19:59:12 In the case of Intel hardware its all completely external to oFono Feb 26 20:02:20 denkenz: missing from your flow is the initial "am_register_modem_control_cb()" call from ofono (or modem driver I suppose) to AM that tells AM how to signal modem to control it's stream ... Feb 26 20:02:34 again, according to the doc I just sent ;) Feb 26 20:03:36 the rest I all agree with, sorta, if by "path" you mean output destingation device (earpiece speaker, internal speaker, BT headset, wired headset) Feb 26 20:03:59 there's no point to have AM listen to *two* entities Feb 26 20:05:49 am does not listen to ofono in this case... only informed of "who/how" to call when app wants to change output path or props (mute/gain) Feb 26 20:06:24 but that first step must happen, according to their script Feb 26 20:07:24 and anyway, isn't that the point of AM, to listen to "n" entities, and based on rules, adjust output mixing/volume/mute/pause/resume... Feb 26 20:09:50 BTW, I'm not trying to argue the merits or sanity of this... but rather trying to understand, *if* AM were not in the picture, how exactly is a dialer supposed to hook up the modem stream to *any* output? Feb 26 20:10:09 IOW where are the docs on the APIs for this, even if it is per device dependant? Feb 26 20:10:12 The biggest problem is that the audio can be integrated in one of bazilion ways Feb 26 20:10:24 All of the *completely* hardware dependent Feb 26 20:10:40 I (blindly) assumed the whole point of Ofono was to "wrap" that so I don't need per device details Feb 26 20:11:04 so has anyone done this yet with ofono? Feb 26 20:11:05 This is not oFono's job, it is PA's job Feb 26 20:11:26 how is PA made aware of the stream? Feb 26 20:11:48 one way is for the dialer to simply tell PA about it Feb 26 20:11:54 to be fair, I know zero PA yet... Feb 26 20:12:00 tell it what? Feb 26 20:12:10 That a voice call is 'active' Feb 26 20:12:31 and to use whatever the device is for voice stream Feb 26 20:12:39 don't I need to point PA to a stream or FD or ??? Feb 26 20:12:47 Depends on hardware Feb 26 20:12:58 on some hardware you have a single sound card, with no mixing Feb 26 20:13:02 ok, now we're getting someplace... how do I find the voice stream? Feb 26 20:13:08 The sound card has hard-wired paths for audio Feb 26 20:13:19 so mic -> modem, modem -> speaker Feb 26 20:13:25 headset -> modem, modem -> speaker Feb 26 20:13:32 cpu -> speaker, mic -> cpu, etc Feb 26 20:13:56 ok, this is clearly not helping me... I need to read up on PA more I guess Feb 26 20:13:59 On other hardware the modem exposes some stream device with audio data Feb 26 20:14:49 where I'm lost is how does the modem route audio to any device, does it grock PA or is it lower level? Feb 26 20:15:20 Two ways: Feb 26 20:15:33 modem PCM in/out is hardwired to Sound card PCM in/out Feb 26 20:15:45 Modem exposes a character device with audio packets Feb 26 20:15:49 lemme ask another Q then... does ModemManager offer some properties that I can query to find out what it's capable or, or how it handles audio? Feb 26 20:16:00 ModemManager? Feb 26 20:16:14 org.ofono.modem, sorry Feb 26 20:16:29 No, oFono has zero clue about audio, it is for a reason Feb 26 20:16:45 AM/PA is responsible there Feb 26 20:18:06 so despite all the benifits of encasulating the modem implimentation specifics from apps that Ofono is supposed to provide, it doesn't do this for audio, so I still need per-device handler code in my app anyway? Feb 26 20:18:22 I don't see how you draw this conclusion Feb 26 20:18:34 What oFono does for Modems, AudioManager is supposed to do for audio platforms Feb 26 20:19:10 well you're telling me I need to know what the modem is, to know how/where it routes audio, so I can tell PA to make it active or not, and tell AM what output path I want it on... Feb 26 20:19:21 No, *you* don't Feb 26 20:19:40 The AM api should be something like -> RequestPath("VoiceCall", "BT") Feb 26 20:19:40 well according to the spec, it does, but only if the modem driver "cooperates" Feb 26 20:19:50 FAIL Feb 26 20:19:56 this is the disconnect then Feb 26 20:19:59 and there they've no clue Feb 26 20:20:35 * sabotage punts for the weekend and goes home like he was supposed to an hour ago Feb 26 20:20:55 Trust me, there's nothing oFono can do for the audio part Feb 26 20:21:11 I've been down that road before and I've paid my debt to society Feb 26 20:21:17 BTW, not trying to be difficult, justtrying to connect the dots and finding they can't/don't :P Feb 26 20:21:41 They do, just that no one with clue has really been overseeing the AM development Feb 26 20:22:24 The fundamental concept is fine, but their thinking is flawed Feb 26 20:22:26 I suspect I'll be spending the weekend crafting an email point this very fact out to get the ball rolling :( Feb 26 22:57:38 AM api, awesome **** ENDING LOGGING AT Sat Feb 27 02:59:56 2010