"In my great trouble"
David is referring to the heavenly temple where Yahweh dwells. The earthly temple has not yet been built.
David speaks of Yahweh as if he had ears.