Here is an excerpt from Chapter 12 of IRS Publication 535: https://www.irs.gov/pub/irs-pdf/p535.pdf
"Determining your qualified trades or businesses. Your qualified trades and businesses include your section 162 trades or businesses, other than trades or businesses conducted through a C corporation, W-2 wages earned as an employee, and specified service trades or businesses. In general, to be engaged in a trade or business, you must be involved in the activity with continuity and regularity and your primary purpose for engaging in the activity must be for income or profit. If you own an interest in a pass-through entity, the trade or business determination is made at that entity's level."
Typically, royalty income is not considered trade or business income.