(2015-06-10, 01:10)AndyFurniss Wrote: (2015-06-09, 22:07)Klasw Wrote: Mplayer do this:
Building audio filter chain for 96000Hz/2ch/s32le -> 96000Hz/2ch/s16le...
If you want mplayer to use exactly what your h/w can take you will often need to tell it explicitly.
mplayer -format s24le ....
Thanks AndyFurniss, do not know wy I did not test that before.
Some funny things happen obviously.
When I test:
mplayer -v -ao alsa:device=hw=2.1 -format s24le
I got:
AUDIO: 96000 Hz, 2 ch, s32le, 2834.0 kbit/46.13% (ratio: 354244->768000)
Selected audio codec: [ffflac] afm: ffmpeg (FFmpeg FLAC audio)
==========================================================================
Building audio filter chain for 96000Hz/2ch/s32le -> 0Hz/0ch/s24le...
[libaf] Adding filter dummy
[dummy] Was reinitialized: 96000Hz/2ch/s32le
[libaf] Adding filter format
[format] Changing sample format from little-endian 32-bit signed int to little-endian 24-bit signed int
[dummy] Was reinitialized: 96000Hz/2ch/s32le
[format] Changing sample format from little-endian 32-bit signed int to little-endian 24-bit signed int
Trying preferred audio driver 'alsa', options 'device=hw=2.1'
alsa-init: requested format: 96000 Hz, 2 channels, 11
alsa-init: using ALSA 1.0.27.2
alsa-init: setup for 1/2 channel(s)
alsa-init: using device hw:2,1
alsa-init: opening device in blocking mode
alsa-init: device reopened in blocking mode
alsa-init: got buffersize=288000
alsa-init: got period size 3000
alsa: 96000 Hz/2 channels/6 bpf/288000 bytes buffer/Signed 24 bit Little Endian in 3bytes
AO: [alsa] 96000Hz 2ch s24le (3 bytes per sample)
AO: Description: ALSA-0.9.x-1.x audio output
AO: Author: Alex Beregszaszi, Zsolt Barat <
[email protected]>
AO: Comment: under development
Building audio filter chain for 96000Hz/2ch/s32le -> 96000Hz/2ch/s24le...
[dummy] Was reinitialized: 96000Hz/2ch/s32le
[format] Changing sample format from little-endian 32-bit signed int to little-endian 24-bit signed int
[dummy] Was reinitialized: 96000Hz/2ch/s32le
[format] Changing sample format from little-endian 32-bit signed int to little-endian 24-bit signed int
Video: no video
Freeing 0 unused video chunks.
Starting playback...
[libaf] Reallocating memory in module format, old len = 0, new len = 98313
Increasing filtered audio buffer size from 0 to 98304
Increasing filtered audio buffer size from 98304 to 134112
...
But if I test (the actual format off the file):
mplayer -v -ao alsa:device=hw=2.1 -format s32le
I got:
AUDIO: 96000 Hz, 2 ch, s32le, 2834.0 kbit/46.13% (ratio: 354244->768000)
Selected audio codec: [ffflac] afm: ffmpeg (FFmpeg FLAC audio)
==========================================================================
Building audio filter chain for 96000Hz/2ch/s32le -> 0Hz/0ch/s32le...
[libaf] Adding filter dummy
[dummy] Was reinitialized: 96000Hz/2ch/s32le
[dummy] Was reinitialized: 96000Hz/2ch/s32le
Trying preferred audio driver 'alsa', options 'device=hw=2.1'
alsa-init: requested format: 96000 Hz, 2 channels, 19
alsa-init: using ALSA 1.0.27.2
alsa-init: setup for 1/2 channel(s)
alsa-init: using device hw:2,1
alsa-init: opening device in blocking mode
alsa-init: device reopened in blocking mode
[AO_ALSA] Format s32le is not supported by hardware, trying default.
alsa-init: got buffersize=192000
alsa-init: got period size 3000
alsa: 96000 Hz/2 channels/4 bpf/192000 bytes buffer/Signed 16 bit Little Endian
AO: [alsa] 96000Hz 2ch s16le (2 bytes per sample)
AO: Description: ALSA-0.9.x-1.x audio output
AO: Author: Alex Beregszaszi, Zsolt Barat <
[email protected]>
AO: Comment: under development
Building audio filter chain for 96000Hz/2ch/s32le -> 96000Hz/2ch/s16le...
[dummy] Was reinitialized: 96000Hz/2ch/s32le
[libaf] Adding filter format
[format] Changing sample format from little-endian 32-bit signed int to little-endian 16-bit signed int
[dummy] Was reinitialized: 96000Hz/2ch/s32le
[format] Changing sample format from little-endian 32-bit signed int to little-endian 16-bit signed int
Video: no video
Freeing 0 unused video chunks.
Starting playback...
[libaf] Reallocating memory in module format, old len = 0, new len = 65545
Increasing filtered audio buffer size from 0 to 65536
Increasing filtered audio buffer size from 65536 to 131072
..
I also tested to change in my .asoundrc to what was most stable for Kodi (the other sink falls out some times), and what it looks like that Kodi reads any way:
defaults.pcm.!card Audio
defaults.pcm.!device 1
Then I tested:
mplayer -v -format s24le
I got:
AUDIO: 96000 Hz, 2 ch, s32le, 2834.0 kbit/46.13% (ratio: 354244->768000)
Selected audio codec: [ffflac] afm: ffmpeg (FFmpeg FLAC audio)
==========================================================================
Building audio filter chain for 96000Hz/2ch/s32le -> 0Hz/0ch/s24le...
[libaf] Adding filter dummy
[dummy] Was reinitialized: 96000Hz/2ch/s32le
[libaf] Adding filter format
[format] Changing sample format from little-endian 32-bit signed int to little-endian 24-bit signed int
[dummy] Was reinitialized: 96000Hz/2ch/s32le
[format] Changing sample format from little-endian 32-bit signed int to little-endian 24-bit signed int
Trying preferred audio driver 'pulse', options '[none]'
AO: [pulse] Unsupported format, using default
AO: [pulse] Init failed: Connection refused
Failed to initialize audio driver 'pulse'
Trying preferred audio driver 'alsa', options '[none]'
alsa-init: requested format: 96000 Hz, 2 channels, 11
alsa-init: using ALSA 1.0.27.2
alsa-init: setup for 1/2 channel(s)
alsa-init: using device default
alsa-init: opening device in blocking mode
alsa-init: device reopened in blocking mode
alsa-init: got buffersize=98304
alsa-init: got period size 1024
alsa: 48000 Hz/2 channels/6 bpf/98304 bytes buffer/Signed 24 bit Little Endian in 3bytes
AO: [alsa] 48000Hz 2ch s24le (3 bytes per sample)
AO: Description: ALSA-0.9.x-1.x audio output
AO: Author: Alex Beregszaszi, Zsolt Barat <
[email protected]>
AO: Comment: under development
Building audio filter chain for 96000Hz/2ch/s32le -> 48000Hz/2ch/s24le...
[dummy] Was reinitialized: 96000Hz/2ch/s32le
[format] Changing sample format from little-endian 32-bit signed int to little-endian 24-bit signed int
[libaf] Adding filter lavcresample
[libaf] Adding filter format
[format] Changing sample format from little-endian 32-bit signed int to little-endian 16-bit signed int
[dummy] Was reinitialized: 48000Hz/2ch/s16le
[format] Changing sample format from little-endian 16-bit signed int to little-endian 24-bit signed int
[format] Changing sample format from little-endian 32-bit signed int to little-endian 16-bit signed int
[dummy] Was reinitialized: 48000Hz/2ch/s16le
[format] Changing sample format from little-endian 16-bit signed int to little-endian 24-bit signed int
Video: no video
Freeing 0 unused video chunks.
Starting playback...
[libaf] Reallocating memory in module format, old len = 0, new len = 65545
[libaf] Reallocating memory in module lavcresample, old len = 0, new len = 32773
[libaf] Reallocating memory in module format, old len = 0, new len = 49097
Increasing filtered audio buffer size from 0 to 49092
[libaf] Reallocating memory in module format, old len = 49097, new len = 49157
Increasing filtered audio buffer size from 49092 to 98244
Increasing filtered audio buffer size from 98244 to 99828
...
Conclusions:
The card (the dac) take 24 bit up to 192 kHz.
But if its float, it resample down to 16 bit!
If I do not go to the raw sink (hw), it change to 48 kHz
Kodi use the default think from aplay -L, what ever I have in my .asoundrc
If its 48 kHz then it down-sample to 16-bit what ever I tell it to use (like s24le).
... and then back to 24 bit again!
Funny card ore funny alsa?
EDIT: In my opinion, Kodi should use the alsa configuration I set (in .asoundrc) , it do not do it now.