For round earphones, see here
Husband’s earphones were larger and oval, so I did it a bit differently. Also, the wire came off the bottom edge rather than the back.
General: All stitches are dc, between stitches on previous round. 1st dc in round is ch3. To finish round, slst in 3rd ch.
R1: Dc18 on a loop and tighten tail. (A bit harder to start, but not as tight as ch6 ring.)
R2: Dc1, dc1, dc2.
R3: Dc1. After a few stitches, hold in place over earphone, and hold the wire in place so it will come out between stitches.
Cut yarn. Weave loosely through final round. Pull tight over the earphone.
Sew in ends, etc.