| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 # Virtual Me2Me implementation. This script runs and manages the processes | 6 # Virtual Me2Me implementation. This script runs and manages the processes |
| 7 # required for a Virtual Me2Me desktop, which are: X server, X desktop | 7 # required for a Virtual Me2Me desktop, which are: X server, X desktop |
| 8 # session, and Host process. | 8 # session, and Host process. |
| 9 # This script is intended to run continuously as a background daemon | 9 # This script is intended to run continuously as a background daemon |
| 10 # process, running under an ordinary (non-root) user account. | 10 # process, running under an ordinary (non-root) user account. |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 os.mkfifo(pipe_name) | 226 os.mkfifo(pipe_name) |
| 227 except IOError, e: | 227 except IOError, e: |
| 228 logging.error("Failed to create pulseaudio pipe: " + str(e)) | 228 logging.error("Failed to create pulseaudio pipe: " + str(e)) |
| 229 return False | 229 return False |
| 230 | 230 |
| 231 try: | 231 try: |
| 232 pulse_config = open(os.path.join(pulse_path, "default.pa"), "w") | 232 pulse_config = open(os.path.join(pulse_path, "default.pa"), "w") |
| 233 pulse_config.write("load-module module-native-protocol-unix\n") | 233 pulse_config.write("load-module module-native-protocol-unix\n") |
| 234 pulse_config.write( | 234 pulse_config.write( |
| 235 ("load-module module-pipe-sink sink_name=%s file=\"%s\" " + | 235 ("load-module module-pipe-sink sink_name=%s file=\"%s\" " + |
| 236 "rate=44100 channels=2 format=s16le\n") % | 236 "rate=48000 channels=2 format=s16le\n") % |
| 237 (sink_name, pipe_name)) | 237 (sink_name, pipe_name)) |
| 238 pulse_config.close() | 238 pulse_config.close() |
| 239 except IOError, e: | 239 except IOError, e: |
| 240 logging.error("Failed to write pulseaudio config: " + str(e)) | 240 logging.error("Failed to write pulseaudio config: " + str(e)) |
| 241 return False | 241 return False |
| 242 | 242 |
| 243 self.child_env["PULSE_CONFIG_PATH"] = pulse_path | 243 self.child_env["PULSE_CONFIG_PATH"] = pulse_path |
| 244 self.child_env["PULSE_RUNTIME_PATH"] = pulse_path | 244 self.child_env["PULSE_RUNTIME_PATH"] = pulse_path |
| 245 self.child_env["PULSE_STATE_PATH"] = pulse_path | 245 self.child_env["PULSE_STATE_PATH"] = pulse_path |
| 246 self.child_env["PULSE_SINK"] = sink_name | 246 self.child_env["PULSE_SINK"] = sink_name |
| (...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 logging.info("Host domain is blocked by policy - exiting.") | 1015 logging.info("Host domain is blocked by policy - exiting.") |
| 1016 os.remove(host.config_file) | 1016 os.remove(host.config_file) |
| 1017 return 0 | 1017 return 0 |
| 1018 # Nothing to do for Mac-only status 6 (login screen unsupported) | 1018 # Nothing to do for Mac-only status 6 (login screen unsupported) |
| 1019 | 1019 |
| 1020 | 1020 |
| 1021 if __name__ == "__main__": | 1021 if __name__ == "__main__": |
| 1022 logging.basicConfig(level=logging.DEBUG, | 1022 logging.basicConfig(level=logging.DEBUG, |
| 1023 format="%(asctime)s:%(levelname)s:%(message)s") | 1023 format="%(asctime)s:%(levelname)s:%(message)s") |
| 1024 sys.exit(main()) | 1024 sys.exit(main()) |
| OLD | NEW |