Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 May 2023 21:53:46 +0000
From:      bugzilla-noreply@freebsd.org
To:        multimedia@FreeBSD.org
Subject:   [Bug 271559] [sound] [snd_uaudio] Creative Katana V2X garbled audio
Message-ID:  <bug-271559-12827-0At9naiek4@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-271559-12827@https.bugs.freebsd.org/bugzilla/>
References:  <bug-271559-12827@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271559

--- Comment #10 from Florian Walpen <dev@submerge.ch> ---
(In reply to Emanuel Haupt from comment #8)

Ok, this is what I think is happening.
Your device expects 6 (5.1) channels of 24bit samples at 48kHz:

> uaudio1: <Creative Technology Ltd SB Katana V2X, class 239/2, rev 2.00/10=
.10, addr 7> on usbus5
> uaudio1: Play[0]: 48000 Hz, 6 ch, 24-bit S-LE PCM format, 2x8ms buffer.
> uaudio1: Record[0]: 48000 Hz, 2 ch, 24-bit S-LE PCM format, 2x8ms buffer.

The default pcm vchanformat (man sound) is set to 2 channel 16bit at 48kHz:

> dev.pcm.8.play.vchanformat: s16le:2.0
> dev.pcm.8.play.vchanrate: 48000
> dev.pcm.8.play.vchanmode: fixed

And the default vchan conversion path looks good to me:

> {userland} -> feeder_mixer(0x00200010) -> feeder_format(0x00200010 -> 0x0=
0201000) -> feeder_matrix(2.0 -> 5.1) -> feeder_format(0x08601000 -> 0x0861=
0000) -> {hardware}

Which means 2 channel 16bit goes into volume mixer, format conversion to 32=
bit,
matrix expansion from 2 to 5.1 channels, format conversion to 24bit, then to
the hardware.

The conversion chain for your MP3 playback has a problem:

> {userland} -> feeder_root(0x00200010) -> feeder_volume(0x00200010) -> fee=
der_rate(0x00200010 q:1 44100 -> 48000) -> {hardware}

There's sample rate conversion from 44.1kHz to 48kHz, but no expansion to 5=
.1
channels, and no format conversion to 24bit.


Things you could try before going the virtual_oss route:
 * Play something at 48kHz sample rate, like most videos. It may use the
default vchan conversion.
 * Play 32bit samples, it simplifies conversion for matrix expansion. Like =
"mpv
--audio-format=3Ds32 file.mp3".
 * Set "sysctl dev.pcm.8.play.vchanformat=3Ds32le:2.0".
 * Set "sysctl dev.pcm.8.play.vchanformat=3Ds32le:5.1" or even "sysctl
dev.pcm.8.play.vchanformat=3Ds24le:5.1".

You can check /dev/sndstat again for the conversion chain. Invoking players
from CLI usually prints sample rate and format used. I'm not sure how well =
they
cope with 5.1 channels though.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-271559-12827-0At9naiek4>