I think you'd want to ask two questions in order to determine whether royalties produce qualified business income and a Section 199A deduction.
Question 1: Is the activity producing royalties a trade or business?
First, you'd want to figure out whether a Section 162 trade or business activity creates the royalties. E.g., some of you know I wrote Quicken for Dummies and QuickBooks for Dummies. Those books produced royalties. Further, I think it's pretty clear those royalties stemmed from a trade or business. (My writing showed regularity, continuity and a profit motive... the requirements laid out in Groetzinger.)
But some people receiving royalties for something like writing a book don't have a trade or business... One might assume when a former U.S. president writes his memoirs that doesn't count as a trade or business. (President Eisenhower probably wasn't in the business of writing books, for example.)
Note: If royalties come from a trade or business, I think they should be reported on Schedule C and not on Schedule E...
Question #2: Is the writing or composing activity a "specified service trade or business?"
The second question would be whether someone's writing, due to their taxable income and the nature of the writing, counts as a specified service trade or business because the writing connects to a performance. The final regs summary says this on page 84, "To the extent that a writer is paid for written material, such as a song or screenplay, that is integral to the creation of the performing arts, the writer is performing services in the field of performing arts." That seems pretty clear.
E.g., if someone writes a novel and earns $1 million in royalties, the writer has qualified business income and potentially gets the Section 199A deduction. (A novel is not a performance.) If someone writes a movie script and earns $1 million, the writer doesn't have qualified business income.