Author Topic: SOLVED - SPDIF Passthrough sound skipping/stuttering - Is it just me?  (Read 10623 times)

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Hello,

I use a MSI Media Live box which uses an onboard HD Nvidia sound card with a Realtek ALC883 chipset. This is being handled under linux with teh snd-hda-intel driver.

I am very surprised that I don't find any mention of my problem in the board or wiki (unless I searched incorrectly) since many people seem to use this Media Live box which is highly recommended in the wiki. The problem is the following:
In the AW Wizard, I get proper DTS and AC3 in SPDIF Passthrough and everything is fine. But when trying to watch videos in LMCE (which uses the xine library) I randomly get files where the sound will break in and out constantly when using SPDIF out and digital audio (DTS or AC3). When I disable "passthrough" and watch the same files with PCM over SPDIF, it works just fine. The moment I try digitally encoded sound, the sound stutters.
I do have files however with digital sound (for example DTS) that played flawlessly.

The same problem occurs when playing the files with either Xine/Kaffeine or Mplayer under KDE.
I tried upgrading the alsa libraries and driver to the latest version 1.0.17. That didn't help.

I also tried countless recommended changes in xine.conf, asound.conf, muting unmuting etc, also with no luck.

One user recommends recuding the memory allocated to the Nvidia graphic card, but if I do that, the UI with alpha-blending gets very slow. I have NOT yet tried downgrading to overlay. MythTV seems to pass PCM over SPDIF at the moment, so I didn't see if the problem occurs there as well.

Is there someone out there running Digital sound over SPDIF with a media live? Did it just work out of the box or is there something I need to do? I'm not sure what else I could try at this point except buying a different sound card :-(

Thank you!

Jean
« Last Edit: February 19, 2009, 08:09:18 am by jeangot »

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Re: SPDIF Passthrough sound skipping/stuttering - Is it just me?
« Reply #1 on: July 23, 2008, 07:00:54 pm »
If I switch to UI2 with overlay, I have the same problem, but if I use UI1, the sound is just fine!?! Now I'm even more confused because it could be caused by LMCE and not be a Linux problem?

totallymaxed

  • LinuxMCE God
  • ****
  • Posts: 4660
  • Smart Home Consulting
    • View Profile
    • Dianemo - at home with technology
Re: SPDIF Passthrough sound skipping/stuttering - Is it just me?
« Reply #2 on: July 23, 2008, 07:11:59 pm »
Hello,

I use a MSI Media Live box which uses an onboard HD Nvidia sound card with a Realtek ALC883 chipset. This is being handled under linux with teh snd-hda-intel driver.

I am very surprised that I don't find any mention of my problem in the board or wiki (unless I searched incorrectly) since many people seem to use this Media Live box which is highly recommended in the wiki. The problem is the following:
In the AW Wizard, I get proper DTS and AC3 in SPDIF Passthrough and everything is fine. But when trying to watch videos in LMCE (which uses the xine library) I randomly get files where the sound will break in and out constantly when using SPDIF out and digital audio (DTS or AC3). When I disable "passthrough" and watch the same files with PCM over SPDIF, it works just fine. The moment I try digitally encoded sound, the sound stutters.
I do have files however with digital sound (for example DTS) that played flawlessly.

The same problem occurs when playing the files with either Xine/Kaffeine or Mplayer under KDE.
I tried upgrading the alsa libraries and driver to the latest version 1.0.17. That didn't help.

I also tried countless recommended changes in xine.conf, asound.conf, muting unmuting etc, also with no luck.

One user recommends recuding the memory allocated to the Nvidia graphic card, but if I do that, the UI with alpha-blending gets very slow. I have NOT yet tried downgrading to overlay. MythTV seems to pass PCM over SPDIF at the moment, so I didn't see if the problem occurs there as well.

Is there someone out there running Digital sound over SPDIF with a media live? Did it just work out of the box or is there something I need to do? I'm not sure what else I could try at this point except buying a different sound card :-(

Thank you!

Jean

Hmmm... well the only thing we do when we ship an MSI Media Live based MD, we call them NC100'sm, is we turn off the analog audio in the Bios if the unit will be connected to a surround amplifier. Apart from that we do NO special config to make SPDIF work.

All the best

Andrew
Andy Herron,
CHT Ltd

For Dianemo/LinuxMCE consulting advice;
@herron on Twitter, totallymaxed+inquiries@gmail.com via email or PM me here.

Get Dianemo-Rpi2 ARM Licenses http://forum.linuxmce.org/index.php?topic=14026.0

Get RaspSqueeze-CEC or Raspbmc-CEC for Dianemo/LinuxMCE: http://wp.me/P4KgIc-5P

Facebook: https://www.facebook.com/pages/Dianemo-Home-Automation/226019387454465

http://www.dianemo.co.uk

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Re: SPDIF Passthrough sound skipping/stuttering - Is it just me?
« Reply #3 on: July 23, 2008, 07:20:28 pm »
Andrew,

thanks, I will try that, and if that does not work I will look towards the possibility of a hardware problem (trying a separate sound card or something).
That's exactly the answer I needed, to make sure that there were no special tricks.

Jean

totallymaxed

  • LinuxMCE God
  • ****
  • Posts: 4660
  • Smart Home Consulting
    • View Profile
    • Dianemo - at home with technology
Re: SPDIF Passthrough sound skipping/stuttering - Is it just me?
« Reply #4 on: July 23, 2008, 07:49:25 pm »
Andrew,

thanks, I will try that, and if that does not work I will look towards the possibility of a hardware problem (trying a separate sound card or something).
That's exactly the answer I needed, to make sure that there were no special tricks.

Jean

Np Jean... let me know how you get on.

All the best

Andrew
Andy Herron,
CHT Ltd

For Dianemo/LinuxMCE consulting advice;
@herron on Twitter, totallymaxed+inquiries@gmail.com via email or PM me here.

Get Dianemo-Rpi2 ARM Licenses http://forum.linuxmce.org/index.php?topic=14026.0

Get RaspSqueeze-CEC or Raspbmc-CEC for Dianemo/LinuxMCE: http://wp.me/P4KgIc-5P

Facebook: https://www.facebook.com/pages/Dianemo-Home-Automation/226019387454465

http://www.dianemo.co.uk

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Re: SPDIF Passthrough sound skipping/stuttering - Is it just me?
« Reply #5 on: July 24, 2008, 03:59:44 am »
Andrew,

disabling the analog portion of the sound card didn't change anything unfortunately. The fact that it works in UI1 still sound svery strange, so I was jut wondering: what display driver do you use? The default closed source nvidia driver enclosed with 07.10, or do you upgrade this to a later driver from nvidia's website, and if so which version?


Also do you know if it's possible to update the bios on these machines from linux, or do I need to run windows for that?


Jean

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: SPDIF Passthrough sound skipping/stuttering - Is it just me?
« Reply #6 on: July 24, 2008, 05:08:41 am »
maybe a silly question, but have you combed through you dmesg for initialisation or ongoing probs with the sound hardware? Also, through your /var/log/Xorg.0.log file for any initialisation or ongoing issues with X's use of sound?

btw, my sound when starting KDE is heavily corrupted - sounds stuttering/gated/clipped, and has for many rebuilds under some of the recent versions, but it has never effected sound in LMCE, I get perfect sound through my SPDIF, stereo or multichannel...

totallymaxed

  • LinuxMCE God
  • ****
  • Posts: 4660
  • Smart Home Consulting
    • View Profile
    • Dianemo - at home with technology
Re: SPDIF Passthrough sound skipping/stuttering - Is it just me?
« Reply #7 on: July 24, 2008, 11:10:03 am »
Andrew,

disabling the analog portion of the sound card didn't change anything unfortunately. The fact that it works in UI1 still sound svery strange, so I was jut wondering: what display driver do you use? The default closed source nvidia driver enclosed with 07.10, or do you upgrade this to a later driver from nvidia's website, and if so which version?


Also do you know if it's possible to update the bios on these machines from linux, or do I need to run windows for that?


Jean

We use the LinuxMCE-0710 default nVidia drivers.

Andrew
Andy Herron,
CHT Ltd

For Dianemo/LinuxMCE consulting advice;
@herron on Twitter, totallymaxed+inquiries@gmail.com via email or PM me here.

Get Dianemo-Rpi2 ARM Licenses http://forum.linuxmce.org/index.php?topic=14026.0

Get RaspSqueeze-CEC or Raspbmc-CEC for Dianemo/LinuxMCE: http://wp.me/P4KgIc-5P

Facebook: https://www.facebook.com/pages/Dianemo-Home-Automation/226019387454465

http://www.dianemo.co.uk

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: SPDIF Passthrough sound skipping/stuttering - Is it just me?
« Reply #8 on: July 24, 2008, 03:23:52 pm »
dave, what version drivers are you using. I haven't bothered upgrading them yet so I am still using the default 169.12

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Re: SPDIF Passthrough sound skipping/stuttering - Is it just me?
« Reply #9 on: July 25, 2008, 12:32:35 am »
Hello Guys,

thanks for jumping in. No I don't see anything suspicious in my dmesg or in xorg.log (does this have any info about sound anyway? I always only see video related things in there and that part is working fine).
Since the difference between UI1 and UI2 is OpenGl, I thought that this could somehow be interfering, hence my asking about video drivers, but I use the exact same setup as Andrew it seems.
I guess I can try to experiment with various versions of Nvidia drivers to see if it helps, since I don't have any other ideas at the moment.

I wanted to run UI2 with a different driver than the nvidia driver to rule it out, but it won't start with vesa or with nv driver, so the only option for me is to try a very old or very new driver version...

Dave: I will check on that buffer setting tonight and play with it, thanks.

I will let you know if I find the solution!

This was an open box system from newegg, so I'm not sure if I can even RMA it...

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Re: SPDIF Passthrough sound skipping/stuttering - Is it just me?
« Reply #10 on: July 25, 2008, 12:43:05 am »
One more note: I do see errors about "nv_nic_irq" in dmesg and not sure if that could be related and what it means

Also when running these videos in KDE with xine --verbose (where the sound has the same problem), I get a lot of:
fixing sound card drift by -2115 pts
errors

According to Xine:
Quote
Audio is stuttering and i see a lot of "metronom: fixing sound card drift by -2115 pts" on the console output
Might be a soundcard problem, if it only comes in longer intervals. Your soundcard does not keep it's sampling frequency accurately enough, which results in audio and video getting out of sync and xine has to compensate. If you see the message only from time to time, you might remedy it by using the resampling sync method. You can do this by setting the configuration entry audio.synchronization.av_sync_method to resample.

If you receive the metronom message more often, maybe switching to different drivers (alsa to oss or vise-versa) can help here. It has also been reported that setting the configuration entry audio.synchronization.force_rate to the native sampling rate of your soundcard (try 44100 and 48000) helps sometimes.

Another, whole different possibility is that you have some background process running which is messing with the clock (like some ntp client - chronny, ntpd, ...).

Occasional messages of "fixing sound card drift" may happen on start and when playing a long stream (like a movie). This is normal behaviour, nothing to worry about.


I tried the suggestions about changes in xine.conf, then restarted xine and explicitely specified the xine.conf file just to be sure it was read, and that didn't help.

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Re: SPDIF Passthrough sound skipping/stuttering - Is it just me?
« Reply #11 on: July 25, 2008, 06:52:38 pm »
Hello,

after some of your suggestions I made the following test:

in UI2: I open KDE Desktop, and playback a file there. Sound is choppy and breaking off. Now if I click on "stop media station" in the lmce control pannel, the sound becomes perfect when the media station (meaning all the LMCE components running on that machine) is stopped! Start it again, and the sound becomes choppy again.
I then tried to kill various devices while Media Station is up, such as OrbiterGL, App_Server, HAL etc, but that didn't bring back sound so far, so I don't know yet which particular device causes this.

One thing that could be important and that I didn't mention so far: I have a development environement setup on this machine, as explained in the wiki. Is there maybe any possibility that installing this dev environement updated the one or other library, and that this could be causing the problem? Somehow there must be a difference between my system and your guys' systems, so that could be it? I think that the problem was already there before I installed the dev environement last time, but I'm not 100% sure.

And as a reminder, sound is always Ok in UI1.

Jean

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Re: SPDIF Passthrough sound skipping/stuttering - Is it just me?
« Reply #12 on: July 29, 2008, 01:56:31 am »
A little update since I'm still having this problem:

I tried running a video in KDE with the Orbiter/Media Station running (bad sound). Then tried to kill every single device running on the MD until the sound started working, to find which one causes the problem. Killing Xine_Player, Mplayer_Player, MythTV etc all don't change anything, only when I kill OrbiterGL, then the sound starts working fine. If anyone has an idea what this could mean, please let me know by all means as I am running out of ideas. I'm going to try every single driver version from Nvidia to see if that makes a difference, based on the theory that it could have to do with OpenGL...

Also another interesting test I made, was that I tried using the coax digital output instead of optical, and that gives me exactly the same problem, which rules out a bunch of possible hardware problems in the sound card or in my receiver...

Jean

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Re: SOLVED - SPDIF Passthrough sound skipping/stuttering - Is it just me?
« Reply #13 on: July 30, 2008, 07:24:11 pm »
So here is the solution, after 2 weeks of trying almost everything:

I added:
options snd_hda_intel position_fix=1

at the end of:
/etc/modprobe.d/alsa-base

Reboot, and voila, problem gone.

What this does according to Alsa doc is: position_fix - Fix DMA pointer (0 = auto, 1 = none, 2 = POSBUF, 3 = FIFO size)

Why this is necessary only on my box and not other people's boxes I have no idea. Either I have something set differently in the bios regarding DMA, or perhaps bad memory or something, or my sound chip is a different release that's slightly different. If anyone would like to compare the revision of the chips by issuing some commands (maybe lspci with some options?) let me know...

Anyway, thanks to everyone who tried to help me, and hopefully this will help someone else in the future.

Jean