{"action":"created","issue":{"url":"https://api.github.com/repos/raspberrypi/linux/issues/999","labels_url":"https://api.github.com/repos/raspberrypi/linux/issues/999/labels{/name}","comments_url":"https://api.github.com/repos/raspberrypi/linux/issues/999/comments","events_url":"https://api.github.com/repos/raspberrypi/linux/issues/999/events","html_url":"https://github.com/raspberrypi/linux/issues/999","id":84081355,"number":999,"title":"alsa: snd_pcm_drain() sometimes takes longer than it should","user":{"login":"wm4","id":1387750,"avatar_url":"https://avatars.githubusercontent.com/u/1387750?v=3","gravatar_id":"","url":"https://api.github.com/users/wm4","html_url":"https://github.com/wm4","followers_url":"https://api.github.com/users/wm4/followers","following_url":"https://api.github.com/users/wm4/following{/other_user}","gists_url":"https://api.github.com/users/wm4/gists{/gist_id}","starred_url":"https://api.github.com/users/wm4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wm4/subscriptions","organizations_url":"https://api.github.com/users/wm4/orgs","repos_url":"https://api.github.com/users/wm4/repos","events_url":"https://api.github.com/users/wm4/events{/privacy}","received_events_url":"https://api.github.com/users/wm4/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-06-02T15:50:44Z","updated_at":"2015-06-09T17:14:20Z","closed_at":null,"body":"This happens with the bcm2835 driver.\r\n\r\nsnd_pcm_drain() should normally wait until all buffered audio data buffered has been played. But sometimes, it seems to take much longer. It takes seconds, even though the amount of buffered audio is only milliseconds.\r\n\r\nHere's a backtrace (with mpv):\r\n```\r\n#0  0x756c2dc8 in ioctl () at ../sysdeps/unix/syscall-template.S:82\r\n#1  0x75b7fc1c in snd_pcm_hw_drain () from /usr/local/lib/libasound.so.2\r\n#2  0x75b672dc in snd_pcm_drain () from /usr/local/lib/libasound.so.2\r\n#3  0x0002a95c in drain (ao=0x83ea50) at ../audio/out/push.c:158\r\n```\r\n\r\nThis seems to happen pretty randomly (and somehow timing related), so I'm really not sure how to provide a reproducible test case."},"comment":{"url":"https://api.github.com/repos/raspberrypi/linux/issues/comments/110437291","html_url":"https://github.com/raspberrypi/linux/issues/999#issuecomment-110437291","issue_url":"https://api.github.com/repos/raspberrypi/linux/issues/999","id":110437291,"user":{"login":"pssc","id":1763553,"avatar_url":"https://avatars.githubusercontent.com/u/1763553?v=3","gravatar_id":"","url":"https://api.github.com/users/pssc","html_url":"https://github.com/pssc","followers_url":"https://api.github.com/users/pssc/followers","following_url":"https://api.github.com/users/pssc/following{/other_user}","gists_url":"https://api.github.com/users/pssc/gists{/gist_id}","starred_url":"https://api.github.com/users/pssc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pssc/subscriptions","organizations_url":"https://api.github.com/users/pssc/orgs","repos_url":"https://api.github.com/users/pssc/repos","events_url":"https://api.github.com/users/pssc/events{/privacy}","received_events_url":"https://api.github.com/users/pssc/received_events","type":"User","site_admin":false},"created_at":"2015-06-09T17:14:20Z","updated_at":"2015-06-09T17:14:20Z","body":"Ah i see this behaviour in my squeezplay Pi build also when using the default internal devices only, I see  buffer underflows (large alsa buffers to some effect mitigated this)."}}