Dynamic metasurface antennas (DMAs) are an alternative application of metasurfaces as active reconfigurable antennas with advanced analog signal processing and beamforming capabilities, which have been proposed to replace conventional antenna arrays for next generation transceivers. Motivated by this, we investigate the bit error probability (BEP) optimization in a DMA-based system, propose an iterative optimization algorithm, which adjusts the transmit precoder and the weights of the DMA elements, prove its convergence and derive complexity.