I spawn a process in Python with the following code (just the relevant code):
_LAUNCH_CMD = '/usr/bin/omxplayer -s --vol %s %s %s'
cmd = self._LAUNCH_CMD % (volume, args, file)
self._process = pexpect.spawn(cmd, timeout=5)
os.system("kill -9 %s" % (self._process.pid + 10))
/usr/bin/omxplayer is a wrapper that executes
omxplayer.bin, which gets assigned a new PID. If you execute
omxplayer.bin directly, you'll avoid the issue at hand, but you'll need to do the work
/usr/bin/omxplayer is doing before launching the real binary. PIDs are random, so you can't bet that it will always be a difference of 10 in the PIDs.