A couple of points to consider, about the police....
Police officers are fairly well versed in those laws that they are most likely to encounter, not in all law and directives of their depts. It is quite likely that the officers in this case may have been exposed to the Directive in question, in a required reading, or some training class, but did not retain the information, as it seldom comes up in their day to day lives. That's a human thing, and not something we can find great fault with.
However, the performance of the officer(s) in this case leaves much to be desired, and possibly violates their writtern code of conduct. That is something a review board would have to determine.
We ordinarily think that there would be no call for the officers to prone the guy out, using profanity laced commands. However, we have the benefit of knowing (after the fact) that the man with the gun is no threat, and within his legal rights. They don't.
Remember the vast majority of the time, the people these cops deal with day in, day out are not law abiding polite citizens. Many do not take command seriously unless they are laced with expletives, in their own language, so to speak. Trained to control he situation, officers react poorly (by our standards) to anything other than complete and instant compliance. But this is because officers have been killed and injured by people who feign cooperation in order to get the cop to let their guard down. It may not happen often, but it has, and does happen.
Cops are taught, both in training, and from street experience that in situations where there is clearly a danger (gun in sight) that a polite "graded approach" jeapordizes their own, as well as public safety. As soon as there is ANY non compliance, their response goes from where ever it was, to full blown. They have learned through bitter experience that anything less endagers lives.
The "underside" of all of our major metro areas (and more than a ffew of our smaller ones as well) are dangerous places, and acting like the friendly deputy in Mayberry risks officer safety in a serious manner.
Do I condone the specifc actions of the police in this instance? No. Do I think they went beyond proper professional conduct? Yes, I do. But I also understand why they behave that way, especially in a major city with gang and drug problems. All the cops know is that there is a man with a gun, who is arguing with them. Period. So they revert to what they know works best, firm domination of the situation, without regard to the feelings (and what we would consider the basic rights) of the individual.
IS this attitude on the part of the police a result of the "war on drugs"? Probably. The militarization of our community police certainly is. SWAT teams, and similar approachs to serving warrants and many other things that used to be done by plainclothes or regular uniformed officers is a good example of that. And Philidelphia polcie do not have a very good record, historically, and institutionally of being moderate and reasonable when their authority is challenged.
As to charging the fellow, AFTER he released the audio recordings, I find that more than a bit vindictive in appearance, if not in fact. How dare he make the cops look bad, after they were nice enough not to arrest him for legal behavior?