Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: SPDIF surround sound HELP!

  1. #1
    Join Date
    Nov 2007
    Location
    NY
    Beans
    16
    Distro
    Ubuntu 11.04 Natty Narwhal

    SPDIF surround sound HELP!

    Ok if I set my hardware profile to digital stereo duplex "iec958" in sound preferences, I can get 2 channel PCM sound throughout the whole system. However if I want to watch a movie in DTS or any other Digital multichannel format, I have to change it to analog stereo duplex. This is a inconvenience having to get up and switch profiles depending on what I'm watching at, as this is a HTPC setup. Is there any way to both digital and analog sound on one profile? I've been scratching my head over this for a while, help would be much appreciated.

  2. #2
    Join Date
    Apr 2009
    Location
    Aotearoha
    Beans
    2,692
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: SPDIF surround sound HELP!

    Because you are using iec958 (S/PDIF) for PCM stereo I assume your AVR can handle AC3 & DTS...

    To play AC3 or DTS by decode in your AVR HT amp you need to use S/PDIF digital pass thru'.

    Successful digital pass thru' is much more difficult than PCM stereo because the data stream must be exactly right.
    Normally this means no audio sharing, no mixer & no volume control.
    This can be worked around by using the alsa a52 plugin.

    AFAIK pulse audio can not do digital pass thru' yet.

    One likely cause of problems is not using the correct clock rate.
    Digital pass thru' (matrix encoded 5.1 AC3 or DTS) only works at 48KHz. (AC3 5.1 16bit/48KHz/max 640Kbps)
    Last edited by BicyclerBoy; August 5th, 2011 at 10:18 AM.

  3. #3
    Join Date
    Nov 2007
    Location
    NY
    Beans
    16
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: SPDIF surround sound HELP!

    Quote Originally Posted by BicyclerBoy View Post
    Because you are using iec958 (S/PDIF) for PCM stereo I assume your AVR can handle AC3 & DTS...

    To play AC3 or DTS by decode in your AVR HT amp you need to use S/PDIF digital pass thru'.

    Successful digital pass thru' is much more difficult than PCM stereo because the data stream must be exactly right.
    Normally this means no audio sharing, no mixer & no volume control.
    This can be worked around by using the alsa a52 plugin.

    AFAIK pulse audio can not do digital pass thru' yet.

    One likely cause of problems is not using the correct clock rate.
    Digital pass thru' (matrix encoded 5.1 AC3 or DTS) only works at 48KHz. (AC3 5.1 16bit/48KHz/max 640Kbps)
    Ok before I start messing around with anything, How do I makes sure I have to correct clock rate set?

  4. #4
    Join Date
    Nov 2007
    Location
    NY
    Beans
    16
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: SPDIF surround sound HELP!

    OK I got bored so I went ahead and tried the a52 plug-in using these instructions:https://help.ubuntu.com/community/DigitalAC-3Pulseaudio

    Now PCM stereo gets decoded to Digital surround sound on the fly which is kind of nice, but not what I was going for. My receiver can do that. However the problem now is I can't get AC3 sounds to play at all. none of my true digital tracks work anymore, no matter what profile I have it set to. I assume I got ahead of myself here, Appears I need something for AC3 passthru that I'm not seeing. Not very good with this audio crap.

  5. #5
    Join Date
    Apr 2009
    Location
    Aotearoha
    Beans
    2,692
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: SPDIF surround sound HELP!

    On the contrary, you have done well, nothing broken...

    The a52 alsa plugin is not a good solution for AC3 playback.
    It should work if you point the player at surround5.1.
    Or set your alsa default as surround5.1.
    None of these are good solutions..

    The other fly-in-the-ointment is that the channel order is wrong (10.04).
    AC3 == SMPTE /= alsa /= ffmpeg-a52.

    The a52 plugin is the only way to share the digital pass-thru' i.e. system sounds & apps.

    What are you using to play AC3 ?

    Digital pass-thru' does not share; MythTV, XBMC etc can be directly configured to do digital pass thru'. There is no system wide setting as such.
    VLC has pass-thru' setting buried deep or cmd-line options.
    mplayer needs cmd-line options.

    You need to config the player to do pass-thru'

    The "rate 48000" line was necessary with 8.04 or 9.10 ...but I do not use it with 10.04 (will check later).
    Forcing the 48000 rate for everything causes a re-sampling of CD 44.1KHz.

    So to clarify..
    I have a52 & swap51 alsa plug device (just to expt)
    My swap51 is a reordering alsa plug that uses a52.
    I do not point pulseaudio at a52 or swap51 because it crashes (10.04)
    I use MythTV with audio setup for digital pass-thru'.
    Stereo 2 ch PCM stays 2 ch & AC3/DTS are passed-thru'
    Last edited by BicyclerBoy; August 7th, 2011 at 08:47 PM.

  6. #6
    Join Date
    Nov 2007
    Location
    NY
    Beans
    16
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: SPDIF surround sound HELP!

    Quote Originally Posted by BicyclerBoy View Post
    On the contrary, you have done well, nothing broken...

    The a52 alsa plugin is not a good solution for AC3 playback.
    It should work if you point the player at surround5.1.
    Or set your alsa default as surround5.1.
    None of these are good solutions..

    The other fly-in-the-ointment is that the channel order is wrong (10.04).
    AC3 == SMPTE /= alsa /= ffmpeg-a52.

    The a52 plugin is the only way to share the digital pass-thru' i.e. system sounds & apps.

    What are you using to play AC3 ?

    Digital pass-thru' does not share; MythTV, XBMC etc can be directly configured to do digital pass thru'. There is no system wide setting as such.
    VLC has pass-thru' setting buried deep or cmd-line options.
    mplayer needs cmd-line options.

    You need to config the player to do pass-thru'

    The "rate 48000" line was necessary with 8.04 or 9.10 ...but I do not use it with 10.04 (will check later).
    Forcing the 48000 rate for everything causes a re-sampling of CD 44.1KHz.

    So to clarify..
    I have a52 & swap51 alsa plug device (just to expt)
    My swap51 is a reordering alsa plug that uses a52.
    I do not point pulseaudio at a52 or swap51 because it crashes (10.04)
    I use MythTV with audio setup for digital pass-thru'.
    Stereo 2 ch PCM stays 2 ch & AC3/DTS are passed-thru'

    Im using XBMC on 10.10. Passthrough output device is set to iec958, the other choices are irrelevant ie: HDMI, etc. There is an option for custom passthrough device but I have no idea what I would put there. Further digging, if I set the audio output to analog I can get sound from all formats but this means, AC3 is being mixed down so I'm loosing the digital quality. Until I figure out what I'm missing I'm leaving it at that. What is the swap51 plugin for? Also you say that your stereo 2 ch PCM stays 2 ch. I have 6 ch system wide with PCM. Don't know, figured it might be a clue is to what I got going on here. Thanks for the help so far. Getting closer to what I'm looking for.

  7. #7
    Join Date
    Nov 2007
    Location
    NY
    Beans
    16
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: SPDIF surround sound HELP!

    After reading This:http://colin.guthr.ie/2010/12/bobby-...-5-1-surround/

    It states that some application such as XBMC consider a52 as analog. Does this mean that even though I have it set to analog I'm not degrading my sound?

  8. #8
    Join Date
    Apr 2009
    Location
    Aotearoha
    Beans
    2,692
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: SPDIF surround sound HELP!

    Decoding to 5.1 PCM and then re-encoding via a52 plugin is not a good idea.
    I don't think the a52 plug-in works right anyway & it crashes/stutters after about 1 hr..the audio quality is questionable.

    The a52 plugin is an internal virtual analogue input plug device that encodes & outputs AC3 5.1. I believe that normally you would modify the default surround5.1 to use a52 plugin.

    You don't need a52 or my swap51 plugs..

    I don't use XBMC but MythTV stops the pulseaudio server & it drives the h/w correctly.

    The internet searches seem to blame pulse-audio for XBMC pass-thru' problems.

    Can you try this in XBMC custom pass-thru' ?
    HDA Nvidia hdmi
    iec958:CARD=Nvidia,DEV=3 or similar

    Try running XBMC from the command line so we see the error messages..

    Can you post your
    aplay -L
    output ?
    Last edited by BicyclerBoy; August 8th, 2011 at 10:11 AM.

  9. #9
    Join Date
    Nov 2007
    Location
    NY
    Beans
    16
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: SPDIF surround sound HELP!

    Quote Originally Posted by BicyclerBoy View Post
    Decoding to 5.1 PCM and then re-encoding via a52 plugin is not a good idea.
    I don't think the a52 plug-in works right anyway & it crashes/stutters after about 1 hr..the audio quality is questionable.

    The a52 plugin is an internal virtual analogue input plug device that encodes & outputs AC3 5.1. I believe that normally you would modify the default surround5.1 to use a52 plugin.

    You don't need a52 or my swap51 plugs..

    I don't use XBMC but MythTV stops the pulseaudio server & it drives the h/w correctly.

    The internet searches seem to blame pulse-audio for XBMC pass-thru' problems.

    Can you try this in XBMC custom pass-thru' ?
    HDA Nvidia hdmi
    iec958:CARD=Nvidia,DEV=3 or similar

    Try running XBMC from the command line so we see the error messages..

    Can you post your
    aplay -L
    output ?
    aplay -L outputs:
    Code:
    terrence@Terrence-PC:~$ aplay -L
    null
        Discard all samples (playback) or generate zero samples (capture)
    pulse
        Playback/recording through the PulseAudio sound server
    default
    front:CARD=SB,DEV=0
        HDA ATI SB, VT1708S Analog
        Front speakers
    surround40:CARD=SB,DEV=0
        HDA ATI SB, VT1708S Analog
        4.0 Surround output to Front and Rear speakers
    surround41:CARD=SB,DEV=0
        HDA ATI SB, VT1708S Analog
        4.1 Surround output to Front, Rear and Subwoofer speakers
    surround50:CARD=SB,DEV=0
        HDA ATI SB, VT1708S Analog
        5.0 Surround output to Front, Center and Rear speakers
    surround51:CARD=SB,DEV=0
        HDA ATI SB, VT1708S Analog
        5.1 Surround output to Front, Center, Rear and Subwoofer speakers
    surround71:CARD=SB,DEV=0
        HDA ATI SB, VT1708S Analog
        7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
    iec958:CARD=SB,DEV=0
        HDA ATI SB, VT1708S Digital
        IEC958 (S/PDIF) Digital Audio Output
    dmix:CARD=SB,DEV=0
        HDA ATI SB, VT1708S Analog
        Direct sample mixing device
    dmix:CARD=SB,DEV=1
        HDA ATI SB, VT1708S Digital
        Direct sample mixing device
    dsnoop:CARD=SB,DEV=0
        HDA ATI SB, VT1708S Analog
        Direct sample snooping device
    dsnoop:CARD=SB,DEV=1
        HDA ATI SB, VT1708S Digital
        Direct sample snooping device
    hw:CARD=SB,DEV=0
        HDA ATI SB, VT1708S Analog
        Direct hardware device without any conversions
    hw:CARD=SB,DEV=1
        HDA ATI SB, VT1708S Digital
        Direct hardware device without any conversions
    plughw:CARD=SB,DEV=0
        HDA ATI SB, VT1708S Analog
        Hardware device with all software conversions
    plughw:CARD=SB,DEV=1
        HDA ATI SB, VT1708S Digital
        Hardware device with all software conversions
    a52:CARD=SB
        HDA ATI SB
    hdmi:CARD=NVidia,DEV=0
        HDA NVidia, NVIDIA HDMI
        HDMI Audio Output
    hdmi:CARD=NVidia,DEV=1
        HDA NVidia, NVIDIA HDMI
        HDMI Audio Output
    hdmi:CARD=NVidia,DEV=2
        HDA NVidia, NVIDIA HDMI
        HDMI Audio Output
    hdmi:CARD=NVidia,DEV=3
        HDA NVidia, NVIDIA HDMI
        HDMI Audio Output
    dmix:CARD=NVidia,DEV=3
        HDA NVidia, NVIDIA HDMI
        Direct sample mixing device
    dmix:CARD=NVidia,DEV=7
        HDA NVidia, NVIDIA HDMI
        Direct sample mixing device
    dmix:CARD=NVidia,DEV=8
        HDA NVidia, NVIDIA HDMI
        Direct sample mixing device
    dmix:CARD=NVidia,DEV=9
        HDA NVidia, NVIDIA HDMI
        Direct sample mixing device
    dsnoop:CARD=NVidia,DEV=3
        HDA NVidia, NVIDIA HDMI
        Direct sample snooping device
    dsnoop:CARD=NVidia,DEV=7
        HDA NVidia, NVIDIA HDMI
        Direct sample snooping device
    dsnoop:CARD=NVidia,DEV=8
        HDA NVidia, NVIDIA HDMI
        Direct sample snooping device
    dsnoop:CARD=NVidia,DEV=9
        HDA NVidia, NVIDIA HDMI
        Direct sample snooping device
    hw:CARD=NVidia,DEV=3
        HDA NVidia, NVIDIA HDMI
        Direct hardware device without any conversions
    hw:CARD=NVidia,DEV=7
        HDA NVidia, NVIDIA HDMI
        Direct hardware device without any conversions
    hw:CARD=NVidia,DEV=8
        HDA NVidia, NVIDIA HDMI
        Direct hardware device without any conversions
    hw:CARD=NVidia,DEV=9
        HDA NVidia, NVIDIA HDMI
        Direct hardware device without any conversions
    plughw:CARD=NVidia,DEV=3
        HDA NVidia, NVIDIA HDMI
        Hardware device with all software conversions
    plughw:CARD=NVidia,DEV=7
        HDA NVidia, NVIDIA HDMI
        Hardware device with all software conversions
    plughw:CARD=NVidia,DEV=8
        HDA NVidia, NVIDIA HDMI
        Hardware device with all software conversions
    plughw:CARD=NVidia,DEV=9
        HDA NVidia, NVIDIA HDMI
        Hardware device with all software conversions
    a52:CARD=NVidia
        HDA NVidia
    running XBMC from terminal outputs nothing expect a problem with SMB but thats unrelated and not setup at the moment

  10. #10
    Join Date
    Apr 2009
    Location
    Aotearoha
    Beans
    2,692
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: SPDIF surround sound HELP!

    Maybe I have your requirement all wrong...
    Do you want digital pass-thru' over HDMI or over your onboard mobo soundcard via S/PDIF coaxial or toslink cable ?
    speaker-test -c 2 -r 48000 -D iec958:CARD=SB,DEV=0
    (output over mobo soundcard)

    Should find the real output device that is connected to your HDMI device..
    This name is the direct output alsa name alias

    speaker-test -c 2 -r 48000 -D hw:CARD=NVidia,DEV=3
    speaker-test -c 2 -r 48000 -D hw:CARD=NVidia,DEV=7
    speaker-test -c 2 -r 48000 -D hw:CARD=NVidia,DEV=8
    speaker-test -c 2 -r 48000 -D hw:CARD=NVidia,DEV=9

    One of these should make pink noise on the HDMI receiver..

    Because you have HDMI output partially working I guess your device-subdevice will be one of the first (2) listed.
    Last edited by BicyclerBoy; January 5th, 2012 at 01:27 AM. Reason: had "-c 6" for spdif test, should be "-c 2" as spdif stereo only

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •