I've found that I can use pavucontrol to control the volume in my left and right speakers independently, by un-clicking the "lock channels together" button. However, I can't find a setting to let me send different output to the two speakers - i.e. I want to play audio track A on my left speaker and audio track B on my right speaker. How do I do this?
sox(Sound eXchange); if you have two files with similar bitrates or already set to one channel:
play -M A.mp3 B.mp3
play -m "|sox A.mp3 -p remix 0 1-2" "|sox B.mp3 -p remix 1-2 0"
What this does is simply
play the output of two
sox commands which output to pipe(
-p); the first one remixes L/R to R and the second remixes L/R to L. If you're playing sources with different gain values etc. you may need to adjust the two
sox commands(gain etc.).
So, I found a solution. Turns out that if I run the media via two separate processes (i.e. "play a.mp3 &; play b.mp3") then pavucontrol will allow my to control their volume separately. I can unlock the channels, set one to 0% left, the other to 0% right, and this will work.
However, I feel like this doesn't quite answer the question - it works for my use case, but I'm not sure it will be useful to future people who come here with a similar question, who are most likely looking for a way to do it without going through the pavucontrol gui. Something that I would appreciate knowing how to do (if possible) as well.
So, I'll leave this open for more answers, and only mark this one correct if I get upvotes to indicate that other people find it helpful (or no other answers).