Background
Federal regulation1 only prohibits any third-party overhearing, monitoring and/or recording of communications carried out in subjectively held and objectively reasonable expectation of privacy, that is, in confidence. (See, for e.g., Air Transport Ass'n v. P.U.C. of State of Cal. (9th Cir.1987) 833 F.2d 200, 201)2 This means that any party may on their own cognizance record a conversation they are a party to without the knowledge or consent of any other party or parties to the communication.
States laws passed establishing legal frameworks of states which are colloquially referred to as "all-party consent" states, and prohibiting that the mere intentional recording of less than all parties without the knowledge of all the parties be sufficient for the recording to be lawful.
There are several issues with this reference. Typically, consent—other than in cases where consent is given ahead of time for the entire course of relationships or of a substantial part thereof, for e.g. in employment or contractor relationships—is not the real crux of the inquiry of legality of the recording. Knowledge is—real or imputed based on reasonability. It is because "a conversation is confidential if a party to that conversation has an objectively reasonable expectation that the conversation is not being overheard or recorded. (Frio v. Superior Court (1988) 203 Cal.App.3d 1480 []; Coulter v. Bank of America (1994) 28 Cal.App.4th 923.)” (Flanagan v. Flanagan (2002) 27 Cal.4th 766, 768) (bold type added)
In other words, merely believing without foundation the fact finder (the jury in most cases) will find reasonable based on the facts of the circumstances to be reasonable that one believed the communication was conducted in confidence is insufficient to establish the protections of, in the above examples, of California criminal-code protections under Penal Code § 632, et seq., for the communication be criminally prohibited from being recorded by anyone.
Accordingly, merely announcing to one that a communication is not confidential raises a hardly rebuttable presumption that a potential complainant's complaint is moot. (This is the reason why signs on walls of recording are typically sufficient provided they are reasonably placed to give reasonable notice and rebut an objectively reasonable assumption of privacy and confidentiality)
These laws, to my knowledge, have not been tested by the U.S. Supreme Court for their constitutionality neither under the Supremacy Clause nor under the Due Process Clause.
A legal argument may be made on the analogous decision in "Pennsylvania v. Nelson, 350 U.S. 497 (1956) [where] the Supreme Court, [under Article VI, Clause 2 of the U.S. Constitution (the Supremacy Clause)] struck down the Pennsylvania Sedition Act, which made advocating the forceful overthrow of the federal government a crime under Pennsylvania state law. The Supreme Court held that when federal interest in an area of law is sufficiently dominant, federal law must be assumed to preclude enforcement of state laws on the same subject; and a state law is not to be declared a help when state law goes farther than Congress has seen fit to go."
Accordingly, even if the intention behind such a statute may appear as though complementing and giving greater force of a federal statute that does not necessarily bring the matter outside of the scope of the Supremacy Clause, and the Supreme Court may very well find that the federal legislation it said what it meant and meant what it said drawing precisely the line where it did to protect the rights of members of the public to record conversations they are parties to. There is a non-remote possibility that these laws could be struck down.
In other words, the legality of all-party consent regulations may very well be unconstitutional.
An other untested argument can be formulated around the Second Amendment was construed to "protect[] an individual['s] right to possess a firearm unconnected with service in a militia, and to use that arm for traditionally lawful purposes, such as self-defense within the home[]” (District of Columbia et al. v. Heller, 554 U.S. 570 (2008)). As other Constitutional provisions required the Supreme Court to assert thatthe gravest, and still legal punishment in the United States being the capital punishment, permitting one to protect themselves with a gun with the substantial probability of resulting in the demise of another, and not to protect themselves with, for e.g., a hand-held or wall-mounted camera to preempt an attack to protect themselves would result in the absurd construction which the framers could not have intended. Accordingly, using an audio-and-video recording camera may very well be found to be "fire arm" for the purposes of the Second Amendment the intention of which, as construed by SCOTUS, is to provide means to the public to protect themselves from violence.3
Hypothetical
"For example, suppose I have a security system that has cameras and also microphones located in an all-party consent state, such as Massachusetts. Now, suppose burglars break into my house and rob it. The security system records both video from the burglary and also the conversation, noises and utterances made by the burglars."
Considering the requirement of objective reasonability of the expectation of confidentiality, unless the robbers where hiding out and ensuring with such certainty that a reasonable fact finder (the jury or the judge) would find well-founded that they believed no one would overhear them in a house presumptively including multiple rooms not all of which visible from a street to have anyone inside sleeping, or just relaxing and potentially having the opportunity to overhear any communication they would make while inside.
Absent such expectation, they simply couldn't make an argument to be protected from being recorded notwithstanding any other reasons some generally outlined above.
Additionally, states, like California in Penal Code, Section 633.5, "[n]o prohibition of one party recording confidential communication relating to commission of certain crimes", exempts the prohibition in case of "the commission of certain crimes". Section 633.5 reads:
"Sections 631, 632, 632.5, 632.6, and 632.7 do not prohibit one party to a confidential communication from recording the communication for the purpose of obtaining evidence reasonably believed to relate to the commission by another party to the communication of the crime of extortion, kidnapping, bribery, any felony involving violence against the person, including, but not limited to, human trafficking, as defined in Section 236.1, or a violation of Section 653m, or domestic violence as defined in Section 13700. Sections 631, 632, 632.5, 632.6, and 632.7 do not render any evidence so obtained inadmissible in a prosecution for extortion, kidnapping, bribery, any felony involving violence against the person, including, but not limited to, human trafficking, as defined in Section 236.1, a violation of Section 653m, or domestic violence as defined in Section 13700, or any crime in connection therewith." (Cal. Pen. Code § 633.5)
Since the enumerated examples are "inclus[ive], but not limit[ing]", unless case law decides otherwise before the occurrence of the recording, for the sake of the argument, a § 632 violative recording of a felony not listed here, a lenity argument should overcome the "beyond-reasonable doubt" requirement for one to be found guilty provided the recorded can even assert any cognizable and justifiable damages connected to the recording, another requisite for both damages under § 632, et seq., or CIPA (California Invations of Privacy Act) which is doubtful as a robber would likely be found to have assumed the risk as being found, caught or otherwise prosecuted is within the scope of risk of trying to rob a house.
However, even if these arguments all failed, one would still have sufficient ammunition in the Second-Amendment argument (see above), and potentially a Due Process argument.
Although I am not aware of the full list of specific exemption provided for by statute or case law in Massachusetts, it appears that Massachusetts is more liberal in terms of permitting recording, for example, Mass. Gen. Ann. Laws ch. 272, § 99(C)(1) provides for exemptions that "telephone equipment, which is furnished to a phone company subscriber and used in the ordinary course of business, as well as office intercommunication systems used in the ordinary course of business, is excluded from the definition of unlawful interception devices", an exemption that does not exist in California, in fact, are explicitly excluded. (See, of e.g., Kight v. Cashcall, Inc. (2012) 200 Cal.App.4th 1377, 1394 ["CIPA regulations generally prohibit monitoring by businesses unless notice is given to the parties to the conversation (by beep-tones or a monitoring announcement) or the parties' consent is obtained.”]
Based on Massachusetts recognizing a business's interest to record communications without giving notice to all parties of the fact any communication may be overheard by any non-party or recorded, it would need quite a stretch of imagination how the interest to the safety of one's home would not be given, if not otherwise, by judicial decision, similar exemptive protection without regard to any other matters of fact or law discussed above.
Conclusion
Overall, it would be absurd if during breaking and entering a robber could cause the state prosecution to prosecute let alone the judiciary to actually convict or otherwise reprimand the homeowner and recorder not only for the average layman onlooker, but for any lawyer from a very much legally analytical perspective for any one or more of the reasons above, and being found to have broken the law is extremely unlikely.
Footnotes
1 18 USC § 2511(2)(d), Electronic Communications Privacy Act: “[i]t shall not be unlawful under this chapter for a person not acting under color of law to intercept a wire, oral, or electronic communication where such person is a party to the communication or where one of the parties to the communication has given prior consent to such interception unless such communication is intercepted to commit any criminal or tortious act in violation of the Constitution or laws of the U.S. or of any State.”
2 “A person wishing to listen in on a conversation without violating the regulation can provide notice by using a beep-tone warning device audible to all parties to the conversation or by announcing to the parties that the conversation is being monitored" which implies that the federal regulation does not prohibit even a third-party from eardropping without consent per se so long as the objectively reasonable expectation of privacy of the parties to the communication is rebutted by any means, including an announcement or 1400 Hz, sine-wave, beep-tone warnings every 15 seconds.
3 This may be an even harder argument to beat if one can establish to be a conscientious objector as such, the only means to exercise the implied right to protect oneself under the Second Amendment is only possible by means lacking the inherent capacity to cause physical harm; in other words, a recording camera may be the only type of "fire arm" such person may use, and upholding the legality of a criminal conviction of such recording would include the potential violation of yet another Constitutional right of one under the First Amendment to the U.S. Constitution.