{"action":"opened","issue":{"url":"https://api.github.com/repos/mossmann/hackrf/issues/205","labels_url":"https://api.github.com/repos/mossmann/hackrf/issues/205/labels{/name}","comments_url":"https://api.github.com/repos/mossmann/hackrf/issues/205/comments","events_url":"https://api.github.com/repos/mossmann/hackrf/issues/205/events","html_url":"https://github.com/mossmann/hackrf/issues/205","id":97982792,"number":205,"title":"About the latency of Hackrf","user":{"login":"dragonyzl","id":12421840,"avatar_url":"https://avatars.githubusercontent.com/u/12421840?v=3","gravatar_id":"","url":"https://api.github.com/users/dragonyzl","html_url":"https://github.com/dragonyzl","followers_url":"https://api.github.com/users/dragonyzl/followers","following_url":"https://api.github.com/users/dragonyzl/following{/other_user}","gists_url":"https://api.github.com/users/dragonyzl/gists{/gist_id}","starred_url":"https://api.github.com/users/dragonyzl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dragonyzl/subscriptions","organizations_url":"https://api.github.com/users/dragonyzl/orgs","repos_url":"https://api.github.com/users/dragonyzl/repos","events_url":"https://api.github.com/users/dragonyzl/events{/privacy}","received_events_url":"https://api.github.com/users/dragonyzl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-29T17:06:57Z","updated_at":"2015-07-29T17:06:57Z","closed_at":null,"body":"Hi, Mossmann and others:\r\nI want to construct a transponder using two hackrf ones for some experiments.  In order to check the feasibility, I want to know the latency between the signal arrive the antenna and the digital signal write to HDD.  I think the latency should include the analog part caused by some LC circuit and the digital part caused by AD and USB. I know this could be measured by oscilloscope， but it is not at hand. Maybe someone knows the latency.  \r\n\r\nAnother question is how to control the latency, I think the latency can be controlled by adjusting the AD sample rate and the buffer size for USB reading or writting, right? Maybe someone can tell me the relationship between the latency and the sample rate and the buffer size. \r\n\r\nThanks in advance!\r\n\r\nBTW: I have implemented the some transponder function using hackrf_transfer by the FIFO file. It is very simple. \r\n1. Using the firmware that support the multidevice.\r\n2. Creat a FIFO file using mkfifo in the current fold.\r\n3. Modify the   hackrf_transfer.c like this:\r\n\r\nresult = setvbuf(fd , NULL , _IOFBF , FD_BUFFER_SIZE);\r\n\t\tif( result != 0 ) {\r\n\t\t\tprintf(\"setvbuf() failed: %d\\n\", result);\r\n\t\t\tusage();\r\n\t\t\treturn EXIT_FAILURE;\r\n\t\t}\r\n==========================================================================\r\n\t\t// I want to modify the hackrf_transfer to implement a transponder using two hackrf one.\r\n\t\t// first, a FIFO file should be created, one hackrf write the received data to the FIFO.\r\n\t\t// and the second hackrf to read the data from the FIFO and transmits the signal. and the \r\n\t\t// transponder need the some delay time.  May be the fuction setbuffer(FILE* stream, char* buf,size_t size)\r\n\t\t// should be used to determing the delay time by set the different buffer size.   Dragonyzl 20150728\r\n\r\n\t\tchar mybuffer[FD_BUFFER_SIZE];\r\n\tsetbuffer(fd , mybuffer ,FD_BUFFER_SIZE );  // Yes, It works. TODO: should mesure the time delay \r\n==========================================================================\r\n/* Write Wav header */\r\n\tif( receive_wav ) \r\n\t{\r\n\t\tfwrite(&wave_file_hdr, 1, sizeof(t_wav_file_hdr), fd);\r\n\t}\r\n\r\n\r\n4.  One for receiver and another for transmitter by hackrf_transfer's option -r and -t with the filename of FIFO name.\r\n\r\n\r\nAgain, I want to know the time delay and its range of variation(in ns, us or ms level ). \r\nThank you!"}}