We consider the hypothesis that dark energy and dark matter are the two faces of a single dark component , a unified dark matter ( UDM ) that we assume can be modeled by the affine equation of state ( EoS ) P = p _ { 0 } + \alpha \rho , resulting in an effective cosmological constant \rho _ { \Lambda } = - p _ { 0 } / ( 1 + \alpha ) . The affine EoS arises from the simple assumption that the speed of sound is constant ; it may be seen as an approximation to an unknown barotropic EoS P = P ( \rho ) , and may as well represent the tracking solution for the dynamics of a scalar field with appropriate potential . Furthermore , in principle the affine EoS allows the UDM to be phantom . We constrain the parameters of the model , \alpha and \Omega _ { \Lambda } , using data from a suite of different cosmological observations , and perform a comparison with the standard \Lambda CDM model , containing both cold dark matter and a cosmological constant . First considering a flat cosmology , we find that the UDM model with affine EoS fits the joint observations very well , better than \Lambda CDM , with best fit values \alpha = 0.01 \pm 0.02 and \Omega _ { \Lambda } = 0.70 \pm 0.04 ( 95 % confidence intervals ) . The standard model ( best fit \Omega _ { \Lambda } = 0.71 \pm 0.04 ) , having one less parameter , is preferred by a Bayesian model comparison . However , the affine EoS is at least as good as the standard model if a flat curvature is not assumed as a prior for \Lambda CDM . For the latter , the best fit values are \Omega _ { K } = -0.02 ^ { +0.01 } _ { -0.02 } and \Omega _ { \Lambda } = 0.71 \pm 0.04 , i.e . a closed model is preferred . A phantom UDM with affine EoS is ruled out well beyond 3 \sigma .