You are not logged in.

#1 2022-04-29 14:54:59

ramcourse
Member
Registered: 2021-05-23
Posts: 13

2 different signals to 2 different sound outputs

I'd like love to pipe kids tunes to my laptop speakers, while simultaneously pumping white noise into my headphones. It seems to me that this should be achievable, but I haven't found how. Can anyone point me toward the way to do this?

Offline

#2 2022-04-29 16:06:43

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 27,100
Website

Re: 2 different signals to 2 different sound outputs

This depends a bit on the hardware - are the speakers and headphone jack on the same audio device?  If so, I doubt this would be possible (e.g., there is nothing that can be done in software if the headphone jack essentially just short circuits the line to the speakers).  If they are different devices, however, this is very doable, but takes some configuration.  Unfortunately, in most cases, the built in speakers and built in jack on a laptop would use the same audio device.

To confirm, the output of `aplay -lL` would be good.

But even if these are both on the same audio device, a cheap peripheral (e.g., usb) sound card would do the trick.

Last edited by Trilby (2022-04-29 16:07:31)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2022-04-29 16:18:56

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 18,649

Re: 2 different signals to 2 different sound outputs

Pulseaudio supports that.  Other sound tools will too, I am sure jack does.    Ultimately, you will want to automate it, but to play with it, use a tool such as pavucontol.  Launch a sound source for the music and it may play to the speakers.  If not, go to the playback tab of pavucontrol, find the playback source, and change it to speakers.  Set up another sound source so it also plays.  It may play on the speakers.  If not, find that source in pavucontrol  and change it to headphones.

I just checked all this and have the Cranberries on my Bluetooth speaker and Greenday on my laptop's internal speakers.

I am not an audiologist, but I would be cautious about long term exposure to broad band noise -- certainly if it is at elevated levels.

Edit: Trilby and I were posting at the same time.  He is correct, if it is the same source that is being routed to one of two outputs via a switch what I propose will not work.  In my case BT and analog audio are separate.  Analog and HDMI will also be separate.  I honestly do not know if this laptop has separate analog codecs for the headphone jack and internal speakers or not.

Last edited by ewaller (2022-04-29 16:22:34)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Online

#4 2022-04-29 16:42:06

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 27,100
Website

Re: 2 different signals to 2 different sound outputs

If they are separate devices / channels, then alsa can do this quite well itself.  If one likes the bells and whistles that pulseaudio adds, go for it, but it is certainly not necessary for sending different audio to different outputs.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2022-05-05 16:11:00

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 16,719

Re: 2 different signals to 2 different sound outputs

FWIW on many HDA cards where the concern regarding HP short circuiting the speakers will indeed be the normally configured default you can often reconfigure their jack behavior with hdajackretask or codec hints to actually split them into distinct devices: https://www.kernel.org/doc/html/latest/ … nt-strings

Offline

Board footer

Powered by FluxBB