On Thu, Sep 22, 2022 at 04:31:58PM +0000, adr wrote:
> Hi,
>
> first of all, I've never contributed to the xine project, and
> I don't have any experience with sndio, so bear with me...
>
> Frustrated with the bad sound playing a 6 channels aac audio I decided to
> take a look. The device is a usb one:
>
> $ dmesg | grep -i audio
> uaudio0 at uhub2 port 3 configuration 1 interface 1 "GeneralPlus USB Audio Device" rev 1.10/1.00 addr 6
> uaudio0: class v1, full-speed, sync, channels: 2 play, 1 rec, 8 ctls
> audio0 at uaudio0
> uhidev2 at uhub2 port 3 configuration 1 interface 3 "GeneralPlus USB Audio Device" rev 1.10/1.00 addr 6
>
> It has only 2 channels for playback.
>
> The file has 5.1 aac audio:
> $ ffprobe file.mp4
> [...]
> Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 224 kb/s (default)
> [...]
>
> Xine's ffmpegaudio plugin is supposed to do downmix (please, correct
> me if I'm wrong), but:
>
> $ xine --verbose=2 file.mp4
> [...]
> audio_out: ao_open (0x585415540)
> audio_sndio_out: ao_sndio_open bits=16 rate=48000, mode=128
> audio_sndio_out: ao_sndio_open 6 channels output
> [...]
>
> The code in xine-lib-1.2.12/src/audio_out/audio_sndio_out.c by Brad
> Smith is following the recommendations at sio_open(3), there is no
> problem there.
>
> sio_getpar() is returning 6 channels as valid, so the sound ends
> messed up. The right speaker gets mostly ambient sound and the
> voices are almost only audible through the left speaker.
>
> mplayer and mpv have means to force downmix, but xine is the only
> media player which can play 1080p h264 video with a decent performance
> (if the bitrate is not too high) on an rpi4 (no hardware acceleration,
> cpu at 2.2Gz)
>
> One workaround for this particular case could be adding the
> configuration setting "audio.output.speaker_arrangement" to
> audio_sndio_out.c.
>
> I'm using the last snapshot:
>
> $ doas sysupgrade -ns
> Fetching from https://ftp.OpenBSD.org/pub/OpenBSD/snapshots/arm64/
> SHA256.sig 100% |************************************************| 1544
> 00:00 Signature Verified
> Already on latest snapshot.
>
> base72.tgz 21-Sep-2022 11:41 262659517
>
> Is this behaviour normal and I'm just missing something?
> Some thoughts?
Hi,
This is a known problem. While mpv and mplayer have options to turn
the downmixing, it's not OK this to be manual.
IMHO, the most appropriate (and probably simplest) is to extend sndiod
to do the surround conversions, so the problem would be solved at
system level and all players would benefit (as we do for all other
conversions, btw). Less code, less bugs.
Furthermore, neither the audio subsystem, nor the program can guess
which speakers are plugged (and powered) or how they are placed. So
there will be a knob for this. Better to have a system-level knob than
to have to configure every program.
No comments:
Post a Comment