[Linux]Cannot get digital output audio to work again
#1
Hi all,

This is my first post here, so please be gentle Smile

XBMC version: 2:10.00~svn33324-lucid1
Ubuntu 10.04 i686
Hardware setup:
The connection made through Coax cable from the blue jack into a coax digital input on Yamaha RX-V367 Receiver
The receiver is set to Dolby Pro 2 and I have 5 big speakers (1 center, fl, fr, rl, rr)
Here's the result of aplay -l:

Code:
bogdan@bogdan-desktop:/usr/share/alsa/cards$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: CA0106 [CA0106], device 0: ca0106 [CA0106]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: CA0106 [CA0106], device 1: ca0106 [CA0106]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: CA0106 [CA0106], device 2: ca0106 [CA0106]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: CA0106 [CA0106], device 3: ca0106 [CA0106]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Command:
Code:
aplay -v -D plughw:CA0106 /usr/share/sounds/alsa/Front_Center.wav

has the below output:
Code:
Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
Plug PCM: Route conversion PCM (sformat=S16_LE)
  Transformation table:
    0 <- 0
    1 <- 0
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 1
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 16
  buffer_size  : 16384
  period_size  : 4096
  period_time  : 85333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 4096
  period_event : 0
  start_threshold  : 16384
  stop_threshold   : 16384
  silence_threshold: 0
  silence_size : 0
  boundary     : 1073741824
Slave: Hardware PCM card 0 'CA0106' device 0 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 16
  buffer_size  : 16384
  period_size  : 4096
  period_time  : 85333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 4096
  period_event : 0
  start_threshold  : 16384
  stop_threshold   : 16384
  silence_threshold: 0
  silence_size : 0
  boundary     : 1073741824
  appl_ptr     : 0
  hw_ptr       : 0

iecset has the below output:

Code:
bogdan@bogdan-desktop:~$ iecset
Mode: consumer
Data: audio
Rate: 48000 Hz
Copyright: permitted
Emphasis: none
Category: digital signal mixer
Original: original
Clock: 1000 ppm

I've tried with both Data:audio and Data non-audio (iecset audio on and
iecset audio off) and it makes no difference.

iecset -x
for Data:audio
Code:
bogdan@bogdan-desktop:~$ iecset -x
AES0=0x04,AES1=0x92,AES2=0x10,AES3=0x02
for Data:non-audio
Code:
bogdan@bogdan-desktop:~$ iecset -x
AES0=0x06,AES1=0x92,AES2=0x10,AES3=0x02

The problem is the following. When I first installed XBMC I've configured the following for the audio:
Audio Output: Optical/Coax
Speaker Configuration: 5.0
Dolby Digital and DTS capable receiver: on
Output Audio Device: CA0106 Soundblaster Digital Stereo (IEC958)
Passthrough output Device: CA0106 IEC958

I've got perfect digital sound out, the receiver locked on DTS and everything was ok. What I still had to resolve was to make XBMC run in full screen on my TV (which is setup as secondary display using NVIDIA's twinview setting).
So I've started working on that. Before doing anything I've made a backup for xorg.conf and then I've started editing it following different posts and tutorials. I've even ended up having the 2 displays configured to have their own X server but XBMC didn't run in full screen on my TV no matter what. So I've decided to call it a night, I've reverted to the backup xorg.conf file and shutdown the computer and then went to sleep. In the morning when I woke up I've powerd on the computer and guess what? Digital output wasn't working anymore in XBMC. When starting the DTS movie I've got a popup message saying that "failed to initialize sound device..." and the movie stated but without any sounds. Changing from digital to analog worked but this is not what I wanted.

After lots and lots of days of searching through posts and trying all sorts of things I've decided to post here and get some help.

Let me give you some tests examples and their outcome:

Test1
XBMC configured as below:

Audio Output: Optical/Coax
Speaker Configuration: 5.0
Dolby Digital and DTS capable receiver: on
Output Audio Device: CA0106 Soundblaster Digital Stereo (IEC958)
Passthrough output Device: IEC958

Sound Preferences:
CA0106 Soundblaster
ProfileBig Grinigital Stereo (IEC958) output/Analog stereo input

start XBMC
start DTS movie....result: failed to initialize audio device.

The XBMC_crashlog contains:
Code:
15:31:02 T:2776677232 M:2632155136   DEBUG: PulseAudio: Found CA0106 Soundblaster Digital Stereo (IEC958) with devicestring pulse:alsa_output.pci-0000_05_02.0.iec958-stereo@default
15:31:02 T:3057039232 M:2632155136 WARNING: Failed to find previously selected audio sink

....

15:42:52 T:3057039232 M:2605543424   DEBUG: Building didl for object '/media/G_Drive/Download SABnzbd/complete/Movies/-= HD =-/Chloe.2009.BluRay.720p.DTS.x264-CHD/chloe.2009.bluray.720p.dts.x264-chd.mkv'
15:42:52 T:2813561712 M:2610814976   ERROR: Initialize - failed to open custom device iec958:AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2 (error:Device or resource busy), retry with default iec958
15:42:52 T:2813561712 M:2610814976   ERROR: Initialize - pcm_open_lconf, alsa error: -16 - Device or resource busy
15:42:52 T:2813561712 M:2610814976   DEBUG: SetActiveDevice - SetActiveDevice from 2 to 1
15:42:52 T:2813561712 M:2610814976   DEBUG: RemoveActiveDevice - Removing device 2
15:42:52 T:2813561712 M:2610814976   DEBUG: CGUIAudioManager::Initialize
15:42:52 T:2813561712 M:2610679808   ERROR: Creating a Null Audio Renderer, Check your audio settings as this should not happen
15:42:52 T:2813561712 M:2610679808   DEBUG: RemoveActiveDevice - Removing device 1
15:42:52 T:2813561712 M:2610679808   DEBUG: CGUIAudioManager::DeInitialize

As you can see the AESx parameters are wrong.

Full crashlog here: http://pastebin.com/g0Hvdq9N

Test 2

XBMC configured as below:

Audio Output: Optical/Coax
Speaker Configuration: 5.0
Dolby Digital and DTS capable receiver: on
Output Audio Device: CA0106 Soundblaster Digital Stereo (IEC958)
Passthrough output Device: IEC958

Sound Preferences:
CA0106 Soundblaster
Profile:Analog Stereo Duplex

Start XBMC. Checking System Settings the Audio Output Device changed to:
pulse:alsa_output.pci-0000_05_02.0.iec958-stereo@default.
Start DTS movie....result..failed to initialize audio device

logs contain:

Code:
5:49:28 T:2778618736 M:2628263936   DEBUG: PulseAudio: Found CA0106 Soundblaster Analog Stereo with devicestring pulse:alsa_output.pci-0000_05_02.0.analog-stereo@default
15:49:28 T:3056809856 M:2628136960 WARNING: Failed to find previously selected audio sink

.....
15:52:47 T:2806905712 M:2609434624   ERROR: Initialize - failed to open custom device iec958:AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2 (error:Device or resource busy), retry with default iec958
15:52:47 T:2806905712 M:2609434624   ERROR: Initialize - pcm_open_lconf, alsa error: -16 - Device or resource busy
15:52:47 T:2806905712 M:2609434624   DEBUG: SetActiveDevice - SetActiveDevice from 2 to 1
15:52:47 T:2806905712 M:2609434624   DEBUG: RemoveActiveDevice - Removing device 2
15:52:47 T:2806905712 M:2609434624   DEBUG: CGUIAudioManager::Initialize
15:52:47 T:2806905712 M:2609172480   ERROR: Creating a Null Audio Renderer, Check your audio settings as this should not happen
15:52:47 T:2806905712 M:2609172480   DEBUG: RemoveActiveDevice - Removing device 1
15:52:47 T:2806905712 M:2609172480   DEBUG: CGUIAudioManager::DeInitialize
15:52:47 T:2806905712 M:2609172480   DEBUG: SetActiveDevice - SetActiveDevice from 0 to 2
15:52:47 T:2806905712 M:2609172480   DEBUG: RemoveActiveDevice - Removing device 0
15:52:47 T:2806905712 M:2609172480   DEBUG: CNullDirectSound::Initialize - Channels: 2 - SampleRate: 48000 - SampleBit: 16 - Resample false - IsMusic false - IsPassthrough true - audioDevice: iec958
15:52:47 T:2806905712 M:2609172480   DEBUG: CDVDPlayerAudio:: synctype set to 0: clock feedback

Full crashlog here: http://pastebin.com/wfqTyE2c

And finally: DEBUG LOG


Please let me know if you need anything else.
Thanks in advance
Reply
#2
this may be the same problem as described here:

http://forums.gentoo.org/viewtopic-p-6421242.html

It seems to be a driver problem. Would you please post the exact model name of your sound card (look for ca0106 in dmesg output).

We should file an ALSA bug for this.
Reply
#3
btw. what does mplayer output when you try an ac3 or dts file with "-afm hwac3"?
Reply
#4
I created an entry in the ALSA Bugtracker:

http://bugtrack.alsa-project.org/alsa-bu...hp?id=5126
Reply

Logout Mark Read Team Forum Stats Members Help
[Linux]Cannot get digital output audio to work again0