Kodi Community Forum

Full Version: [LIVE] Correcting 5.1 analogue sound output
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello XBMC Forumers,

You've helped me out many a time in the past and I was wondering if it'd be possible to help me out once more please Smile

I have a set of Logitech Z5500's plugged in via 3 3.5mm jacks into my PCI sound card in the XBMC box.

Whenever I set the audio in audiosettings to "analogue, 5.1" whenever I try and watch videos, I get the error "unable to initialize audio device, please check audiosettings" However, when I change it to "analogue, 2.0" everything works perfectly, however I don't get to appreciate the full effect of 5.1!

Here is aplay -l:

Code:
[email protected]:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: CMI8768 [C-Media CMI8768], device 0: CMI8738-MC8 [C-Media PCI DAC/ADC]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: CMI8768 [C-Media CMI8768], device 1: CMI8738-MC8 [C-Media PCI 2nd DAC]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: CMI8768 [C-Media CMI8768], device 2: CMI8738-MC8 [C-Media PCI IEC958]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: NVIDIA HDMI [NVIDIA HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: NVIDIA HDMI [NVIDIA HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: NVIDIA HDMI [NVIDIA HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: NVIDIA HDMI [NVIDIA HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

and here is aplay -L:
Code:
[email protected]:~$ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=CMI8768
    C-Media CMI8768, C-Media PCI DAC/ADC
    Default Audio Device
front:CARD=CMI8768,DEV=0
    C-Media CMI8768, C-Media PCI DAC/ADC
    Front speakers
rear:CARD=CMI8768,DEV=0
    C-Media CMI8768, C-Media PCI 2nd DAC
    Rear speakers
surround40:CARD=CMI8768,DEV=0
    C-Media CMI8768, C-Media PCI 2nd DAC
    4.0 Surround output to Front and Rear speakers
surround41:CARD=CMI8768,DEV=0
    C-Media CMI8768, C-Media PCI 2nd DAC
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=CMI8768,DEV=0
    C-Media CMI8768, C-Media PCI 2nd DAC
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=CMI8768,DEV=0
    C-Media CMI8768, C-Media PCI 2nd DAC
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=CMI8768,DEV=0
    C-Media CMI8768, C-Media PCI 2nd DAC
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=CMI8768,DEV=0
    C-Media CMI8768, C-Media PCI DAC/ADC
    IEC958 (S/PDIF) Digital Audio Output
hdmi:CARD=NVidia
    HDA NVidia, NVIDIA HDMI
    HDMI Audio Output

I've tried setting the sound to a custom device, "surround51" I've also tried setting it to "surround51:CARD=CMI8768,DEV=0" with no joy!

(I'm running XBMC 10.0 RC2 R35567)

It'd be greatly appreciated if you lot could help,

Thanking you in anticipation, Kris
Hi
try running alsamixer in a terminal window and see if the speakers setting is set to 6 (not always there but sometimes if it is, its not updated via the xbmc mixer)
and all the channels are unmuted
Wozza
Hi Wozza,

Thanks for the help but unfortunately I'm still not having any luck! Sad

Any other suggestions?

Thanks, Kris
Hi Kris
That was my best shot Smile
I had a quick google and found very little
this may help
http://alsa.opensrc.org/C-Media_CMI8738
(down bottom of page trouble shooting)

also do you have a asound.conf/asoundrc file? if so maybe try deleting it,reboot and see if that works....

Finally maybe updating the alsa drivers......

Sorry not much help
Wozza
Ah, that's a shame Wozza, I'm still working on trying to fix it after reading that wiki and the Cmipci page too Sad
Code:
02:12:34 T:2453613424 M:285085696  NOTICE: Creating audio thread
02:12:34 T:2453613424 M:285085696   DEBUG: ReadEditDecisionLists - Checking for edit decision lists (EDL) on local drive or remote share for: /media/500gb/Movies/A Serious Man.avi
02:12:34 T:2453613424 M:285085696   DEBUG: CDVDPlayer::SetCaching - caching state 2
02:12:34 T:2432633712 M:285085696   DEBUG: thread start, auto delete: 0
02:12:34 T:2432633712 M:285085696  NOTICE: running thread: CDVDPlayerAudio::Process()
02:12:34 T:2443123568 M:285085696   DEBUG: thread start, auto delete: 0
02:12:34 T:2432633712 M:285085696   DEBUG: CDVDPlayerAudio - CDVDMsg::GENERAL_RESYNC(24000.000000, 0)
02:12:34 T:2432633712 M:285085696  NOTICE: Creating audio device with codec id: 86017, channels: 2, sample rate: 48000, no pass-through
02:12:34 T:2432633712 M:285085696    INFO: CPCMRemap: Configured speaker layout: 5.1
02:12:34 T:2432633712 M:285085696    INFO: CPCMRemap: I channel map: FL,FR
02:12:34 T:2432633712 M:285085696    INFO: CPCMRemap: O channel map: FL,FR
02:12:34 T:2432633712 M:285085696   DEBUG: CPCMRemap: Downmix normalization is enabled
02:12:34 T:2432633712 M:285085696   DEBUG: CPCMRemap: FL = FL(1.000000*)
02:12:34 T:2432633712 M:285085696   DEBUG: CPCMRemap: FR = FR(1.000000*)
02:12:34 T:2432633712 M:285085696   DEBUG: RemoveActiveDevice - Removing device 1
02:12:34 T:2432633712 M:285085696   DEBUG: SetActiveDevice - SetActiveDevice from 0 to 2
02:12:34 T:2432633712 M:285085696   DEBUG: RemoveActiveDevice - Removing device 0
02:12:34 T:2432633712 M:285085696   DEBUG: Initialize - using alsa device default
02:12:34 T:2443123568 M:285085696   DEBUG: LinuxRendererGL: Cleaning up GL resources
02:12:34 T:2443123568 M:285085696  NOTICE: running thread: video_thread
02:12:34 T:2443123568 M:285085696   DEBUG: CDVDPlayerVideo - CDVDMsg::GENERAL_SYNCHRONIZE
02:12:34 T:3078236032 M:285085696   DEBUG: CAnnouncementManager - Announcement: PlaybackStarted from xbmc
02:12:34 T:2443123568 M:285085696   DEBUG: CDVDPlayerVideo - CDVDMsg::GENERAL_RESYNC(41708.375042, 1)
02:12:34 T:2432633712 M:285085696   ERROR: Initialize - pcm_open_lconf, alsa error: -22 - Invalid argument
02:12:34 T:2432633712 M:285085696   DEBUG: SetActiveDevice - SetActiveDevice from 2 to 1
02:12:34 T:2432633712 M:285085696   DEBUG: RemoveActiveDevice - Removing device 2
02:12:34 T:2432633712 M:285085696   ERROR: Creating a Null Audio Renderer, Check your audio settings as this should not happen
02:12:34 T:2432633712 M:285085696   DEBUG: RemoveActiveDevice - Removing device 1
02:12:34 T:2432633712 M:285085696   DEBUG: SetActiveDevice - SetActiveDevice from 0 to 2
02:12:34 T:2432633712 M:285085696   DEBUG: RemoveActiveDevice - Removing device 0
02:12:34 T:2432633712 M:285085696   DEBUG: CNullDirectSound::Initialize - Channels: 2 - SampleRate: 48000 - SampleBit: 16 - Resample false - IsMusic false - IsPassthrough false - audioDevice: default
02:12:34 T:2432633712 M:285085696   DEBUG: CDVDPlayerAudio:: synctype set to 0: clock feedback
02:12:34 T:2453613424 M:285085696   DEBUG: CDVDPlayer::HandleMessages - player started 1
02:12:34 T:3078236032 M:284434432   DEBUG: CGUIInfoManager::SetCurrentMovie(/media/500gb/Movies/A Serious Man.avi)
02:12:34 T:3078236032 M:284434432   DEBUG: ------ Window Init (DialogKaiToast.xml) ------
02:12:34 T:2443123568 M:284180480  NOTICE:  fps: 23.976000, pwidth: 720, pheight: 390, dwidth: 720, dheight: 390
02:12:34 T:2443123568 M:284180480   DEBUG: OutputPicture - change configuration. 720x390. framerate: 23.98. format: YV12
02:12:34 T:3078236032 M:284180480   DEBUG: ------ Window Deinit (DialogBusy.xml) ------
02:12:34 T:2443123568 M:284180480 WARNING: CRenderManager::Configure - timeout waiting for previous frame
02:12:34 T:2443123568 M:284180480  NOTICE: Display resolution DESKTOP : 1920x1200 @ 60.00 - Full Screen (12)
02:12:34 T:3078236032 M:284180480   DEBUG: Activating window ID: 12005
02:12:34 T:2453613424 M:284180480   DEBUG: CDVDPlayer::HandleMessages - player started 2
02:12:34 T:2453613424 M:284180480   DEBUG: CDVDPlayer::SetCaching - caching state 3
02:12:34 T:2432633712 M:284180480   DEBUG: CDVDPlayerAudio:: Discontinuity - was:17440.171042, should be:24016.489257, error:6576.318215

Is the latest .log file!

Kris
Hi
Have you tried this in a terminal?
speaker-test -DplugConfusedurround51 -c6 -l1 -twav
Interestingly, that works perfectly!

So I tried setting the audio device to "plugConfusedurround51" and I still have no joy, even though the audio test is working perfectly!

Here is the latest log:
Code:
03:30:10 T:2341071728 M:272510976  NOTICE: CDVDVideoCodecFFmpeg::Open() Using codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (VDPAU acceleration)
03:30:10 T:2341071728 M:272510976   DEBUG: FactoryCodec - Video: ff-h264_vdpau-vdpau - Opened
03:30:10 T:2341071728 M:272510976  NOTICE: Creating video thread
03:30:10 T:2341071728 M:272510976  NOTICE: Opening audio stream: 1 source: 256
03:30:10 T:2341071728 M:272510976  NOTICE: Finding audio codec for: 86021
03:30:10 T:2341071728 M:272510976   DEBUG: FactoryCodec - Audio: FFmpeg - Opening
03:30:10 T:2341071728 M:272510976   DEBUG: FactoryCodec - Audio: FFmpeg - Opened
03:30:10 T:2341071728 M:272510976  NOTICE: Creating audio thread
03:30:10 T:2341071728 M:272510976   DEBUG: ReadEditDecisionLists - Checking for edit decision lists (EDL) on local drive or remote share for: /media/500gb/Movies/A.Clockwork.Orange.1971.BluRay.1080p.x264.DTS-ViNYL.mkv
03:30:10 T:2341071728 M:272510976   DEBUG: Process - Start position set to last stopped position: 400000
03:30:10 T:2341071728 M:272510976   DEBUG: SeekTime - seek ended up on time 400526
03:30:10 T:2341071728 M:272510976   DEBUG: Process - starting demuxer from: 400000
03:30:10 T:2341071728 M:272510976   DEBUG: CDVDPlayer::SetCaching - caching state 2
03:30:10 T:2330581872 M:272510976   DEBUG: thread start, auto delete: 0
03:30:10 T:2330581872 M:272510976   DEBUG: LinuxRendererGL: Cleaning up GL resources
03:30:10 T:2330581872 M:272510976  NOTICE: running thread: video_thread
03:30:10 T:3078195072 M:272510976   DEBUG: CAnnouncementManager - Announcement: PlaybackStarted from xbmc
03:30:10 T:2320092016 M:272510976   DEBUG: thread start, auto delete: 0
03:30:10 T:2320092016 M:272510976  NOTICE: running thread: CDVDPlayerAudio::Process()
03:30:10 T:2330581872 M:272510976   DEBUG: CDVDPlayerVideo - CDVDMsg::GENERAL_SYNCHRONIZE
03:30:10 T:2330581872 M:272510976   DEBUG: CDVDPlayerVideo - CDVDMsg::GENERAL_RESYNC(400526000.000000, 1)
03:30:10 T:2330581872 M:272510976  NOTICE:  (VDPAU) screenWidth:1784 vidWidth:1784
03:30:10 T:2330581872 M:272510976  NOTICE:  (VDPAU) screenHeight:1080 vidHeight:1080
03:30:10 T:3078195072 M:266510336   DEBUG: CGUIInfoManager::SetCurrentMovie(/media/500gb/Movies/A.Clockwork.Orange.1971.BluRay.1080p.x264.DTS-ViNYL.mkv)
03:30:10 T:2320092016 M:266510336   DEBUG: CDVDPlayerAudio - CDVDMsg::GENERAL_RESYNC(400533000.000000, 0)
03:30:10 T:2320092016 M:266510336  NOTICE: Creating audio device with codec id: 86021, channels: 6, sample rate: 48000, no pass-through
03:30:10 T:2320092016 M:266510336    INFO: AudioRendererFactory:  not a explicit device, trying to autodetect.
03:30:10 T:2320092016 M:266510336    INFO: CPCMRemap: Configured speaker layout: 5.1
03:30:10 T:2320092016 M:266510336    INFO: CPCMRemap: I channel map: FL,FR,CE,LFE,SL,SR
03:30:10 T:2320092016 M:266510336   DEBUG: CPCMRemap: Forcing side channel map to back channels
03:30:10 T:2320092016 M:266510336    INFO: CPCMRemap: O channel map: FL,FR,CE,BL,BR,LFE
03:30:10 T:2320092016 M:266510336   DEBUG: CPCMRemap: Downmix normalization is enabled
03:30:10 T:2320092016 M:266510336   DEBUG: CPCMRemap: FL = FL(1.000000*)
03:30:10 T:2320092016 M:266510336   DEBUG: CPCMRemap: FR = FR(1.000000*)
03:30:10 T:2320092016 M:266510336   DEBUG: CPCMRemap: CE = CE(1.000000*)
03:30:10 T:2320092016 M:266510336   DEBUG: CPCMRemap: BL = BL(1.000000*)
03:30:10 T:2320092016 M:266510336   DEBUG: CPCMRemap: BR = BR(1.000000*)
03:30:10 T:2320092016 M:266510336   DEBUG: CPCMRemap: LFE = LFE(1.000000*)
03:30:10 T:2320092016 M:266510336   DEBUG: RemoveActiveDevice - Removing device 1
03:30:10 T:2320092016 M:266510336   DEBUG: SetActiveDevice - SetActiveDevice from 0 to 2
03:30:10 T:2320092016 M:266510336   DEBUG: RemoveActiveDevice - Removing device 0
03:30:10 T:2320092016 M:266366976   DEBUG: PulseAudio: Context failed
03:30:10 T:2320092016 M:266366976   ERROR: PulseAudio: Waited for the Context but it failed
03:30:10 T:2320092016 M:266366976   ERROR: PulseAudio: Failed to create context
03:30:10 T:2320092016 M:266366976   DEBUG: SetActiveDevice - SetActiveDevice from 2 to 1
03:30:10 T:2320092016 M:266366976   DEBUG: RemoveActiveDevice - Removing device 2
03:30:10 T:2320092016 M:266366976    INFO: CPCMRemap: Configured speaker layout: 5.1
03:30:10 T:2320092016 M:266366976    INFO: CPCMRemap: I channel map: FL,FR,CE,LFE,SL,SR
03:30:10 T:2320092016 M:266366976   DEBUG: CPCMRemap: Forcing side channel map to back channels
03:30:10 T:2320092016 M:266366976    INFO: CPCMRemap: O channel map: FL,FR,BL,BR,CE,LFE
03:30:10 T:2320092016 M:266366976   DEBUG: CPCMRemap: Downmix normalization is enabled
03:30:10 T:2320092016 M:266366976   DEBUG: CPCMRemap: FL = FL(1.000000*)
03:30:10 T:2320092016 M:266366976   DEBUG: CPCMRemap: FR = FR(1.000000*)
03:30:10 T:2320092016 M:266366976   DEBUG: CPCMRemap: BL = BL(1.000000*)
03:30:10 T:2320092016 M:266366976   DEBUG: CPCMRemap: BR = BR(1.000000*)
03:30:10 T:2320092016 M:266366976   DEBUG: CPCMRemap: CE = CE(1.000000*)
03:30:10 T:2320092016 M:266366976   DEBUG: CPCMRemap: LFE = LFE(1.000000*)
03:30:10 T:2320092016 M:266366976   DEBUG: RemoveActiveDevice - Removing device 1
03:30:10 T:2320092016 M:266366976   DEBUG: SetActiveDevice - SetActiveDevice from 0 to 2
03:30:10 T:2320092016 M:266366976   DEBUG: RemoveActiveDevice - Removing device 0
03:30:10 T:2320092016 M:266366976   DEBUG: Initialize - using alsa device plug:surround51
03:30:10 T:2320092016 M:266334208   ERROR: Initialize - hw_params_get_buffer_size, alsa error: -22 - Invalid argument
03:30:10 T:2320092016 M:266334208   DEBUG: SetActiveDevice - SetActiveDevice from 2 to 1
03:30:10 T:2320092016 M:266334208   DEBUG: RemoveActiveDevice - Removing device 2
03:30:10 T:2320092016 M:266334208   ERROR: Creating a Null Audio Renderer, Check your audio settings as this should not happen
03:30:10 T:2320092016 M:266334208   DEBUG: RemoveActiveDevice - Removing device 1
03:30:10 T:2320092016 M:266334208   DEBUG: SetActiveDevice - SetActiveDevice from 0 to 2
03:30:10 T:2320092016 M:266334208   DEBUG: RemoveActiveDevice - Removing device 0
03:30:10 T:2320092016 M:266334208   DEBUG: CNullDirectSound::Initialize - Channels: 6 - SampleRate: 48000 - SampleBit: 16 - Resample false - IsMusic false - IsPassthrough false - audioDevice: plug:surround51
03:30:10 T:2320092016 M:266334208   DEBUG: CDVDPlayerAudio:: synctype set to 0: clock feedback
03:30:10 T:2341071728 M:266334208   DEBUG: CDVDPlayer::HandleMessages - player started 1

Thanks once more, Kris
Hi
Hmm that would suggest that the sound card drivers ect are fine
so the problem should be in xbmc itself ....in theory Smile

Are you sure your not hearing 2 channel sound form the TV hdmi connection?
rather than the Logitech Z5500 ?
Yep, the problem always lies in XBMC Tongue

I'm 100% sure as it's connected via VGA, the only audio possibly coming from the system is through the speakers!
Hi
Ahh ok
Im no expert but maybe try an update/upgrade

something like
sudo apt-get update && sudo apt-get upgrade

Only thing is even though I do it now and again and had no issues, Ive read others
suggest not to do the sudo apt-get upgrade
Or you can wait for the more knowing ones Smile
Im betting its something simple Smile
Wozza
Hello Wozza,

Finally tried that again as a last attempt and still no luck Sad

This is getting rather annoying as I'm sure it'll be some issue relating to xbmc not assigning channels correctly or something similar.

Thanks, Kris
Hi Mate
yeah it can be frustrating..Im betting its going to be something simple.
As its working when you test at the command line, we have to assume its a setting in xbmc.......maybe do a screen cap of your settings in xbmc or list them here and maybe someone will see a problem
other than that Im out of ideas
Cheers
Wozza
Hi Kris
Have a look here http://www.sabi.co.uk/Notes/linuxSoundALSA.html
looks like your sound card is listed in the "Issues with popular chipsets"
section
Wozza
I am having exactly the same issue. Was there ever any resolution?