I have the following issue with sound on my 2015 Macbook Pro (10.14.6). Every time I plugin my monitor on the Mini-Displayport port (using a MiniDP->HDMI dongle from Club3D), and I plug in my Logitech 2.1 system (old style Z5's) using the headphone jack, the speakers play a constant very high pitched sound. As soon as I unplug the Monitor from the MiniDP port, it goes away. The sound does not change its volume when adjusting volume on the speakers itself.
Any ideas if this issue could be solved within macOS settings?