2
0
mirror of https://github.com/pikvm/pikvm synced 2024-11-10 13:10:37 +00:00
pikvm/docs/audio.md

100 lines
3.7 KiB
Markdown
Raw Normal View History

2023-04-20 02:09:50 +00:00
# PiKVM V3+ Audio
2022-06-08 01:10:11 +00:00
2023-12-05 23:55:55 +00:00
Official PiKVM V3, V4 Mini and V4 Plus devices have an exclusive audio transmission feature.
Audio is transmitted over an HDMI cable from the target host to PiKVM as if it were a regular monitor
with speakers, and then from PiKVM to a web browser in [WebRTC video mode](webrtc.md).
This brings the user experience of working with a remote host even closer to the local one.
2022-06-08 01:10:11 +00:00
2023-12-05 23:55:55 +00:00
!!! note
2022-06-28 00:36:47 +00:00
2023-12-05 23:55:55 +00:00
* This feature does not work with DIY devices, either CSI or USB video dongles.
2023-04-20 02:09:50 +00:00
2023-12-05 23:55:55 +00:00
* Reverse audio transmission, that is, from the browser towards PiKVM
(for example, to emulate a microphone) is not yet supported.
2022-06-08 01:10:11 +00:00
2023-12-05 23:55:55 +00:00
* [VNC](vnc.md) does not support audio, it only works in the Web UI.
-----
2022-06-08 01:10:11 +00:00
## Preparing
2022-06-28 00:36:47 +00:00
2023-12-05 23:55:55 +00:00
For PiKVM V4, this feature is enabled by default and no special preparations are required.
For PiKVM V3, this feature is disabled by default for historical reasons so as not to break
old user configurations that were created before audio support was added.
??? example "Enabling audio on PiKVM V3"
1. Make sure that you have not removed the [audio jumpers (4)](v3.md#io-ports-and-jumpers)
on the V3 HAT board and have not deleted or commented the `dtoverlay=tc358743-audio`
line in `/boot/config.txt`. Return everything as it was, if you changed it.
2024-04-11 15:57:02 +00:00
2. Update OS and reboot:
{!_update_os.md!}
3. Add the following lines to `/etc/kvmd/janus/janus.plugin.ustreamer.jcfg` if they missing:
2023-12-05 23:55:55 +00:00
```
audio: {
device = "hw:0,0"
tc358743 = "/dev/kvmd-video"
}
```
2024-04-11 15:57:02 +00:00
4. Enable the Basic Audio support in the [EDID](edid.md) in the `/etc/kvmd/tc358743-edid.hex`:
2023-12-05 23:55:55 +00:00
```console
2024-04-11 15:57:02 +00:00
[root@pikvm ~]# kvmd-edidconf --set-audio=yes
2023-12-05 23:55:55 +00:00
```
2024-04-11 15:57:02 +00:00
5. Reboot the device:
2023-12-05 23:55:55 +00:00
2024-04-11 15:57:02 +00:00
```console
[root@pikvm ~]# reboot
2023-12-05 23:55:55 +00:00
```
-----
## Usage
The target host determines whether it is possible to output audio via HDMI. Each OS does this in its own way.
* Mac OS usually understands the priority of HDMI for audio output on its own,
but you can specify this explicitly in the settings.
* Windows requires explicit specifying of the audio output device.
* In Linux, everything depends on the distribution you use. In ancient times, audio required performing
a ritual dance on a full moon. For now, a working Pipewire or Pulseaudio most likely be enough.
Just specify HDMI as the audio sink in the mixer.
In general, make sure that the audio output is output via HDMI.
PiKVM supports stereo mode with any standard bits and frequencies like 32/44.1/48 kHz with 16/24 bit.
To receive audio in the PiKVM Web UI, go to the **System** menu and switch the video mode to `H.264 / WebRTC`.
If everything is in order, the volume slider will appear. Set the volume to a non-zero value.
2024-02-15 08:59:44 +00:00
The video stream will restart and you should start hearing sounds from the target host.
2023-12-05 23:55:55 +00:00
<img src="menu.png" width="350"/>
!!! note
If the volume slider is set to zero, then PiKVM does not accept the audio stream to save traffic,
while the target host will still assume that the audio output to HDMI is available.
Besides, when the page is reloaded, the volume slider will be reset to zero.
Saving this setting is not possible due to browser limitation that do not allow web pages to play audio
immediately after opening without user activity to protect against annoying ads.
-----
## Troubleshooting
* If the browser does not play sound or does not show audio slider, try a different browser
and/or incognito mode without extensions. Google Chrome works best.
* Check the log: `journalctl -u kvmd-janus`.
2024-04-11 15:57:02 +00:00
* If nothing helped, please report about the problem [to our support](https://discord.gg/bpmXfz5)