**** BEGIN LOGGING AT Mon May 26 03:00:00 2014 May 26 04:19:19 Abhishek_: it is a long wknd for the US May 26 04:20:35 every weekend should be 3 days May 26 04:33:30 I see May 26 04:34:33 But no weekend is long enough ;) May 26 04:50:21 av500: May 26 04:50:23 ping May 26 04:52:25 I have difficulty finding the control endpoint of my usb device. May 26 04:52:37 Anyone any thoughts? May 26 04:55:20 praveendath92: libusb_control_transfer? May 26 04:55:39 Abhishek_: No libusb. May 26 04:56:12 Ideally a piece of code that can do what libusb_control_transfer does. May 26 04:56:53 Is it for the kernel module? May 26 04:57:27 Yeah. May 26 04:59:39 Abhishek_: From line 41 here, https://github.com/praveendath92/bard-linux/blob/master/adk-driver.c May 26 05:00:06 I'm not able to find a control endpoint. Nor is it listed in libusb -v May 26 05:18:57 This happens after you switch the device to adk mode? May 26 09:07:11 vvu: ping May 26 09:09:28 panto : ping! May 26 09:29:13 praveendath92: pong May 26 09:34:30 karki, pong May 26 09:39:09 * vvu likes how we are playing ping pong over here :) May 26 09:41:57 panto : I'm reading up on sysfs. I wrote a sample driver yesterday that supported read, write, open and close. used "register_chrdev" and "mknod". That works for char drivers, but I'm wondering how to get a /dev entry for a platform drivers! (I haven't read platform drivers completely, so I could be missing out on an obvious way) May 26 09:42:48 ls /sys/devices/platform/ May 26 09:43:08 you don't need a /dev/ entry May 26 09:44:47 how do I support mmap? can I mmap a sysfs entry? May 26 09:45:21 panto : currently I have seen only show and store .... May 26 09:46:39 anyway I'll check it out and get back to you in a while. May 26 10:05:58 praveendath92 : vvu had ponged you while you were away. May 26 10:06:19 here May 26 10:07:16 Hey panto May 26 10:07:23 hey May 26 10:11:15 * Abhishek_ hopes that panto did find time to review the code May 26 10:15:00 took a look May 26 10:15:04 seems fine May 26 10:15:26 hope you now are aware about what the performance limits are in modern systems May 26 10:15:41 it's not CPU processing, it's data movement and I/O May 26 10:16:20 so you can stream data fast enough in DRAM, but then you can't really move them around easily, or process them May 26 10:16:30 the UIO buffers are uncached too May 26 10:17:10 So is that the reason for memcpy being slow? May 26 10:17:13 mranostay mentioned that 25MHz is probably the fastest sampling rate you can do with the bone without some kind of special buffering May 26 10:17:27 you're running out of memory bandwidth May 26 10:17:45 when you have gobs of data, you better try not to move them around May 26 10:17:54 Yep, saw that. I could add a LLT buffer if necessary. May 26 10:18:10 Hardware is not an issue for me May 26 10:18:43 performance of uncached memory is unsurprisingly bad for the main CPU May 26 10:19:04 Can you suggest some head start for a 'zero copy' approach? May 26 10:20:12 that's the scatter gather user-space access method we discussed May 26 10:20:15 remember, the one with the many steps May 26 10:24:19 panto: So how could I get into that? I think the first step would be to get a physical handle to a malloced buffer that I could give to the PRUs, right? May 26 10:25:08 that's the problem May 26 10:25:17 it's not a simple pointer May 26 10:25:52 each malloced area in user-space is an array of scatter gather entries May 26 10:26:07 and then you'll have to perform manual cache management May 26 10:26:23 So how to get the underlying scatter-gather entries? May 26 10:29:38 panto: Could you suggest something to start with in this case? Some application where I can see it action? May 26 10:30:15 that's what virtio does basically May 26 10:30:21 look at that May 26 10:38:20 k, would it be worth to take the implementation to kernel space? May 26 10:44:21 vvu: karki: Sorry. I missed. May 26 10:44:34 vvu: Are you still around? May 26 11:03:40 vvu : when are your exams ending? May 26 11:05:43 panto : I can mmap a sysfs entry using bin_attribute s May 26 11:08:39 yes May 26 11:08:46 panto : I'll be working full time on this today and tomorrow. I hope you are free day after for some discussions on the different components of the probe function in your rproc driver. [I want to accomplish this much by end of wednesday] May 26 11:09:01 probably May 26 11:09:08 no guarantees, I'm pretty busy myself May 26 11:09:21 ping me and if I'm around I'll answer May 26 11:09:49 I know. It's okay. I'll try to figure you as much as I can, so that I don't waste much of your time ;) May 26 11:09:55 :) May 26 11:37:04 karki: 2morrow May 26 11:40:11 :) May 26 11:40:28 the last day is always the most frustrating ;) May 26 11:41:36 vvu : which subject? May 26 11:47:41 vvu: ping again. May 26 11:47:53 Network issue. May 26 11:51:43 panto: Will I have to go into the kernel to get the scatter/gather lists, or can it be done from userspace? May 26 11:53:02 kernel only May 26 11:58:27 panto: Does that mean your remoteproc driver, or I can write a workaround (maybe an extra function) in the UIO to get me the scatter/gather lists for a large buffer? May 26 12:07:52 vvu: Can you check this lsusb log once you are back? https://gist.github.com/praveendath92/7d123d1f15733b23fb37 May 26 12:16:17 karki: today distributed systems and tomorrow operating systems May 26 12:16:41 praveendath92: will look 2morrow, a bit busy. need to hack on my n7 to see how the interfaces are. sorry for being out of sync here May 26 12:16:44 good luck vvu :) May 26 12:16:57 vvu : atleast you have interesting subjects :) May 26 12:17:06 vvu: That's fine/ May 26 12:17:34 I have enough work to keep me occupied during this time :) May 26 12:46:04 praveendath92: try and enumerate the interfaces you have using libusb May 26 12:46:09 and check each endpoint May 26 12:46:43 Will do that. May 26 12:47:10 praveendath92: http://www.dreamincode.net/forums/topic/148707-introduction-to-using-libusb-10/ May 26 12:47:32 it is cpp code but it has there a print_dev function that takes a *libusb_dev item i think so and says everything about it May 26 12:47:35 Does the log I sent you look fine? May 26 12:48:10 did not fully look through it, but when in doubt use this function, at least helped me a lot last year May 26 12:48:39 I will try this now. May 26 12:49:40 Abhishek_, it might be possible to extend UIO May 26 12:49:46 but it's not going to be an easy thing May 26 12:51:44 panto: as in implementation of cache coherency as well? May 26 12:52:37 yeah May 26 12:52:54 I doubt it makes much sense at this point May 26 12:53:02 just go on with your app at 25MHz May 26 12:53:14 Ok May 26 12:56:33 But I would like to come back and improve it at some point May 26 12:56:43 certainly May 26 12:57:01 I still think we should do remote proc at some point May 26 12:57:22 so structure your application in such a way that this might be possible May 26 12:57:30 and when we have time we can go back May 26 12:58:17 Can it be done through mmap? May 26 12:58:32 we'll see :) May 26 12:58:41 focus on the next task at hand May 26 12:59:06 you always have something next to do May 26 13:00:03 Okay. Would it be a good idea to bring it up in Wednesday's meeting? (ds2, mranostay) May 26 13:15:42 panto : Is there some way I can simulate device_create_file? In your driver you get the required "struct device *" in the probe function via the "platform_device" structure. Any way I can just make a dummy driver with sysfs not bothering about probe as of now?? May 26 13:16:35 panto : the first sentence did not come out correctly. but hope you get the idea.... May 26 13:17:59 struct device *dev = &pdev->dev; May 26 13:18:19 you cannot just hack around May 26 13:18:27 create a normal platform device May 26 13:18:56 okay. I was hoping there was some way to try sysfs before platform. May 26 13:19:03 no May 26 13:19:39 fine. back to work again :P May 26 13:21:03 panto : just that I got comfortable with sysfs, and yet not ready with platform drivers. But I'll try to whip up something by tonite :) May 26 13:23:28 it's not a big deal really May 26 13:23:39 you get all that almost for free May 26 13:25:57 I end up messing things up when I have't really read through well ( I'm a person who cross questions himself 100 times before trying out something that could break stuff :-( ) May 26 13:27:01 * karki remembers the day he shorted a whole block of his school :'( May 26 13:32:41 Abhishek_ : I think it would be a good idea to keep your code remote proc friendly. We could end up helping each other. My driver will have sysfs, mmap functionality which you could use and I could use your code for high speed PRU --> ARM functionality for PRU Speak :) May 26 15:28:34 * Abhishek_ adds more NOPs to drop the sample rate to 25 MHz May 26 15:29:46 Abhishek_, you can even tweak the PRU frequency if you're feeling lazy :) May 26 15:30:20 cool, would be a good idea to bring down the sample rate more May 26 15:30:49 I was going to compile different firmware for [100, 50, 25, 10, 5, 1, 0.5] MHz May 26 15:31:08 wondered how many NOPs I could insert. May 26 15:31:09 single function device :) May 26 15:31:39 if you can do that on runtime, it's a very elegant solution May 26 15:32:03 panto: Can using the timer on the PRU lead up to something? May 26 15:32:04 you can do really accurate frequencies May 26 15:32:18 not at such high rates May 26 15:35:57 could some one explain why my BBB (192.168.7.2 )refuses to connect to the internet. I'm able to ssh to it via my comp (192.168.7.9). gateway (192.168.7.1 ) and mask are set properly. but even ping to the default gateway fails! May 26 15:36:06 iptables? May 26 15:37:08 no. directly connected to the network via ethernet May 26 15:47:08 I don't know how to do it in this case, but I configured my BBB to share the PC's internet via the same USB cable using iptables. May 26 15:51:21 This is something I have never faced before. I'm quite sure my network settings is correct.... May 26 15:52:50 does your PC ping the gateway when configured with the same settings? May 26 15:56:10 yes May 26 15:58:57 I'm talking on IRC, so I believe that this pc is making it through the default gateway ;) May 26 15:59:40 Abhishek_ : even the route command gives me expected and comparable results for both PC and BBB. May 26 15:59:58 never had this problem before :/ May 26 16:07:29 panto: Reducing the sample rate to 25 MHz gives me a *very* narrow margin, interrupts seem to arrive at the right time but how can I be sure that data hasn't been overwritten while memcpying and all samples are intact? May 26 16:08:50 memcpy takes me 150ms while data arrives at 160ms intervals May 26 16:10:54 increase the buffer size then May 26 16:11:15 and that what your overflow detection method is there for May 26 16:11:46 The byte counter is off by 8388608 bytes May 26 16:11:57 I suppose I have it then May 26 16:12:31 that where you can use external function generators May 26 16:12:43 feed the pins some kind of regular input waveform May 26 16:12:54 and have some code that verifies it's valid May 26 16:14:01 hmm, maybe I could do something in my PRU firmware to insert a count instead, and then check the pattern on reception May 26 16:14:12 that would do too May 26 16:14:27 karki: 21 page final exam for distributed systems, call that interesting topic? May 26 16:15:00 vvu : I said the topic is, not the exam ;) May 26 16:15:18 they go glued together May 26 16:32:15 mranostay: If you've seen the previous messages, I am falling short by around 10ms between interrupt and memcpy when I bring the rate down May 26 16:44:41 * karki thinks it is best to configure iptable on his PC May 26 17:25:24 praveendath92: so you asked last time what about the control transfer right ? May 26 17:25:42 Yep. May 26 17:25:49 ok https://gist.github.com/praveendath92/9641145#file-simplectrl-modified-c-L145 May 26 17:26:00 look there it uses the handle to send things to May 26 17:26:11 I didn't find a control end with that libusb code you sent. May 26 17:26:25 so you do a request type, value and stuff like that. you do not need an endpoint for it May 26 17:26:44 I just figured that a while ago. May 26 17:27:01 the same should work in the kernel as well May 26 17:27:04 http://libusb.sourceforge.net/api-1.0/group__syncio.html#gadb11f7a761bd12fc77a07f4568d56f38 May 26 17:27:18 I was out for a while and just back. May 26 17:27:29 yep May 26 17:27:42 Looking at how to do this in kernel module now. May 26 17:27:52 av500: You around? May 26 17:28:18 praveendath92: https://www.kernel.org/doc/htmldocs/usb/API-usb-control-msg.html May 26 17:28:41 the link i ave you in the email about the led example has control transfer in it May 26 17:29:11 Wow. That's awesome. May 26 17:29:49 I mean this new link. May 26 17:30:23 I will look at that too. May 26 17:31:54 yep, just do it as greg does it there, expose some sysfs so you can change to adk from userspace just to have this set up May 26 17:34:04 any other issues ? May 26 17:34:29 About exposing it to userspace for setting to adk mode, May 26 17:34:37 also do you have some documentation about adk mode ? May 26 17:34:45 like what the values in the ctl transfer mean / May 26 17:35:17 I'm think that I will just send the control commands in the probe function and release the interface so, it will attach with new pid later. May 26 17:35:39 i think you should have the same driver for both modes May 26 17:35:42 adk and non adk May 26 17:35:51 Nope. Nothing in particular. Just the official adk and aoa page. May 26 17:35:58 Yes. yes. May 26 17:36:11 because you can declare multiple vid/pid(s) May 26 17:36:20 The same probe function checks if the connection is in adk mode already. May 26 17:36:24 and just handle them in the probe function May 26 17:36:25 yep May 26 17:36:53 If not, set it - this is just a few cntrl transfers as we have seen. May 26 17:37:10 And once it goes to adk-mode, a new story starts. May 26 17:37:38 Sorry, I have to ping even for very basic stuff. May 26 17:37:38 ok we should have really robust the change to adk code May 26 17:37:44 np May 26 17:38:03 anyway from next week i will move to TI office in Munich so I will be around all day in front of the pc May 26 17:38:19 That's nice. May 26 17:38:23 :) May 26 17:38:28 :) May 26 17:38:51 How is your prep. going? vvu May 26 17:38:51 we should find out what those values mean May 26 17:38:56 prep regarding ? May 26 17:39:11 exam. May 26 17:39:22 You have the last one tomorrow. Don't you? May 26 17:39:26 yep May 26 17:39:42 need to start reading about memory management, pages, page tables and stuffz like that May 26 17:39:57 I never remembered my exams so well ;-) May 26 17:40:20 but until 2morrow 2PM there are 3 more days, tonight, all nighter and 2morrow morning May 26 17:40:25 Oh. Sounds like interesting stuff to me. May 26 17:40:43 Haha. May 26 17:40:59 Engineer May 26 17:41:02 talk May 26 17:41:06 ;) May 26 17:41:44 after i finish my exam need to start packing my room to move it :) May 26 17:41:55 * vvu needs to take all his beagles in a small trip May 26 17:42:18 That's like the most boring job. May 26 17:42:20 Packing :/ May 26 17:43:15 from next week i will help you test some more May 26 17:43:40 now i'm working on an ARM chromebook don't even have linux headers for it installed May 26 17:44:50 Sure :) May 26 17:46:08 I may not be available for most of next week but after that all the time. May 26 17:47:30 anybody here has a clue how to install kernel headers that are not available via apt-get install ? May 26 17:48:26 copy paste ;) May 26 17:48:58 don't really wanna screw up with the kernel on the chromebook May 26 17:49:23 atleast someone has a chromebook :'( May 26 17:49:36 vvu what hacking do you plan to do on the CB? May 26 17:50:09 just to test praveendath92 kernel module May 26 17:50:12 nothing much May 26 17:50:20 too slow for some major league hacking May 26 17:50:42 i mainly do all my work on a vps somewhere at digitalocean but that i cannot test there May 26 19:37:23 panto: Charles Steinkuehler just gave me the idea of "isolating" a chunk of memory at boot time. **** ENDING LOGGING AT Tue May 27 02:59:58 2014