Kodi Community Forum

Full Version: audio passthrough not working with Nvidia Nforce4
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Would you guys suggest I submit a bug report at this point?
You can submit a bug report, but that doesn't change the fact that I'm out of ideas. Maybe fritsch has another suggestion.
Yeah, submitting a bug will land with me anyways :-)

Try to download an ac3 file and try to use aplay with the correct options from command line. Play with the AES options, e.g. aplay -D iec958:AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2 myfile.ac3 does this work?
Interesting.. on my second myth box, which is an older debian system -- with absolutely identical hardware (motherboard is the exact same model and submodel), mplayer works fine...

the aplay command? No...

On that box, I get an error message that seems to be the same as this (it's numerical, instead of the actual format):

(just to clarify, the message below is the message from the box with xbmc... the sentence above is just saying that my OTHER (much older version of alsa) box does the same thing, but with a numeric error for the format (eg: aplay: set_params:918: Sample format non available):

# aplay -D iec958:AES0=0x0,AES1=0x82,AES2=0x0,AES3=0x2 audio.ac3
Playing raw data 'audio.ac3' : Unsigned 8 bit, Rate 8000 Hz, Mono
aplay: set_params:1081: Sample format non available
Available formats:
- S16_LE

If I do this:


aplay device numberI get this:

# aplay -D iec958:AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2 audio.ac3 -f S16_LE -c2
Playing raw data 'audio.ac3' : Signed 16 bit Little Endian, Rate 8000 Hz, Stereo

It "works", but no sound comes out. Not surprising if aplay isn't actually converting anything.

Mplayer, however, converts (shown with -v):

[format] Changing sample format from big-endian AC3 to little-endian AC3
[format] Accelerated endianness conversion only

I'm guessing one can do edian conversion without losing any data.

So, that may be the problem here. My device can only do S16_LE.
Quote:Signed 16 bit Little Endian, Rate 8000 Hz, Stereo

Try a different sample, please. and also post the full mplayer log. Wonder why aplay does do nothing, cause it opens with Little Endian and your ac3 sample.
Hmmmmmmm.

Check this mplayer snippet out, from a DTS file:

Forced audio codec: hwdts
Opening audio decoder: [hwac3] AC3/DTS pass-through S/PDIF
hwac3: switched to DTS, 1536000 bps, 48000 Hz

AUDIO: 48000 Hz, 2 ch, ac3le, 1536.0 kbit/100.00% (ratio: 192000->192000)
Selected audio codec: [hwdts] afm: hwac3 (DTS through S/PDIF)
==========================================================================
[AO_ALSA] alsa-lib: conf.c:4571Sadparse_args) Unknown parameter AES0
[AO_ALSA] alsa-lib: conf.c:4704Sadsnd_config_expand) Parse arguments error: No such file or directory
[AO_ALSA] alsa-lib: pcm.c:2217Sadsnd_pcm_open_noupdate) Unknown PCM hw:0,2,AES0=6
AO: [alsa] 48000Hz 2ch ac3le (2 bytes per sample)

You know, this jives with me being able to use 0,0 as an audio device, even though it's just the default device. I think I have auto passthrough, or some such.

Certainly, mplayer is failing at using AES0, then it falls back to the default device, and plays fine.

Look at this:

[email protected]:~/AC3# lsof -n | grep mythtv | grep snd
mplayer 20521 mythtv mem REG 8,18 405552 45230769 /usr/lib/x86_64-linux-gnu/libsndfile.so.1.0.25
mplayer 20521 mythtv mem CHR 116,4 4733 /dev/snd/pcmC0D2p
mplayer 20521 mythtv 7u CHR 116,4 0t0 4733 /dev/snd/pcmC0D2p
mplayer 20523 mythtv mem REG 8,18 405552 45230769 /usr/lib/x86_64-linux-gnu/libsndfile.so.1.0.25


Ok, a normal video {no DTS or AC3}:

[email protected]:~/AC3# lsof -n | grep mythtv | grep snd
mplayer 20565 mythtv mem REG 8,18 405552 45230769 /usr/lib/x86_64-linux-gnu/libsndfile.so.1.0.25
mplayer 20565 mythtv mem CHR 116,4 4733 /dev/snd/pcmC0D2p
mplayer 20565 mythtv 7u CHR 116,4 0t0 4733 /dev/snd/pcmC0D2p
mplayer 20567 mythtv mem REG 8,18 405552 45230769 /usr/lib/x86_64-linux-gnu/libsndfile.so.1.0.25

Same dev. Which makes sense, as I do have:

ac=hwdts,hwac3,
ao=alsa:device=hw=0.2
srate=48000
channels=6
af=lavcac3enc=1

Which means that for *any* type of audio, it's going to be using 0.2 -- SP/DIF, which makes 100% sense.. after all, I'm using coaxial audio, and that's all SP/DIF means.

I think the problem that mplayer ignores, and xbmc does not, is a failure when trying to open the passthrough device. It {AES0=6} completely fails on mplayer -- but it still uses the same default device, which is 0,2. It doesn't try to fall back to 0,0, or fail to proceed.

At least, that's what I'm supposing must be happening. Tongiht, when I get home from work, I'll run xbmc and look at the lsof output too. To see if it's even trying to open the device, after failing with passthrough....
For some strange reason -- mplayer is still working, as always, but now I get no sound from xbmc. And, I get this:

[email protected]:~# lsof -n | grep mythtv | grep dev/snd
xbmc.bin 4481 mythtv mem CHR 116,6 4767 /dev/snd/pcmC0D0p
xbmc.bin 4481 mythtv 36u CHR 116,6 0t0 4767 /dev/snd/pcmC0D0p
CSoftAE 4481 4571 mythtv mem CHR 116,6 4767 /dev/snd/pcmC0D0p
CSoftAE 4481 4571 mythtv 36u CHR 116,6 0t0 4767 /dev/snd/pcmC0D0p
xbmc.bin 4481 4643 mythtv mem CHR 116,6 4767 /dev/snd/pcmC0D0p
xbmc.bin 4481 4643 mythtv 36u CHR 116,6 0t0 4767 /dev/snd/pcmC0D0p
xbmc.bin 4481 4644 mythtv mem CHR 116,6 4767 /dev/snd/pcmC0D0p
xbmc.bin 4481 4644 mythtv 36u CHR 116,6 0t0 4767 /dev/snd/pcmC0D0p
XBPyThrea 4481 4652 mythtv mem CHR 116,6 4767 /dev/snd/pcmC0D0p
XBPyThrea 4481 4652 mythtv 36u CHR 116,6 0t0 4767 /dev/snd/pcmC0D0p
XBPyThrea 4481 4655 mythtv mem CHR 116,6 4767 /dev/snd/pcmC0D0p
XBPyThrea 4481 4655 mythtv 36u CHR 116,6 0t0 4767 /dev/snd/pcmC0D0p
XBPyThrea 4481 4656 mythtv mem CHR 116,6 4767 /dev/snd/pcmC0D0p
XBPyThrea 4481 4656 mythtv 36u CHR 116,6 0t0 4767 /dev/snd/pcmC0D0p
CEventSer 4481 4658 mythtv mem CHR 116,6 4767 /dev/snd/pcmC0D0p
CEventSer 4481 4658 mythtv 36u CHR 116,6 0t0 4767 /dev/snd/pcmC0D0p
CTCPServe 4481 4659 mythtv mem CHR 116,6 4767 /dev/snd/pcmC0D0p
CTCPServe 4481 4659 mythtv 36u CHR 116,6 0t0 4767 /dev/snd/pcmC0D0p
xbmc.bin 4481 4660 mythtv mem CHR 116,6 4767 /dev/snd/pcmC0D0p
xbmc.bin 4481 4660 mythtv 36u CHR 116,6 0t0 4767 /dev/snd/pcmC0D0p
CDVDPlaye 4481 4687 mythtv mem CHR 116,6 4767 /dev/snd/pcmC0D0p
CDVDPlaye 4481 4687 mythtv 36u CHR 116,6 0t0 4767 /dev/snd/pcmC0D0p
CDVDPlaye 4481 4688 mythtv mem CHR 116,6 4767 /dev/snd/pcmC0D0p
CDVDPlaye 4481 4688 mythtv 36u CHR 116,6 0t0 4767 /dev/snd/pcmC0D0p
CDVDPlaye 4481 4689 mythtv mem CHR 116,6 4767 /dev/snd/pcmC0D0p
CDVDPlaye 4481 4689 mythtv 36u CHR 116,6 0t0 4767 /dev/snd/pcmC0D0p
I think I'm going to throw the towel in. I didn't want to just leave you guys hanging...

I have to make a transition to this new box ASAP, and myth works, but only because mplayer works -- and I use that for my player. I don't have a lot of free time right now, which is part of the towel throw in. I just can't spend any more time on it right now. :/

Thanks for the help though, I do appreciate the attempt.

Thanks
You can try to use iecset to turn off prior device settings and see what it will be doing. Btw. there were other spdif related problems with 3.8 and 3.9 kernel - perhaps trying 3.10 will easily solve it?
I had the same problem! here is my solution! Hopeful it will work for you to.
http://forum.xbmc.org/showthread.php?tid...pid1348176
Xenomes: thanks for the info, and it was a good try, but no go here. I've replied in the other thread.

fritsh: mplayer works. xine works. Everything works but xbmc. This is a bug in xbmc's audio code, and all assumptions seem to be that the audio code in xbmc is just fine -- it isn't.

(directed all all xbmc devs...) -> XBMC's audio handling is broken. Say again, XBMC's audio handling is broken.

If mplayer works, xine works, and other audio works, but xbmc doesn't -- xbmc needs to fix something.

I do appreciate the attempt at help, but this is something that will only be resolved -- correctly, by someone fixing xbmc. I was willing to help debug/work with code, but no one seemed interested in taking me up on it.

I don't have any more time to spend on this right now, and I got sucked back in because the possible alsa workaround to XBMC's broken audio handling seemed plausible. I do wish I had more time, I'll try to re-visit xbmc in a couple of year's time.

Thanks
we know that current audio engine has major flaws. this is why we started a rewrite which has just finished first iteration.
@bbarnett:
Perhaps we meet again in some years, looking forward to it.

Quote:If mplayer works, xine works, and other audio works, but xbmc doesn't -- xbmc needs to fix something.

The moment, you pay me money for coding xbmc in my freetime, you are allowed to complain in that way. While you complained and argued, i used the time in between to rewrite the Audio engine with FernetMenta.
Hi Guys,

I hope you don't mind me joining this thread, it's just that I have the exact same issue as the OP (Passthrough no-go using NForce4).

I have been using XBMC for a long time, from the Original XBox, then to Live and XBMCBuntu, and think it's absolutely great.

I have always had a few issues getting XBMC audio to work properly with my hardware, however in XBMC 9, 10 and 11, I could get it working by setting the Audio Device to "Default" and the Passthrough to Custom:"Surround50", it would take a few reboots but it would eventually work and stay working until the next re-install. I have never had to faff about with custom .asound files or anything.

Obviously this isn't possible in 12, as custom passthroughs are no longer possible, so I'm looking for my next steps.

My Setup is as follows:
* NForce4 Mobo, Dual Core AMD CPU and an NVIDIA 9400 GFX card.
* I am NOT using HDMI Audio - my Amp (an ONKYO TX-SR607) is connected using a CoAx S/PDIF cable
* Stereo Audio, MP3s and Videos with stereo/DPL audio play fine via the S/PDIF
* When I try to play anything that has DTS/AAC/DD nothing happens - at all - The Amp relays don't click or anything.
-edit- By "Nothing" I mean with the Audio - the video plays fine

My aplay stuff:

Code:
[email protected]:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: CK804 [NVidia CK804], device 0: Intel ICH [NVidia CK804]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: CK804 [NVidia CK804], device 2: Intel ICH - IEC958 [NVidia CK804 - IEC958]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Code:
[email protected]:~$ aplay -L
default
    Playback/recording through the PulseAudio sound server
sysdefault:CARD=CK804
    NVidia CK804, NVidia CK804
    Default Audio Device
front:CARD=CK804,DEV=0
    NVidia CK804, NVidia CK804
    Front speakers
surround40:CARD=CK804,DEV=0
    NVidia CK804, NVidia CK804
    4.0 Surround output to Front and Rear speakers
surround41:CARD=CK804,DEV=0
    NVidia CK804, NVidia CK804
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=CK804,DEV=0
    NVidia CK804, NVidia CK804
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=CK804,DEV=0
    NVidia CK804, NVidia CK804
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=CK804,DEV=0
    NVidia CK804, NVidia CK804
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=CK804,DEV=0
    NVidia CK804, NVidia CK804 - IEC958
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=CK804,DEV=0
    NVidia CK804, NVidia CK804
    Direct sample mixing device
dmix:CARD=CK804,DEV=2
    NVidia CK804, NVidia CK804 - IEC958
    Direct sample mixing device
dsnoop:CARD=CK804,DEV=0
    NVidia CK804, NVidia CK804
    Direct sample snooping device
dsnoop:CARD=CK804,DEV=2
    NVidia CK804, NVidia CK804 - IEC958
    Direct sample snooping device
hw:CARD=CK804,DEV=0
    NVidia CK804, NVidia CK804
    Direct hardware device without any conversions
hw:CARD=CK804,DEV=2
    NVidia CK804, NVidia CK804 - IEC958
    Direct hardware device without any conversions
plughw:CARD=CK804,DEV=0
    NVidia CK804, NVidia CK804
    Hardware device with all software conversions
plughw:CARD=CK804,DEV=2
    NVidia CK804, NVidia CK804 - IEC958
    Hardware device with all software conversions

Also here's a debug log from when I try to play a file, but I don't think it will help at all: http://xbmclogs.com/show.php?id=37378
(Note that the Video I'm playing is a legal rip off a BluRay I own)

The only error in the log is right at the end - "ERROR: CAESinkALSA::HandleError(snd_pcm_wait) - underrun"

I also have my ~/.xbmc backed up from before the upgrade, so if you need anything from there it's available.

Many Thanks!

Dash
Pages: 1 2