Am 11.10.2010 19:15, schrieb Oliver Hartkopp: > On 11.10.2010 17:24, Wolfgang Grandegger wrote: >> On 10/11/2010 05:01 PM, "Müller, René" wrote: > > >>> Now we have two cases, one with missing frames and one without: >>> Case 1: >>> - candump -l -s2 can0 -> logging in an file which is stored in RAM >>> - we get all messages in the logfile >>> >>> Case 2: >>> - candump -l -s2 can0 -> logging in an file which is stored on an >>> CompactFlash-card >>> - the CF-card is connected via the IDE-interface without DMA (we don't get >>> DMA working with the CF-card, unfortunately it only works with harddrives) >>> - we are loosing messages: >>> - every 35s we are missing messages in blocks, never we are missing 1 >>> message, always 5-6 at once >>> >>> Anyone had similar problems? Any hints? >> >> Sounds like a receive buffer overrun when the application is not able to >> read messages fast enough. You could use setsockopt(... ,SOL_SOCKET, >> SO_RCVBUF, ....) to increase the buffer size. It's also possible to >> detect dropped CAN frames as described here: >> >> http://www.mail-archive.com/[email protected]/msg00861.html > > ACK. > > With the '-d' Option you are able to detect dropped CAN frames in the socket's > receive buffer. > > Regarding the ' -r <size> ' option to increase the receive buffer you need to > keep in mind that this can only fix temporary problems. > > Whenever the candump tool writes the logfile to the filesystem, the filesystem > may block the userspace application until the write is done. > > When the input stream is *always* faster than the filesystem (especially on a > non-DMA CF-Card) the any receive buffer will overflow by the time ...
We tried an increased buffer with no success. Additional we used the '-d' option. We are loosing no frames if we have no IDE-traffic. We tried to log to RAM with candump and some dd to CF-card in another console and had the problem again. The candump tool reported dropped frames. It seems to be related to the IDE-access, because candump to RAM should be able to get all frames. The performance of the output stream shouldn't be an problem by design, because we are able to write ~5MB/s to the CF-card. Regards, René _______________________________________________ Socketcan-users mailing list [email protected] https://lists.berlios.de/mailman/listinfo/socketcan-users
