The phrase "Rock and Roll" can be heard referenced in the Hal Roach film "Asleep in the Feet" (1932), starring ZaSu Pitts and Thelma Todd. In 1935, Henry "Red" Allen recorded "Get Rhythm in Your Feet and Music in Your Soul" which included the lyric, "If satan starts to hound you, commence to rock and roll. Get rhythm in your feet..." etc. This lyric was written by the prolific Tin Pan Alley composer J. Russel Robinson with Bill Livingston. It's unlikely that they created the phrase for this application. It was presumably current with its musical meaning in popular culture at the time, at least in New York City. Allen's recording was a "race" record on the Vocalion label, but the catchy tune was quickly covered by white musicians, notably Benny Goodman, no doubt giving the term currency throughout the US by the end of 1935.
The word "rock" had a long history in many languages as a metaphor for "to shake up, to disturb or to incite". "Rocking" was a term used by black gospel singers in the American South to mean something akin to spiritual rapture. In 1916, the term "rocking and rolling" was used with a religious connotation, on the phonograph record "The Camp Meeting Jubilee" by an unnamed male "quartette". The verb "roll" was a medieval metaphor which meant "having sex". Writers for hundreds of years have used the phrases "They had a roll in the hay" or "I rolled her in the clover". The phrase "rocking and rolling" was secular black slang for dancing or sex by the early twentieth century, appearing on record for the first time in 1922 on Trixie Smith's "My Man Rocks Me With One Steady Roll", and as a double entendre, ostensibly referring to dancing, but with the subtextual meaning of sex, as in Roy Brown's "Good Rocking Tonight" (1948).
The terms were often used together ("rocking and rolling") to describe the motion of a ship at sea, for example as used in 1934 by the Boswell Sisters in their song "Rock and Roll", which was featured in the 1934 film Transatlantic Merry-Go-Round, and in Buddy Jones' "Rockin' Rollin' Mama" (1939). Country singer Tommy Scott was referring to the motion of a railroad train in the 1951 "Rockin and Rollin'". An alternative claim is that the origins of "rocking and rolling" can be traced back to steel driving men working on the railroads in the Reconstruction South. These men would sing hammer songs to keep the pace of their hammer swings. At the end of each line in a song, the men would swing their hammers down to drill a hole into the rock. The shakers — the men who held the steel spikes that the hammer men drilled — would "rock" the spike back and forth to clear rock or "roll", twisting the spike to improve the "bite" of the drill.
The phrase had been used with sexual implications in the lyrics of rhythm and blues records since at least the early 1930s, such as in Bob Robinson's "Rock and Rolling" (1939), Buddy Jones's "Rock and Rolling Mamma" (1939) and Joe Turner's "Cherry Red" (1939). Three different songs with the title "Rock and Roll" were recorded in the late 1940s; by Paul Bascomb in 1947, Wild Bill Moore in 1948, and by Doles Dickens in 1949. One such record where the phrase was repeated throughout the song was "Rock and Roll Blues", recorded in 1949 by Erline "Rock and Roll" Harris.