{"action":"opened","issue":{"url":"https://api.github.com/repos/OSVR/OSVR-Core/issues/403","repository_url":"https://api.github.com/repos/OSVR/OSVR-Core","labels_url":"https://api.github.com/repos/OSVR/OSVR-Core/issues/403/labels{/name}","comments_url":"https://api.github.com/repos/OSVR/OSVR-Core/issues/403/comments","events_url":"https://api.github.com/repos/OSVR/OSVR-Core/issues/403/events","html_url":"https://github.com/OSVR/OSVR-Core/issues/403","id":143332987,"number":403,"title":"Audodetect All the Things!","user":{"login":"godbyk","id":195036,"avatar_url":"https://avatars.githubusercontent.com/u/195036?v=3","gravatar_id":"","url":"https://api.github.com/users/godbyk","html_url":"https://github.com/godbyk","followers_url":"https://api.github.com/users/godbyk/followers","following_url":"https://api.github.com/users/godbyk/following{/other_user}","gists_url":"https://api.github.com/users/godbyk/gists{/gist_id}","starred_url":"https://api.github.com/users/godbyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/godbyk/subscriptions","organizations_url":"https://api.github.com/users/godbyk/orgs","repos_url":"https://api.github.com/users/godbyk/repos","events_url":"https://api.github.com/users/godbyk/events{/privacy}","received_events_url":"https://api.github.com/users/godbyk/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OSVR/OSVR-Core/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-24T19:06:45Z","updated_at":"2016-03-24T19:06:45Z","closed_at":null,"body":"I'm proposing a policy for OSVR wherein OSVR attempts to autodetect as much as possible and require as minimal user-configuration as possible while still providing the maximum user experience.\r\n\r\nCurrently, OSVR is rife with configuration files. Any time a new major feature is added, it's accompanied by one or more configuration files or subsets thereof.  This is causing a huge headache for the end-users of OSVR—developers and gamers alike.\r\n\r\nStuffing settings, options, and data into configuration files is usually done as a quick workaround during development because the developer (a) doesn't know what the best default is; (b) hasn't yet written code to autodetect the best values; or (c) is unable to provide the data in any other way via the current API. Only rarely is it the case that the values cannot be autodetected and must be provided via a user-specified configuration file.\r\n\r\nLet's examine what information is in the current configuration files and how we can autodetect it instead.\r\n\r\n## Server configuration\r\n\r\n### Automatically loaded plugins\r\n\r\nMost of the plugin-specific configuration parameters should have sane defaults. The configuration file should only be used to override those defaults at the user's discretion.\r\n\r\n### Manually loaded plugins\r\n\r\nManually loaded plugins must still be specified in the configuration file, of course. We should strive to keep their number low, however.\r\n\r\n### Aliases\r\n\r\nAliases are generally provided by plugins. The only aliases required to be provided by end users are the custom aliases the end user wishes to create.\r\n\r\n### Display descriptors\r\n\r\nDisplay descriptors should be provided by OSVR plugins that detect those HMDs. Many times the plugins can provide device-specific descriptors that are more accurate than the general configuration files that exist today.  For example, the OSVR-OculusRift plugin should provide its display descriptor via the PluginKit API instead of via a configuration file.\r\n\r\n### RenderManager configurations\r\n\r\nMuch of the RenderManager configuration can be autodetected. The display index, rotation, and color depth; the window size and position; and the availability of direct mode are all autodetectable. The other parameters should have sane (and performant) defaults. The end user should only need to specify values when they'd like to override the defaults.\r\n\r\n## Related work\r\n\r\n### Triggering hardware detection\r\n\r\nPlugins are asked to check for their associated hardware when 'hardware detection' is triggered. Currently, hardware detection is only triggered when a new client connects to the server.  This means that if hardware is added or removed from the system, the server is completely unaware of it because the plugins haven't been asked to look for it.\r\n\r\nOSVR (or a special plugin) should monitor for hardware changes and trigger hardware detection any time a device is added or removed. This would allow users to hot-plug devices without restarting the client or server.\r\n\r\n### Detecting display configuration\r\n\r\nA common problem users are encountering is that the default configuration assumes that the user's primary display has a resolution of 1920×1080 and sits directly to the left of the HMD display. Any deviations from this configuration require the user to modify the OSVR server configuration file before their SteamVR games will work properly without custom configuration.\r\n\r\nAs mentioned above, RenderManager (or another component that can provide the information to RenderManager) should autodetect the display configuration and the HMD's position within it so that, for example, the information can be provided to the SteamVR client.\r\n\r\n## Requirements\r\n\r\nTo implement this Autodetect All the Things policy, we need to add some new API calls:\r\n\r\n1. Add a method to the PluginKit API so that plugins can provide their own display descriptor programmatically (issue #35).\r\n\r\n2. Add functionality to RenderManager to autodetect more of its configuration (especially the display configuration—the positions and resolutions of attached displays).\r\n\r\n3. Modify `osvr_server` so it may run without a configuration at all (issue #228 and PR #293).\r\n\r\n4. Write plugins to detect Sensics and OSVR HMDs and provide their display descriptors.\r\n\r\n5. Add a method to the PluginKit API so that a plugin can trigger hardware detection (issue #155).\r\n"}}