{"action":"created","issue":{"url":"https://api.github.com/repos/Wouter1/EMU-driver/issues/33","labels_url":"https://api.github.com/repos/Wouter1/EMU-driver/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/Wouter1/EMU-driver/issues/33/comments","events_url":"https://api.github.com/repos/Wouter1/EMU-driver/issues/33/events","html_url":"https://github.com/Wouter1/EMU-driver/issues/33","id":54087951,"number":33,"title":"byte-accurate sync input and output","user":{"login":"Wouter1","id":7699948,"avatar_url":"https://avatars.githubusercontent.com/u/7699948?v=3","gravatar_id":"","url":"https://api.github.com/users/Wouter1","html_url":"https://github.com/Wouter1","followers_url":"https://api.github.com/users/Wouter1/followers","following_url":"https://api.github.com/users/Wouter1/following{/other_user}","gists_url":"https://api.github.com/users/Wouter1/gists{/gist_id}","starred_url":"https://api.github.com/users/Wouter1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wouter1/subscriptions","organizations_url":"https://api.github.com/users/Wouter1/orgs","repos_url":"https://api.github.com/users/Wouter1/repos","events_url":"https://api.github.com/users/Wouter1/events{/privacy}","received_events_url":"https://api.github.com/users/Wouter1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-01-12T18:21:57Z","updated_at":"2015-01-12T21:33:22Z","closed_at":null,"body":"Maybe some of the existing issues require even more accurate syncing between input nd output. Previously we syncted down to the USB frame (#30) but maybe this is not good enough. \r\n\r\nLet's see how close we really are and if we can get this closer. \r\n"},"comment":{"url":"https://api.github.com/repos/Wouter1/EMU-driver/issues/comments/69650273","html_url":"https://github.com/Wouter1/EMU-driver/issues/33#issuecomment-69650273","issue_url":"https://api.github.com/repos/Wouter1/EMU-driver/issues/33","id":69650273,"user":{"login":"Wouter1","id":7699948,"avatar_url":"https://avatars.githubusercontent.com/u/7699948?v=3","gravatar_id":"","url":"https://api.github.com/users/Wouter1","html_url":"https://github.com/Wouter1","followers_url":"https://api.github.com/users/Wouter1/followers","following_url":"https://api.github.com/users/Wouter1/following{/other_user}","gists_url":"https://api.github.com/users/Wouter1/gists{/gist_id}","starred_url":"https://api.github.com/users/Wouter1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wouter1/subscriptions","organizations_url":"https://api.github.com/users/Wouter1/orgs","repos_url":"https://api.github.com/users/Wouter1/repos","events_url":"https://api.github.com/users/Wouter1/events{/privacy}","received_events_url":"https://api.github.com/users/Wouter1/received_events","type":"User","site_admin":false},"created_at":"2015-01-12T21:33:22Z","updated_at":"2015-01-12T21:33:22Z","body":"The offset at 44.1 must be caused by initial 3 cycles where the write list has to guess the frame sizes, waiting for the reads to come in\r\n\r\nYou cxan also see that happen in the logs , in \"frameSizeQueue empty, guessing some queue size. May need fix..\r\n\":\r\n\r\n```\r\nJan 12 22:15:01 vlieland kernel[0]: +UsbInputRing::init bytesize=98304 byterate=529200\r\nJan 12 22:15:01 vlieland kernel[0]: -UsbInputRing::init 185759637\r\nJan 12 22:15:01 vlieland kernel[0]: create output pipe \r\nJan 12 22:15:01 vlieland kernel[0]: check for associated endpoint\r\nJan 12 22:15:01 vlieland kernel[0]: READ framelist 0 in framenr 42570526 at 44285045041467\r\nJan 12 22:15:01 vlieland kernel[0]: READ framelist 1 in framenr 42570590 at 44285045117215\r\nJan 12 22:15:01 vlieland kernel[0]: READ framelist 2 in framenr 42570654 at 44285045176191\r\nJan 12 22:15:01 vlieland kernel[0]: READ framelist 3 in framenr 42570718 at 44285045231161\r\nJan 12 22:15:01 vlieland kernel[0]: frameSizeQueue empty, guessing some queue size. May need fix..\r\nJan 12 22:15:01 --- last message repeated 127 times ---\r\nJan 12 22:15:01 vlieland kernel[0]: ++EMUUSBAudioEngine[0xffffff8034361800]::performEngineStart result is 0x0 direction 1\r\nJan 12 22:15:01 vlieland kernel[0]: USBF:    44285.108    AppleUSBXHCI[0xffffff81a21d5000]::PollEventRing2 - Isoc Transfer event with completion code (3) on pEP (0xffffff803579c800)\r\nJan 12 22:15:01 vlieland kernel[0]: USBF:    44285.109    AppleUSBXHCI[0xffffff81a21d5000]::PollEventRing2 - Isoc Transfer event with completion code (3) on pEP (0xffffff803579c800)\r\nJan 12 22:15:01 vlieland kernel[0]: frameSizeQueue empty, guessing some queue size. May need fix..\r\nJan 12 22:15:01 --- last message repeated 58 times ---\r\nJan 12 22:15:01 vlieland kernel[0]: write wrap in usbframe 42570654 list 58 byte 96\r\nJan 12 22:15:01 vlieland kernel[0]: frameSizeQueue empty, guessing some queue size. May need fix..\r\nJan 12 22:15:01 --- last message repeated 4 times ---\r\nJan 12 22:15:01 vlieland kernel[0]: READ framelist 0 in framenr 42570782 at 44285172276763\r\nJan 12 22:15:01 vlieland kernel[0]: READ framelist 1 in framenr 42570846 at 44285236119008\r\n\r\n```\r\n\r\n3 cycles = 3*64 = 192 samples. At 44.1kHz,we guess 44 so we are 1 off every 10, or 19 samples off in total. \r\n\r\n19 quad samples = 228 bytes, exactly the amount we found. So we can compensate for this error.\r\n\r\n"}}