I have solved this in the meantime, although it might not be the optimal solution.
If anyone has ideas for improvement, feel free to post.
Anyway first off here's what I did:
- On a fresh install of Ubuntu 10.10
- install the newest NVidia driver from the NVidia homepage. This is done by creating a blacklist for all unwanted drivers first, removing the old drivers (anything with nvidia in name), stopping X server, then running the install skript. There are plenty of guides on this step out there, for example here: http://www.ubuntugeek.com/howto-inst...ucid-lynx.html
- figure out which card/device combination is giving out hdmi sound (described in the thread I linked in my first post)
- using this information, create a .asoundrc file in your home folder
pcm "hw:1,7" # Always use pure hw. dmix will reformat/resample audio.
period_size 512 # If you get stuttering/or non-working audio, fiddle around with these
rate 48000 # HDMI, I'll assume 48kHz
format S16_LE # Should be default for pretty much any soundcard.
pcm "hw:1,7" is where you put your working hdmi card/device combo. 1,7 for me.
Now to make it work I had to reboot again.
At this point hdmi output was only kind of working.
This would play the file over hdmi. Crystal clear sound, no problems.
All other applications I tested also gave out sound BUT it was in a really low quality. Sounded kind of like if you choose a very low sample rate in a voice com program.
But the sample rate was ok.
For example, when using mplayer to play an mkv file:
If I stated alsa as audio out (hw:1,7 being my hdmi device)
No problems, crystal clear sound.
mplayer -ao alsa:device=hw=1.7 some_file.mkv
Low quality, screechy sound.
Now mplayer gives out some information in the console while playing the file. It shows that in both cases, codecs, sample rate etc.. everything was exactly the same.
The only difference: the good quality stated alsa as sound output, while the bad one stated pulseaudio!
So: Somewhere in between alsa (where my sound was still perfect) and pulseaudio my soundstream got hit with a 1900s gramophone filter. Because every Ubuntu app accesses the sound over pulseaudio the sound was horrible all over the place.
I dont understand the whole mess with alsa<->pulseaudio, so I can't even begin to guess why and where that happens...
My solution and the final step:
- uninstall pulse audio
(maybe you shouldn't purge it, but I was a bit annoyed after 3 days of trying so..)
sudo apt-get remove --purge pulseaudio
With this, I have now audio working systemwide for me, I have set up XBMC on top of Ubuntu and it works there as well.
With dmix in my .asoundrc I can also play multiple sound files at once (I had no dmix first, but then one app would grab the audio device at some point, crash/close down ungracefully block it forever, leaving me without sound once again...).
There is one minor audio bug still, concerning XBMC:
If I choose to go into suspend mode (the save to RAM mode) from XBMC and then come back, I dont have sound within XBMC. I need to go back into Ubuntu and play a sound with some random app first. After this, my sound in XBMC is back.
This is really not important though, I just close down XBMC and use ubuntus suspend instead.