VirtualBox

source: vbox/trunk/doc/manual/en_US/dita/topics/pcspeaker_passthrough.dita@ 108750

Last change on this file since 108750 was 108750, checked in by vboxsync, 3 weeks ago

Docs: bugref:10705. The following commits from doc's team git repo has been applied:

113d19fbbcf63a7e5a7dc1870e5446a03e9687ff updated for clarity
7c100f906d5f7f6dba276fce9a20a58d8ec32a0a Vbp 1463 exp features
134915fb1e15f269acf050c5d1085589e09b645d Removed disk options no longer in GUI

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

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette