Perfect, in 10 minutes I solved all the problems.
I deleted data.img, I reinstalled Android with rw permissions and I increase the memory to 10 GB.
I followed Hernaaan's guide to hdmi with my values.
Su
# vi /system/etc/init.sh
Add these lines to the "function init_hal_audio ()" section, right below
esac
alsa_amixer -c0 set 'IEC958', 0 on
alsa_amixer -c0 set 'IEC958', 1 on
alsa_amixer -c0 set 'IEC958', 2 on
alsa_amixer -c0 set 'IEC958', 3 on
mv / dev / snd / pcmC0D10p /dev/snd/pcmC0D10p.original
ln -sf / dev / snd / pcmC0D7p / dev / snd / pcmC0D10p
now everything works perfectly.
Thank you.