compute the device id from a frame