I've read that the Emperor wanted to surrender even before the atomic bombs and the USSR entering the war, but could not do so without approval from the military. But I've also read that the Japanese constitution at the time gave the Emperor sole authority to declare war and make peace, and also authority over the military.
I have written here about the process that increasingly marginalized the Emperor and the civilian government during the 1930s.
With that as context, the contradiction you are describing starts to fit into the big picture a bit more. Technically, you are right, and the Emperor held sole supreme authority to make war and peace. Technically, he could give orders and expect to see them obeyed. However, his various efforts over the preceding decades to bring the army and navy to heel had simply been snuffed out with violence. By the time war broke out, he was quite reasonably in fear of a military coup that would seize control of the Imperial palace and issue proclamations in the Emperor's name, but without the Emperor's consent. This sort of arrangement for governing was perfectly in line with practices that were normal during much of Japan's history. And, in point of fact, when the Emperor finally did give the order to accept the allied Potsdam declaration, just such a coup was, in fact, attempted, and even succeeded in seizing and holding the palace grounds (but not, importantly, the Emperor himself, nor the recording he had made of his surrender declaration) before it was ultimately suppressed.
I think there is also a bit of an oversimplification in your question. I don't think the Emperor wanted to surrender, in the sense of submitting to the allied demand for unconditional surrender as expressed in the Casablanca and (eventually) Potsdam declarations. Rather, the Emperor became, over time, more and more friendly to the idea of a negotiated peace which would, perhaps, leave Japan in possession of certain colonial possessions and some part of her Navy and Army. There was a consistent but somewhat quixotic belief that Russia might be willing to mediate such an agreement with the allies, which was a pipe dream from the start and which was shattered for good when the overwhelming Soviet juggernaut forged in the war was unleashed on Japanese Manchuria on August 9, 1945.
No source I've ever seen has given compelling evidence that the Emperor was even a little bit in favor of actually surrendering (in the sense of what ultimately happened, with Japan submitting to complete disarmament and full military occupation) until after the atomic bombings.