2.1 systems generally use powered subs, not passive subs.
For use with higher-quality bookshelf speakers, you can send the stereo line level signal to a 2-channel amp and pass the high-level speaker lines through your sub. I do this with Belkin AirPlay 2 receivers and it works well.
Not all subs have high-level passthrough though.
I'm building my own subwoofer, so I'm assuming you mean the sub has a plate amplifier in the back? Like this:
https://www.daytonaudio.com/product/776/sa70-70w-subwoofer-p...
Unless maybe I set the sub as a second airplay or Bluetooth device and run one of these [1]? I’m not really sure how all of that works.
https://pimylifeup.com/raspberry-pi-airplay-receiver/