[MPlayer-users] latm re-initing sound doesn't downmix when channel conf changes
Andy Furniss
andyqos at ukfsn.org
Thu Mar 7 12:54:13 CET 2013
Is it possible to re initialise sound "as if new" when for example a
latm aac stream switches from 2 to 6ch?
This is quite common on UK DVB-T2 HD channels and it seems depending on
setup someone listening in stereo will either just get L+R if their hw
is > 2ch capable or may loose sound in the case of a stereo card.
The below output looses sound as it seems that alsa doesn't make a
surround51 device for stereo only hardware.
I accept this could be my own fault as it's LFS and I know I can work
around by making my own downmixing surround51 in ~/.asoundrc, but that
won't help those with 5.1 who will expect a downmix by default or may
have explicitly requested one with -channels 2 but will loose channels
when a switch occurs.
Here's a very small latm sample that shows the issue.
http://www.andyqos.ukfsn.org/2chto51.latm
MPlayer SVN-r35933-4.7.2 (C) 2000-2013 MPlayer Team
CPU vendor name: AuthenticAMD max cpuid level: 5
CPU: AMD Phenom(tm) II X4 965 Processor (Family: 16, Model: 4, Stepping: 3)
extended cpuid-level: 27
extended cache-info: 33587520
Detected cache-line size is 64 bytes
CPUflags: MMX: 1 MMX2: 1 3DNow: 1 3DNowExt: 1 SSE: 1 SSE2: 1 SSE3: 1
SSSE3: 0 SSE4: 0 SSE4.2: 0 AVX: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowExt SSE SSE2
SSE3 CMOV
get_path('codecs.conf') -> '/home/andy/.mplayer/codecs.conf'
Reading optional codecs config file /home/andy/.mplayer/codecs.conf: No
such file or directory
Reading optional codecs config file /usr/local/etc/mplayer/codecs.conf:
No such file or directory
Using built-in default codecs.conf.
init_freetype
Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay
get_path('fonts') -> '/home/andy/.mplayer/fonts'
Configuration: --enable-xvmc
--extra-cflags=-I/home/andy/Src/Xorg-git/modular/include
--extra-libs=-L/home/andy/Src/Xorg-git/modular/lib
--extra-libs-mplayer=-L/home/andy/Src/Xorg-git/modular/lib
CommandLine: '-ao' 'alsa' '-mixer-channel' 'Master' '-v' '2chto51.latm'
Using nanosleep() timing
get_path('input.conf') -> '/home/andy/.mplayer/input.conf'
Reading optional input config file /home/andy/.mplayer/input.conf: No
such file or directory
Reading optional input config file /usr/local/etc/mplayer/input.conf: No
such file or directory
Falling back on default (hardcoded) input config
Setting up LIRC support...
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote
control.
get_path('2chto51.latm.conf') -> '/home/andy/.mplayer/2chto51.latm.conf'
Playing 2chto51.latm.
get_path('sub/') -> '/home/andy/.mplayer/sub/'
[file] File size is 198044 bytes
STREAM: [file] 2chto51.latm
STREAM: Description: File
STREAM: Author: Albeu
STREAM: Comment: based on the code from ??? (probably Arpi)
libavformat version 54.63.104 (internal)
Configuration: --enable-gpl --enable-postproc
LAVF_check: LOAS AudioSyncStream
Checking for YUV4MPEG2
ASF_check: not ASF guid!
Checking for REAL
Checking for SMJPEG
Searching demuxer type for filename 2chto51.latm ext: .latm
Checking for Nullsoft Streaming Video
Checking for MOV
Checking for VIVO
AVS: avs_check_file - attempting to open file 2chto51.latm
AVS: File is too big, aborting...
Checking for PVA
Checking for MPEG-TS...
TRIED UP TO POSITION 68317, FOUND 47, packet_size= 0, SEEMS A TS? 0
Checking for LMLM4 Stream Format
Invalid packet in LMLM4 stream: ch=22241 size=1150981
LMLM4 Stream Format not found
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: video)
MPEG packet stats: p100: 0 p101: 0 p1B6: 0 p12x: 0 sli: 0 a: 0 b: 0 c:
0 idr: 0 sps: 0 pps: 1 PES: 3 MP3: 363, synced: 0
Not MPEG System Stream format... (maybe Transport Stream?)
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: video)
MPEG packet stats: p100: 0 p101: 0 p1B6: 0 p12x: 0 sli: 0 a: 0 b: 0 c:
0 idr: 0 sps: 0 pps: 1 PES: 3 MP3: 363, synced: 0
Not MPEG System Stream format... (maybe Transport Stream?)
==> Found video stream: 0
ds_fill_buffer: EOF reached (stream: video)
LAVF_check: LOAS AudioSyncStream
libavformat file format detected.
[loas @ 0x8bf7d80]File position before avformat_find_stream_info() is 0
[aac_latm @ 0x8c82240]initializing latmctx
[loas @ 0x8bf7d80]max_analyze_duration 5000000 reached at 5013333
microseconds
[loas @ 0x8bf7d80]Estimating duration from bitrate, this may be inaccurate
[loas @ 0x8bf7d80]File position after avformat_find_stream_info() is 157696
==> Found audio stream: 0
======= WAVE Format =======
Format Tag: 20557 (0x504D)
Channels: 2
Samplerate: 48000
avg byte/sec: 0
Block align: 1
bits/sample: 0
cbSize: 2
Unknown extra header dump: [11] [90]
==========================================================================
[lavf] stream 0: audio (aac_latm), -aid 0
LAVF: 1 audio and 0 video streams found
LAVF: build 3555176
Load subtitles in ./
get_path('sub/') -> '/home/andy/.mplayer/sub/'
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
dec_audio: Allocating 1536000 + 131072 = 1667072 bytes for output buffer.
FFmpeg's libavcodec audio codec
libavcodec version 54.92.100 (internal)
Configuration: --enable-gpl --enable-postproc
INFO: libavcodec "aac_latm" init OK!
AUDIO: 48000 Hz, 2 ch, floatle, 0.0 kbit/0.00% (ratio: 0->384000)
Selected audio codec: [fflatm] afm: ffmpeg (FFmpeg AAC in LATM)
==========================================================================
Building audio filter chain for 48000Hz/2ch/floatle -> 0Hz/0ch/??...
[libaf] Adding filter dummy
[dummy] Was reinitialized: 48000Hz/2ch/floatle
[dummy] Was reinitialized: 48000Hz/2ch/floatle
Trying preferred audio driver 'alsa', options '[none]'
alsa-init: requested format: 48000 Hz, 2 channels, 1d
alsa-init: using ALSA 1.0.25
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
[AO_ALSA] Format floatle is not supported by hardware, trying default.
alsa-init: got buffersize=96000
alsa-init: got period size 1416
alsa: 48000 Hz/2 channels/4 bpf/96000 bytes buffer/Signed 16 bit Little
Endian
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
AO: Description: ALSA-0.9.x-1.x audio output
AO: Author: Alex Beregszaszi, Zsolt Barat <joy at streamminister.de>
AO: Comment: under development
Building audio filter chain for 48000Hz/2ch/floatle -> 48000Hz/2ch/s16le...
[dummy] Was reinitialized: 48000Hz/2ch/floatle
[libaf] Adding filter format
[format] Changing sample format from little-endian 32-bit float to
little-endian 16-bit signed int
[format] Accelerated little-endian 32-bit float to little-endian 16-bit
signed int conversion
[dummy] Was reinitialized: 48000Hz/2ch/floatle
[format] Changing sample format from little-endian 32-bit float to
little-endian 16-bit signed int
[format] Accelerated little-endian 32-bit float to little-endian 16-bit
signed int conversion
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 98048
A: 1.4 (01.3) of 0.0 (unknown) 0.7%
[aac_latm @ 0x8c82240]audio config changed
alsa-uninit: pcm closed
Building audio filter chain for 48000Hz/6ch/floatle -> 0Hz/0ch/??...
[dummy] Was reinitialized: 48000Hz/6ch/floatle
[format] Changing sample format from little-endian 32-bit float to
little-endian 16-bit signed int
[format] Accelerated little-endian 32-bit float to little-endian 16-bit
signed int conversion
[dummy] Was reinitialized: 48000Hz/6ch/floatle
[format] Changing sample format from little-endian 32-bit float to
little-endian 16-bit signed int
[format] Accelerated little-endian 32-bit float to little-endian 16-bit
signed int conversion
Trying preferred audio driver 'alsa', options '[none]'
alsa-init: requested format: 48000 Hz, 6 channels, 9
alsa-init: using ALSA 1.0.25
alsa-init: device set to surround51
alsa-init: using device surround51
alsa-init: opening device in blocking mode
alsa-init: device reopened in blocking mode
[AO_ALSA] Unable to get initial parameters: Invalid argument
Failed to initialize audio driver 'alsa'
Could not open/initialize audio device -> no sound.
Uninit audio filters...
[libaf] Removing filter dummy
[libaf] Removing filter format
Uninit audio: ffmpeg
vo: x11 uninit called but X11 not initialized..
Exiting... (Quit)
More information about the MPlayer-users
mailing list