The first and best solution is to increase the input gain which should be possible on most platforms. If not, then read on...
If multiplying by a constant caused distortion then either:
- it is too loud and distortion is inevitable (barring what I'll just call "fancy" signal processing)
- you are doing something wrong.
I'll assume #2 since you started with the case of "barely audible", and you should learn how to apply gain before doing anything "fancy" anyway. To apply gain, make sure you multiply each sample individually by the same constant. Remember that the sample count = frames * channels. Loop through each each sample in the buffer and multiply it by the gain.
For this case, you probably want to use the float datatype in PortAudio, but any type will work.