Posts: 442
Joined: Feb 2008
Reputation:
34
gnif
Team-XBMC Developer
Posts: 442
Hrmm, I have a card that reports the same thing, 24bit max, but alsa can open in 32... perhaps alsa is expecting S24 packed into S32.... I will investigate.
I am not scared of SVN - Cutting my hands open on the bleeding edge.
Posts: 442
Joined: Feb 2008
Reputation:
34
gnif
Team-XBMC Developer
Posts: 442
I have added a check for this, and hopefully fixed S24 format issues, I cant test here however, can you please update and re-test.
We now try the formats in the following order...
FLOAT
DOUBLE
S24NE3
S24NE
S32NE
S32BE
S32NE
S16NE
S16BE
S16LE
... etc
if S32 is chosen, and sbits is 24, we use S24NE which converts to S24 and packs into 4 bytes.
I am not scared of SVN - Cutting my hands open on the bleeding edge.
Posts: 442
Joined: Feb 2008
Reputation:
34
gnif
Team-XBMC Developer
Posts: 442
The clipping issue may be libmad, it seems to be returning samples > 1.0f and < -1.0f, I am looking at a solution right now, might have to implement a tanh soft clipper.
I am not scared of SVN - Cutting my hands open on the bleeding edge.
Posts: 442
Joined: Feb 2008
Reputation:
34
gnif
Team-XBMC Developer
Posts: 442
We used to output S16 and clamp, but when outputting float, clamping produces crap output at high levels. I have added a simple tanh soft clipper which works well, which I pinched from the audacity project. I am about to replicate it into dvdplayer.
I am not scared of SVN - Cutting my hands open on the bleeding edge.
Posts: 199
Joined: Feb 2009
Reputation:
6
bobb0
Senior Member
Posts: 199
I recompiled with your changes. On startup it still selected 32bit output by default. Tested anyway.. the sound was awful.
Commented out the 32bit format, recompiled. Sounds much better.
It still skips over the 24-bit format though.
Gotta go to work... I will look into it more when I get home.
d
Posts: 199
Joined: Feb 2009
Reputation:
6
bobb0
Senior Member
Posts: 199
I'll do a full wipe + checkout tonight.
Posts: 26,215
Joined: Oct 2003
Reputation:
187
A soft limiter should not ever be used at the codec level unless the codec itself specifies that it should be. If anything, limiting should be done only after volume deamplification (replaygain/volume control etc.) has been done - it should always be the last thing in the chain.
I'm sure the libmad folk will be happy to let you know the appropriate way in which output from mad should be handled.
Cheers,
Jonathan
Posts: 442
Joined: Feb 2008
Reputation:
34
gnif
Team-XBMC Developer
Posts: 442
thats very strange, it could be the function that converts 32bit to float.
I can also tell you why your device supports 32bit... your using "plug:hdmi", not the "plug" as the device, the "plug" plugin does format/samplerate, etc, conversion, you could try setting "custom" as the device and just putting in "hdmi" and see how that goes.
I am not scared of SVN - Cutting my hands open on the bleeding edge.
Posts: 199
Joined: Feb 2009
Reputation:
6
bobb0
Senior Member
Posts: 199
Interesting point. I tried using custom and entering hdmi there -- no use, the code in AESinkALSA.cpp doesn't account for a custom device, instead it just detects hdmi and renames it to 'plug:hdmi' anyway -- I had to remove plug: from the code.
No change. Outputting directly to hdmi without the plug interface makes no difference.
Checked my crossfade/replaygain settings and made sure to disable them... no effect.
If I comment out 32bit mode, the next mode it selects is 16bit which sounds decent, some clipping but for the most part clean.
Is there something I can use to probe my audio hardware... outside of /proc?
OH, and alsa is reporting 32 significant bits, so it's not 24 being initialized as 32.
Posts: 442
Joined: Feb 2008
Reputation:
34
gnif
Team-XBMC Developer
Posts: 442
sorry, forgot to mention that the device string has an extra specifier, the sink... try "alsa:hdmi"... it does not explain the clipping however, I am investigating what i think is a related issue atm.
I am not scared of SVN - Cutting my hands open on the bleeding edge.