1 | <?xml version='1.0' encoding='UTF-8'?>
|
---|
2 | <!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
|
---|
3 | <topic xml:lang="en-us" id="pcspeaker_passthrough">
|
---|
4 | <title>PC Speaker Passthrough</title>
|
---|
5 |
|
---|
6 | <body>
|
---|
7 | <p>As an experimental feature, primarily due to being limited to Linux host only and unknown Linux distribution
|
---|
8 | coverage, <ph conkeyref="vbox-conkeyref-phrases/product-name"/> supports passing through the PC speaker to the
|
---|
9 | host. The PC speaker, sometimes called the system speaker, is a way to produce audible feedback such as beeps
|
---|
10 | without the need for regular audio and sound card support. </p>
|
---|
11 | <p>The PC speaker passthrough feature in <ph conkeyref="vbox-conkeyref-phrases/product-name"/> handles beeps only.
|
---|
12 | Advanced PC speaker use by the VM, such as PCM audio, will not work, resulting in undefined host behavior. </p>
|
---|
13 | <p>Producing beeps on Linux is a very complex topic. <ph conkeyref="vbox-conkeyref-phrases/product-name"/> offers a
|
---|
14 | collection of options, in an attempt to make this work deterministically and reliably on as many Linux
|
---|
15 | distributions and system configurations as possible. These are summarized in the following table. </p>
|
---|
16 | <table id="table-pcspeaker-config">
|
---|
17 | <title>PC Speaker Configuration Options</title>
|
---|
18 | <desc>PC Speaker Configuration Options</desc>
|
---|
19 | <tgroup cols="3">
|
---|
20 | <thead>
|
---|
21 | <row>
|
---|
22 | <entry>
|
---|
23 | <p>
|
---|
24 | <b outputclass="bold">Code</b>
|
---|
25 | </p>
|
---|
26 | </entry>
|
---|
27 | <entry>
|
---|
28 | <p>
|
---|
29 | <b outputclass="bold">Device</b>
|
---|
30 | </p>
|
---|
31 | </entry>
|
---|
32 | <entry>
|
---|
33 | <p>
|
---|
34 | <b outputclass="bold">Notes</b>
|
---|
35 | </p>
|
---|
36 | </entry>
|
---|
37 | </row>
|
---|
38 | </thead>
|
---|
39 | <tbody>
|
---|
40 | <row>
|
---|
41 | <entry>
|
---|
42 | <p>
|
---|
43 | 1
|
---|
44 | </p>
|
---|
45 | </entry>
|
---|
46 | <entry>
|
---|
47 | <p>
|
---|
48 | <filepath>/dev/input/by-path/platform-pcspkr-event-spkr</filepath>
|
---|
49 | </p>
|
---|
50 | </entry>
|
---|
51 | <entry>
|
---|
52 | <p>
|
---|
53 | Direct host PC speaker use.
|
---|
54 | </p>
|
---|
55 | </entry>
|
---|
56 | </row>
|
---|
57 | <row>
|
---|
58 | <entry>
|
---|
59 | <p>
|
---|
60 | 2
|
---|
61 | </p>
|
---|
62 | </entry>
|
---|
63 | <entry>
|
---|
64 | <filepath>/dev/tty</filepath>
|
---|
65 | </entry>
|
---|
66 | <entry>
|
---|
67 | <p>
|
---|
68 | Uses the terminal association of the VM process. VM
|
---|
69 | needs to be started on a virtual console.
|
---|
70 | </p>
|
---|
71 | </entry>
|
---|
72 | </row>
|
---|
73 | <row>
|
---|
74 | <entry>
|
---|
75 | <p>
|
---|
76 | 3
|
---|
77 | </p>
|
---|
78 | </entry>
|
---|
79 | <entry>
|
---|
80 | <p><filepath>/dev/tty0</filepath> or
|
---|
81 | <filepath>/dev/vc/0</filepath>
|
---|
82 | </p>
|
---|
83 | </entry>
|
---|
84 | <entry>
|
---|
85 | <p>
|
---|
86 | Can only be used by user <codeph>root</codeph> or
|
---|
87 | users with <codeph>cap_sys_tty_config</codeph>
|
---|
88 | capability.
|
---|
89 | </p>
|
---|
90 | </entry>
|
---|
91 | </row>
|
---|
92 | <row>
|
---|
93 | <entry>
|
---|
94 | <p>
|
---|
95 | 9
|
---|
96 | </p>
|
---|
97 | </entry>
|
---|
98 | <entry>
|
---|
99 | <p>
|
---|
100 | A user-specified console or evdev device path.
|
---|
101 | </p>
|
---|
102 | </entry>
|
---|
103 | <entry>
|
---|
104 | <p>
|
---|
105 | As for codes 1 to 3, but with a custom device path.
|
---|
106 | </p>
|
---|
107 | </entry>
|
---|
108 | </row>
|
---|
109 | <row>
|
---|
110 | <entry>
|
---|
111 | <p>
|
---|
112 | 70
|
---|
113 | </p>
|
---|
114 | </entry>
|
---|
115 | <entry>
|
---|
116 | <p>
|
---|
117 | <filepath>/dev/tty</filepath>
|
---|
118 | </p>
|
---|
119 | </entry>
|
---|
120 | <entry>
|
---|
121 | <p>
|
---|
122 | Standard beep only. Loses frequency and length. See code
|
---|
123 | 2.
|
---|
124 | </p>
|
---|
125 | </entry>
|
---|
126 | </row>
|
---|
127 | <row>
|
---|
128 | <entry>
|
---|
129 | <p>
|
---|
130 | 79
|
---|
131 | </p>
|
---|
132 | </entry>
|
---|
133 | <entry>
|
---|
134 | <p>
|
---|
135 | A user-specified terminal device path.
|
---|
136 | </p>
|
---|
137 | </entry>
|
---|
138 | <entry>
|
---|
139 | <p>
|
---|
140 | As for code 70, but with a custom device path.
|
---|
141 | </p>
|
---|
142 | </entry>
|
---|
143 | </row>
|
---|
144 | <row>
|
---|
145 | <entry>
|
---|
146 | <p>
|
---|
147 | 100
|
---|
148 | </p>
|
---|
149 | </entry>
|
---|
150 | <entry>
|
---|
151 | <p>
|
---|
152 | All of the above.
|
---|
153 | </p>
|
---|
154 | </entry>
|
---|
155 | <entry>
|
---|
156 | <p>
|
---|
157 | Tries all the available codes.
|
---|
158 | </p>
|
---|
159 | </entry>
|
---|
160 | </row>
|
---|
161 | </tbody>
|
---|
162 | </tgroup>
|
---|
163 | </table>
|
---|
164 | <p>To enable PC speaker passthrough use the following command: </p>
|
---|
165 | <pre xml:space="preserve">VBoxManage setextradata <varname>VM-name</varname> "VBoxInternal/Devices/i8254/0/Config/PassthroughSpeaker" <varname>N</varname>
|
---|
166 | </pre>
|
---|
167 | <p>Replace <varname>N</varname> with the code representing the case you want to use. Changing this setting takes
|
---|
168 | effect when you next start the VM. It is safe to enable PC speaker passthrough on all host OSes. It will only have
|
---|
169 | an effect on Linux. </p>
|
---|
170 | <p>The VM log file, <filepath>VBox.log</filepath>, contains lines with the prefix <codeph>PIT: speaker:</codeph>
|
---|
171 | showing the PC speaker passthrough setup activities. It gives hints which device it picked or why it failed. </p>
|
---|
172 | <p>Enabling PC speaker passthrough for the VM is usually the simple part. The real difficulty is making sure that
|
---|
173 | <ph conkeyref="vbox-conkeyref-phrases/product-name"/> can access the necessary device, because in a typical
|
---|
174 | Linux install most of them can only be accessed by user <codeph>root</codeph>. You should follow the preferred way
|
---|
175 | to persistently change this, such as by referring to your distribution's documentation. Since there are countless
|
---|
176 | Linux distribution variants, we can only give the general hints that there is often a way to give the X11 session
|
---|
177 | user access to additional devices, or you need to find a working solution using a udev configuration file. If
|
---|
178 | everything fails you might try setting the permissions using a script which is run late enough in the host system
|
---|
179 | startup. </p>
|
---|
180 | <p>Sometimes additional rules are applied by the kernel to limit access. For example, that the VM process must have
|
---|
181 | the same controlling terminal as the device configured to be used for beeping, something which is often very
|
---|
182 | difficult to achieve for GUI applications such as <ph conkeyref="vbox-conkeyref-phrases/product-name"/>. The table
|
---|
183 | above contains some hints, but in general refer to the Linux documentation. </p>
|
---|
184 | <p>If you have trouble getting any beeps even if the device permissions are set up and VBox.log confirms that it
|
---|
185 | uses evdev or console for the PC speaker control, check if your system has a PC speaker. Some systems do not have
|
---|
186 | one. Other complications can arise from Linux rerouting the PC speaker output to a sound card. Check if the beeps
|
---|
187 | are audible if you connect speakers to your sound card. Today almost all systems have one. Finally, check if the
|
---|
188 | audio mixer control has a channel named <i>beep</i>, which could be hidden in the mixer settings, and that it is
|
---|
189 | not muted. </p>
|
---|
190 | </body>
|
---|
191 |
|
---|
192 | </topic>
|
---|