Kodi Community Forum

Full Version: Mono sound broken?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
I just noticed on my files with mono 44.1 soundtracks I get a 'failed to initialize audio' error. Everything else is fine AC3/flacs/stereo 44.8. I have no idea when this first started happening since I have so few of these. Anyone else notice this? I'm using iec958 on an ALC1200 Digital.

09:09:43 T:1331472704 M:1624612864 DEBUG: CALSADirectSound::CALSADirectSound - Channels: 1 - SampleRate: 44100 - SampleBit: 16 - Resample false - Codec PCM - IsMusic false - IsPassthrough false - audioDevice: iec958
09:09:44 T:1331472704 M:1624653824 DEBUG: Initialize - using alsa device iec958
09:09:44 T:1331472704 M:1624662016 ERROR: Initialize - hw_params_set_channels, alsa error: -22 - Invalid argument
09:09:44 T:1331472704 M:1624010752 ERROR: Creating a Null Audio Renderer, Check your audio settings as this should not happen
Could you please supply a test file?
xmltok Wrote:Anyone else notice this? I'm using iec958 on an ALC1200 Digital.
[...]
09:09:44 T:1331472704 M:1624662016 ERROR: Initialize - hw_params_set_channels, alsa error: -22 - Invalid argument
09:09:44 T:1331472704 M:1624010752 ERROR: Creating a Null Audio Renderer, Check your audio settings as this should not happen

Yep...know this and fixed it. You have to set your default output device to plughw:0,1 or plug:iec958 in order to have alsa resample the pcm stream. The digital output can only handle 2 channels 44,1 or 48KHz.

You can try this with:
Code:
speaker-test -c1 -Diec958

and it will fail, but this:

Code:
speaker-test -c1 -Dplug:iec958

works as expected.
That did it. Thanks Haggy!

Topfs2, do you still want a test file? How do I provide it? What I have is ~300MB.
xmltok: Just for the records, that should also fix the missing sound output for the YouTube plugin.
xmltok Wrote:That did it. Thanks Haggy!

Topfs2, do you still want a test file? How do I provide it? What I have is ~300MB.

Nah, thats ok. If you have fixed it then it's all good.

@Haggy
I must admit I'm fairly uneducated on ALSA and especially passthrough (don't use it). What would changing our defaults from iec958 to plug:iec958 do?
I mean, would it make the stream not certainly bitperfect? i.e does ALSA decode, and resample and such on that change?

Cheers,
Tobias
Topfs2 Wrote:@Haggy
I must admit I'm fairly uneducated on ALSA and especially passthrough (don't use it). What would changing our defaults from iec958 to plug:iec958 do?
I mean, would it make the stream not certainly bitperfect? i.e does ALSA decode, and resample and such on that change?

Well in short: Yes. It depends on your actual soundhardware however. Using the plug-interface, PCM streams that are not natively supported by the hardware (sample rate, sample format, channels etc...) will automatically be converted (resampled) into a compatible format. Using "iec958" as output device will do and output a bitperfect stream to the Amp, as long as it is supported by the hardware. However, some flash movies (Youtube) and other rather highly compressed formats use 22KHz and/or 1 channel audio, which at least on my soundchip (ALC1200) cannot be played back. The plug-interface comes in handy for these files because it resamples the pcm stream to 44.1 KHz or whatever is appropriate. However, files that are natively supported don't get touched. This is also valid for the HDMI interface, so plug:hdmi may also fix this issues.

Cheers!
Ralf.
Thanks for the info. Haggy's fix also worked here. Got some old TV shows with mono audio.
I searched around and broke my install twice trying to fix this so I thought I may post my issue and see if someone that actually knows what they are doing can help me Smile. I am running XBMClive 9.04.1 on a ZOTAC ION ITX-B-E board.
All sound seems to be working fine other than the mono stuff I have backed up.
Hell I even got menu sound working. I am pushing the sound out via HDMI to my 720p tv.

Here is the error I am seeing:
Code:
12:26:15 T:2842409872 M:3058888704   DEBUG: Initialize - using alsa device hdmi
12:26:15 T:2842409872 M:3058782208   ERROR: Initialize - hw_params_set_channels, alsa error: -22 - Invalid argument
12:26:15 T:2842409872 M:3058577408   ERROR: Creating a Null Audio Renderer, Check your audio settings as this should not happen
any help would be great cause I really want to watch my Ducktales Tongue
I followed what that page said and set the default one. (I am unsure if I did it correct though)... i used the .asoundrc wiki page to tell me how to do so.
I'm getting this error on an XBMC live install that sends all sound through HDMI.

Where would I make this change?

Thanks,

Pete
this is very annoying. Haggy thanks for the explanations,
at least now i understand why... but still not still not clear what to do about it Wink

Code:
speaker-test -c2 -Dhdmi:HDMI
will make sound for me, but i can't seem to translate this into the audio hardware settings screen. i've tried default:HDMI / default:hdmi / hdmi:HDMI / HDMI:hdmi / plug:HDMI / plug:hdmi ... always "failed to init. audio device"

i can only get HDMI sound if i create /etc/asound.conf with the following
Code:
pcm.!default {
        type hw
        card 1
      device 3
        rate 48000
    channels 2
    }

i found this on another thread here. it over-rides the digital/analog controls available in xbmc but doesnt work with mono & causes sound skips

what am i missing here. i'd like to play my older recordings too Oo
zosky Wrote:will make sound for me, but i can't seem to translate this into the audio hardware settings screen. i've tried default:HDMI / default:hdmi / hdmi:HDMI / HDMI:hdmi / plug:HDMI / plug:hdmi ... always "failed to init. audio device"

Weird. Can you post the output of 'aplay -L' ?
xbmc@ubuntu:~$ aplay -L
Code:
front:CARD=SB,DEV=0    
    HDA ATI SB, ALC1200 Analog
    Front speakers            
surround40:CARD=SB,DEV=0      
    HDA ATI SB, ALC1200 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=SB,DEV=0
    HDA ATI SB, ALC1200 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=SB,DEV=0
    HDA ATI SB, ALC1200 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=SB,DEV=0
    HDA ATI SB, ALC1200 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=SB,DEV=0
    HDA ATI SB, ALC1200 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=SB,DEV=0
    HDA ATI SB, ALC1200 Digital
    IEC958 (S/PDIF) Digital Audio Output
null
    Discard all samples (playback) or generate zero samples (capture)
hdmi:CARD=HDMI
    HDA ATI HDMI, ATI HDMI
    HDMI Audio Output
xbmc@ubuntu:~$ aplay -l
Code:
**** List of PLAYBACK Hardware Devices ****
card 0: SB [HDA ATI SB], device 0: ALC1200 Analog [ALC1200 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: SB [HDA ATI SB], device 1: ALC1200 Digital [ALC1200 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 3: ATI HDMI [ATI HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
Pages: 1 2 3