{"action":"created","issue":{"url":"https://api.github.com/repos/supercollider/supercollider/issues/1943","repository_url":"https://api.github.com/repos/supercollider/supercollider","labels_url":"https://api.github.com/repos/supercollider/supercollider/issues/1943/labels{/name}","comments_url":"https://api.github.com/repos/supercollider/supercollider/issues/1943/comments","events_url":"https://api.github.com/repos/supercollider/supercollider/issues/1943/events","html_url":"https://github.com/supercollider/supercollider/pull/1943","id":145140062,"number":1943,"title":"Do not allocate all channels reported by Pa_GetDeviceInfo / use memcpy instead of for-loop","user":{"login":"hzulla","id":1705654,"avatar_url":"https://avatars.githubusercontent.com/u/1705654?v=3","gravatar_id":"","url":"https://api.github.com/users/hzulla","html_url":"https://github.com/hzulla","followers_url":"https://api.github.com/users/hzulla/followers","following_url":"https://api.github.com/users/hzulla/following{/other_user}","gists_url":"https://api.github.com/users/hzulla/gists{/gist_id}","starred_url":"https://api.github.com/users/hzulla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hzulla/subscriptions","organizations_url":"https://api.github.com/users/hzulla/orgs","repos_url":"https://api.github.com/users/hzulla/repos","events_url":"https://api.github.com/users/hzulla/events{/privacy}","received_events_url":"https://api.github.com/users/hzulla/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-04-01T10:04:14Z","updated_at":"2016-04-02T11:01:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/supercollider/supercollider/pulls/1943","html_url":"https://github.com/supercollider/supercollider/pull/1943","diff_url":"https://github.com/supercollider/supercollider/pull/1943.diff","patch_url":"https://github.com/supercollider/supercollider/pull/1943.patch"},"body":"On Linux, SuperCollider's PortAudio driver talks to ALSA (or to PulseAudio using PulseAudio's ALSA compatibility layer).\r\n\r\nBy default, the current audio driver will use the `default` audio device and [allocate *all* channels](https://github.com/supercollider/supercollider/blob/c017920b29d3fb76b230c14411c46be39b04e9f3/server/scsynth/SC_PortAudio.cpp#L418) reported back by `Pa_GetDeviceInfo()`.\r\n\r\nOn pure ALSA, the `default` device reports 128 in/out channels.\r\nOn PulseAudio, it reports 32 in/out channels.\r\n\r\nIt isn't necessary to allocate all channels, the application only needs to request the number of channels it actually uses. I didn't find a good explanation for why PortAudio reports these many virtual channels, but [this mailing list thread](http://music.columbia.edu/pipermail/portaudio/2014-February/015820.html) basically boils down to \"don't worry, it's an artefact of the ALSA API and you're fine with simply allocating the number of channels you need and not more\".\r\n\r\nSo that's what this patch does.\r\n\r\nAlso, both src and dst are float, so we can use memcpy/memset.\r\n\r\nI tested this on XUbuntu 15.10 and there was no change in behaviour compared to the current git version. (Both the current git version and my patched version do not work with pure ALSA, but do work with PulseAudio. I will file a separate issue #1944 for debugging that.)\r\n\r\nThis will require testing. @sonoro1234 - could you please have a look?"},"comment":{"url":"https://api.github.com/repos/supercollider/supercollider/issues/comments/204694529","html_url":"https://github.com/supercollider/supercollider/pull/1943#issuecomment-204694529","issue_url":"https://api.github.com/repos/supercollider/supercollider/issues/1943","id":204694529,"user":{"login":"bagong","id":1502057,"avatar_url":"https://avatars.githubusercontent.com/u/1502057?v=3","gravatar_id":"","url":"https://api.github.com/users/bagong","html_url":"https://github.com/bagong","followers_url":"https://api.github.com/users/bagong/followers","following_url":"https://api.github.com/users/bagong/following{/other_user}","gists_url":"https://api.github.com/users/bagong/gists{/gist_id}","starred_url":"https://api.github.com/users/bagong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bagong/subscriptions","organizations_url":"https://api.github.com/users/bagong/orgs","repos_url":"https://api.github.com/users/bagong/repos","events_url":"https://api.github.com/users/bagong/events{/privacy}","received_events_url":"https://api.github.com/users/bagong/received_events","type":"User","site_admin":false},"created_at":"2016-04-02T11:01:58Z","updated_at":"2016-04-02T11:01:58Z","body":"@sonoro1234 the changes in the \"new\" Windows build system are quite deep. Among others it will compile a bundled, latest PA as part of the SC build. Your old build system might still work on master right now, but once the changes from 3.7 get committed to master (still time to prevent it ;) ) you will have to change it. I hope you are fine with that. Maybe you want to have a look at 3.7? I can guide you via Gitter or so, if you are interested..."}}