XBMC Community Forum
[LINUX] HOW-TO install XBMC for Linux on Ubuntu 8.04 (Hardy) and 8.10 (Intrepid) - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Announcements, Info, and General Discussion (/forumdisplay.php?fid=85)
+--- Forum: Tips, tricks, and step by step guides (/forumdisplay.php?fid=110)
+--- Thread: [LINUX] HOW-TO install XBMC for Linux on Ubuntu 8.04 (Hardy) and 8.10 (Intrepid) (/showthread.php?tid=44019)



- olympia - 2009-03-18 20:31

ashlar Wrote:I might have misunderstood the wiki entry, but I gather that the tutorial gives indication for digital audio out only, no analog.

For the Smoothvideo branch to work correctly, analog out is most important. That's what I mean. If you are familiar with Reclock, under Windows, you might understand it better.

I am not a pro on this field, so please explain me how analog out comes to the most important place concerning smoothvideo. When I tried last time, was OK with spdif.


- olympia - 2009-03-18 20:38

sensei73 Wrote:Thanks Olympia, my setup is up and running thanks to your guide! I just want to help also with the cpu temp, i have a dual-core cpu and the way you grep the temp is not correct here is the real way to do it:

<cputempcommand>echo "$(sensors | grep "Core 0" | sed -e 's/[a-z]*..............\([0-9].\)\..*/\1/') C"</cputempcommand>

at least for dual core!

thanks again

Yeah, I use exactly the same command, just forgot to update the guide with that. (http://forum.xbmc.org/showpost.php?p=286693&postcount=56)
Anyway it also can differ mobo by mobo. But this version might be more common today.

Thanks!


- ashlar - 2009-03-19 01:02

olympia Wrote:I am not a pro on this field, so please explain me how analog out comes to the most important place concerning smoothvideo. When I tried last time, was OK with spdif.
Are you aware that there is a Smoothvideo branch being worked on? It's based on the same principles of the Reclock sound renderer under Windows.
It resamples sound so as to keep everything in synch, correcting the minor differences that happen among the system clock, graphic card clock, soundcard clock, etc.

Also, it's capable of slowing down 25fps accelerated material back to its original 24fps (this is a problem in PAL territories).

It can perform the first function with SPDIF if the refresh rate it's really close to optimal, otherwise it has to drop packets and that can be bad. It can't perform the second function with SPDIF, as packets dropped would be unacceptable.

Read here http://forum.xbmc.org/showthread.php?tid=46091


- bobb0 - 2009-03-19 02:49

Hey Olympia,

Another modification... this time to the sound configuration.
I followed your setup instructions and successfully used the hdmi device as provided by ALSA. However I soon found a problem that (I'm kind of assuming) is probably affecting a lot of other people....

Whenever I play music (which is naturally 44.1kHz) it was playing at 48kHz. Sacre bleu! Suffice to say it sounded like the singers were on low hits of helium Tongue

Investigation into my on-board sound (MCP78S in case you're wondering) reveals 2 codecs:

codec#0:Codec: Realtek ALC883
codec#3:Codec: Nvidia MCP78 HDMI

codec#0 is the "normal" codec used by the system for analog and iec958
codec#3 is for HDMI Audio (which is my point of interest)

when I cat /proc/asound/card0/codec#3 I see that 44.1kHz is not a supported samplerate for the HDMI Audio codec:

PCM:
rates [0xc0]: 48000 88200
bits [0xf]: 8 16 20 24
formats [0x1]: PCM

indeed this is confirmed by the helium voices and /var/tmp/xbmc-xbmc.log

19:24:42 T:3052422976 M:156991488 DEBUG: CALSADirectSound::CALSADirectSound - Channels: 2 - SampleRate: 44100 - SampleBit: 16 - Resample false - Codec - IsMusic true - IsPassthrough false - audioDevice: hdmi
19:24:42 T:3052422976 M:160346112 DEBUG: Initialize - using alsa device hdmi
19:24:42 T:3052422976 M:160346112 DEBUG: CALSADirectSound::Initialize - packet size:2048, packet count:16, buffer size:8192
19:24:42 T:3052422976 M:160346112 WARNING: CALSADirectSound::CALSADirectSound - requested samplerate (44100) not supported by hardware, using 48000 instead

So it seems that 3 things are not happening here. XBMC is not resampling, ALSA is not resampling and the HW itself is not resampling. Ugh.

I looked around and found docs on how to create a virtual device and use libsamplerate to resample the audio, but for reasons beyond logic I just didn't really like that solution. I decided instead to slave the hdmi (codec#3) off the realtek (codec#0)

I added the following to my /etc/asound.conf

Code:
pcm.!default {
    type plug
    slave {
        pcm "hdmi"
    }
}

In "Settings > Audio hardware" I have chosen the following options:
Audio output: Analog
Audio output device: default
Downmix multichannel to stereo: enabled

If people have the following setup:
PC[HDMI] --> RECEIVER[HDMI] --> TV
then I assume the following would work:
Audio output: Digital
AC3 passthrough: Enabled
DTS passthrough: Enabled
Audio output device: default (remember, it's slaved)
Passthrough output device: hdmi
Downmix multichannel: Disabled

What I've found is that if I do not enable the downmix multichannel option, when I play movies with 5.1 soundtracks, I get no audio over HDMI. This is because when I choose "default" as the device, XBMC will choose "surround51" as the output device for multichannel soundtracks. This could probably be fixed by modifying surround51 and slaving hdmi off that too, but since I am going from PC --> TV, I have no need for multichannel audio anyway.

Another benefit (if you can call it that) is that you will be able to hear the menu/navigation sounds again.

My tests have confirmed that 44.1kHz music files are now being properly resampled instead of played in helium mode, and movies are still playing properly. The only thing I'm not sure is, what is actually doing the resampling? My *hope* is that it is the audio hardware, but for all I know it could be ALSA. Either way, it works and navigation sounds are back!

Edit: adding a pcm.!surround51 section to /etc/asound.conf and slaving hdmi also works, however some additional work needs to be done to get alsa to remap/downmix the channels to 2 speakers. easier to just have xbmc do it, though it could be useful if you have a receiver setup and need/can support multichannel pcm (i don't think any receivers support that though, do they?)


- bobo1on1 - 2009-03-19 04:09

ashlar Wrote:Are you aware that there is a Smoothvideo branch being worked on? It's based on the same principles of the Reclock sound renderer under Windows.
It resamples sound so as to keep everything in synch, correcting the minor differences that happen among the system clock, graphic card clock, soundcard clock, etc.

Also, it's capable of slowing down 25fps accelerated material back to its original 24fps (this is a problem in PAL territories).

It can perform the first function with SPDIF if the refresh rate it's really close to optimal, otherwise it has to drop packets and that can be bad. It can't perform the second function with SPDIF, as packets dropped would be unacceptable.

Read here http://forum.xbmc.org/showthread.php?tid=46091
Spdif is not the problem, the problem is you can't resample and have ac3/dts passthrough.
Pcm over spdif can still be resampled, it just limits you to 2 channel sound.


- SwedishGojira - 2009-03-19 07:31

olympia Wrote:Changelog:
17/03/2009
- Changed autostart method to start from init.d. Thanks to bobb0 and Luigi

How would one go about changing the startup to this if I've already used the old method?


- olympia - 2009-03-19 08:16

ashlar Wrote:Are you aware that there is a Smoothvideo branch being worked on?

It can perform the first function with SPDIF if the refresh rate it's really close to optimal, otherwise it has to drop packets and that can be bad. It can't perform the second function with SPDIF, as packets dropped would be unacceptable.

Read here http://forum.xbmc.org/showthread.php?tid=46091

bobo1on1 Wrote:Spdif is not the problem, the problem is you can't resample and have ac3/dts passthrough.
Pcm over spdif can still be resampled, it just limits you to 2 channel sound.

Yes, I am aware (I mentioned I tried), but still didn't catch the point about analog out yet.
I cannot imagine that anyone willing to use the mobo's analog out in a decent htpc setup.


- olympia - 2009-03-19 09:01

SwedishGojira Wrote:How would one go about changing the startup to this if I've already used the old method?

cd $home
rm .bash_profile
rm .xsession
sudo nano /etc/event.d/tty2
change it to
Code:
respawn

exec /sbin/getty 38400 tty2

Then follow the steps from the guide.


- SwedishGojira - 2009-03-19 09:46

olympia Wrote:cd $home
rm .bash_profile
rm .xsession
sudo nano /etc/event.d/tty2
change it to
Code:
respawn

exec /sbin/getty 38400 tty2

Then follow the steps from the guide.

I've added lines to .xsession for starting drivers for my Xbox 360-pads.
If I leave them and remove all other lines in the file it should still load things correctly if I follow the guide, right?


- olympia - 2009-03-19 10:27

SwedishGojira Wrote:I've added lines to .xsession for starting drivers for my Xbox 360-pads.
If I leave them and remove all other lines in the file it should still load things correctly if I follow the guide, right?

No, in this case you have to tweak runXBMC.sh