12. From the given equation, we have
$$
\left(x^{2}+5\right)(2 x+1)=2 p^{n} \text {. }
$$

Obviously, $x^{2}+5>2 x+1$ (an odd number).
Combining with the problem, we know that $\frac{x^{2}+5}{2 x+1}$ is an integer, and
$$
\frac{x^{2}+5}{2 x+1}=\frac{1}{4}\left(2 x-1+\frac{21}{2 x+1}\right) \text {. }
$$

Thus, $x$ can take the values $1$, $3$, and $10$.
Verification yields $(x, n, p)=(1,2,3)$ or $(3,2,7)$.
Therefore, $x+n+p=6$ or 12.
12. Given that $x, n$ are positive integers, and $p$ is a prime number, satisfying
$$
2 x^{3}+x^{2}+10 x+5=2 p^{n} \text {. }
$$

Find all possible values of $x+n+p$.