PDA

View Full Version : Frustrating audio and video issues


vinfromuk
2009-02-04, 16:21
Apologies in advance from this Linux novice, but I've tried search and can't find a solution to this problem.

I've just put together a HTPC build specifically for running XBMC via Linux. Hardware:

- Antec Micro Fusion 350 HTPC case
- AMD Athlon X2 6000+ (3.1GHz)
- Asus M3N78-VM motherboard
- OCZ 2x1GB 800MHz dual channel memory
- Sony/NEC Optiarc 20x DVD+/-RW SATA rewriter

I followed the guide on the wiki for the install and ignoring issues with the LCD/remote (LCD confirmed faulty, needs an exchange) things are working pretty well.

My problem is this:

If I route the HDMI output into my receiver (Sony STR-DG910, if it matters) and on to my TV (Samsung 40R87, 1360x768 native res), I can't get a picture. I *think* this is because the receiver lies via EDID and says it can do 1080p, which the TV will *not* do, and so I can't negotiate a useable picture.

If I connect directly to the TV via HDMI, I get video at 1360x768 and stereo sound, but the TV won't passthrough 5.1 to the receiver.

I can't get any sound at all out of the SP/DIF for some reason. I've searched on here and via Google (lots of people having the same problem with MythTV it seems) and tried a few different things, largely fiddling with alsamixer, but no signal.

ronie
2009-02-05, 02:37
You should start be checking /var/log/Xorg.0.log to see why you can't get a picture, also the EDID values the receiver reports should be listed there.
If they are indeed incorrect i guess you should define a 'PrefferedMode' in xorg.conf and maybe add some custom Modelines too.

As far as the sound goes, it's hard to guess what's going wrong. On my PC i had to compile the latest Alsa from git to get sound over hdmi working. I'm not sure if you're trying to get this working too or if you're using a seperate connection (S/PDIF) for audio.

papaf
2009-02-05, 09:34
Try this: using read-edid, with the TV only connected, download the edid binary file to your PC. Then, connect the receiver and use this option in your xorg.conf:

Option "CustomEDID" "CRT-0:/path/to/your/edid/file"

This way, the X server will act like the TV edid was given to it, even if it's not, and should enable the correct resolution.

By the way: I wrote CRT-0 because I'm using a common VGA out, you might need something different for HDMI. Check your X logs to see how the output port is called.

rodercot
2009-02-05, 14:18
Does your sony try to upconvert the signal, My Denon rcvr does and I finally figured out how to turn that off. There should also be a menu item in your sony to tell it to only pass Video to the TV and then to decode the audio in your rcvr.

if you edit your /etc/modprobe.d/alsa-base file with the proper stack info you will likely be able to get hdmi video and spdif audio out of your pC with no problems, in fact if you hooked a rca jack up to the ext spdif pinouts on the board right now I would suspect it works.

The switch in the bios hdmi/spdif is only for the ext spdif on the mainboard and only tell the board if you are using an HDMI output on an ext video card or an spdif connector hooked to the mainboard pinouts instead and has nothing to do with the backplane optical connector.

you need to modify the alsa-base file as I stated above to get both hdmi and spdif (at the backplane) working with this board.

The first step if you have not is to upgrade Alsa to 1.0.19, you have to do this for your board. Then run alsamixer and unmute ALL the iec958 channels with "m" on your keyboard. Then set XBMC to

digital
dts on
dd on
default
iec958 for spdif, you can alsa try default here if iec958 does not seem to work.

or

digital
dts on
dd on
hdmi
hdmi for hdmi output.

you can then run this

cat /proc/asound/card0/codec#* | grep Codec

and write down what it returns, this will tell you the codec on your board.

now go here and match your codec with the stack file info.

http://pastebin.ca/1327935

Then edit your alsa-base file like

sudo vim /etc/modeprobe.d/alsa-base

and add to the bottom of that file

options snd_hda_intel=(whatever the stack info you matched up from the file) like 6stack-dig.

This will tell alsa that you have hdmi and a 6 stack audio output jacks WITH spdif as well and will stop the HD audio module from trying to auto probe the bios for info.

You should still be able to send your hdmi video signal through the rcvr is set to your panels native rez in xbmc and no upscaling turned on in the Sony.

Dave

sandos
2009-02-05, 15:39
OT: May I ask what cooler you used for that case?

vinfromuk
2009-02-07, 00:43
Thanks for the help guys.

I tried the EDID trick and it initially didn't work.

Then I sort of lucked into an answer - the TV has to be on, and the amp on the right input, before you switch the HTPC on, and it works! I don't know if it was just this all along, or if the EDID trick helped.

As far as coolers, I'm currently using all the stock fans, including the CPU cooler, which just about fits. Right now the fans are whisper quiet when you start HD playback, but the auto fan control kicks into overdrive about ten minutes in and it sounds like a jet taking off, so I'm gonna look into better cooling options as soon as possible. The case/LCD unit may be going back RMA though (you have to remove the LCD to put the HDD in, so I unclipped the unit as instructed, and the front part of the screen stayed in the case, so it's not working), so I'll wait for a resolution to that before anything else. I also can't make the remote work.

vinfromuk
2009-02-08, 15:27
New problem!

MP3 is too high pitched, either on video soundtracks or music files. Any ideas?

rodercot
2009-02-08, 15:57
I am still working on this as well. I still cannot get the pdif to show up in aplay -l or -L. It does show hdmi device and in the mixer.

This is an issue with the VT1708B Codec I am sure, I have tried all the codes in the link I supplied and I even tried some codes from the actual source code patch for the VIA codecs and not one of them will activate the SPDIF output as well as the spdif.

I tried creating an .asoundrc file and that did nothing as well.

This is ofcourse for the m3n78-vm board as well.

My next step is to install mybuntu on that machine which I was planning anyhow and then that will give me the newer kernel, but there are reports of this not working even in Jaunty with 2.6.28 (latest kernel)

It is reported on the bug sites for no digital out or no sound with VT1708B if you want to serach yourself. But I am sure the two things are related in some way.

Dave

vinfromuk
2009-02-08, 16:04
I think, from playing with it, that the MP3 problem is a sample rate issue - if my digital out / receiver in confuses 44.1KHz and 48KHz it would result in "squeaky voice" playback, right? No idea how I'd fix it though.

ronie
2009-02-08, 18:32
Sounds like your mp3's are in 44k1 and the receiver only accepts 48k audio.

There's a few things you could try, first check if your audio settings in XBMC are like this:
digital
dts on
dd on
default
iec958 (or "hdmi" if you're using hdmi)

Next create a .asoundrc file which contains:
pcm.dmixer {
type dmix
ipc_key 1024
ipc_key_add_uid false
ipc_perm 0660
slave {
pcm "hw:0,1"
rate 48000
channels 2
# format S32_LE
period_time 0
period_size 1024
buffer_time 0
buffer_size 4096
}
}

pcm.!default {
type plug
slave.pcm "dmixer"
}


This will resample all audio which is send to the default device to 48k.
(If you're using hdmi, change pcm "hw:0,1" to pcm "hw:0,3")

Another thing you could try is add this to advancedsettings.xml:
<audio>
<resample>48000</resample>
</audio>
as discussed in http://xbmc.org/forum/showthread.php?t=43938

vinfromuk
2009-02-09, 21:11
The .asoundrc method seems to be working, although I have problems with playback freezing on longer files (video with MP3 audio over an hour in length). It's not perfect, but it's much better - thanks for the help.

rodercot
2009-02-09, 23:57
I am still playing around with this M3N78-VM. I do think there is a fault with these boards from Asus and here is why.

Aplay - output -l or (-L) I have a VT1708B analog and hdmi (no VT1708B) digital which there SHOULD BE following editing the alsa-base file.

if I grep the codecs I get the VT1708B and MCP78 HDMI

if I do sudo lshw I get NO VT1708B codec but it lists a ALC1200.

I remember reading the bugs in Ubuntu and there was won that lost me as I was reading because the reports kept switching between a VT1708B and ALC1200 on this same bug and now I am starting to see why.

This is with the latest ASUS bios they have on there web-site which also disables the spdif/hdmi switch in the bios. I think that the bios is wrong for the board from the Asus site.

Still does not explain no access to the iec958 output with all the latest upgrades, patches and fixes. I tried Mythbuntu on this board as well and it is a nightmare, major suspend/resume issues etc.. I think I am off to pick up another P5N7A-VM asap.

Dave