History log of /freebsd/sys/dev/sound/usb/uaudio.c (Results 1 – 25 of 322)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 18250ec6 06-Dec-2024 John Baldwin <jhb@FreeBSD.org>

Replace calls to bus_generic_attach with bus_attach_children

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D47675


Revision tags: release/14.2.0
# 516a9c02 03-Nov-2024 Christos Margiolis <christos@FreeBSD.org>

sound: Make device registration more intuitive

The way a sound driver currently registers to sound(4) is using the
following sequence of function calls:

1. pcm_register() to initialize snddev_info.

sound: Make device registration more intuitive

The way a sound driver currently registers to sound(4) is using the
following sequence of function calls:

1. pcm_register() to initialize snddev_info.
2. pcm_addchan() calls to create the device's primary channels.
3. pcm_setstatus() to do the final setup.

While using 3 different functions in a specific order might not be very
elegant, this pattern cannot be easily avoided. However, pcm_register()
and pcm_setstatus() are especially confusing, since one would
intuitively expect:

1. pcm_register() to actually do the registration, as opposed to a basic
initialization.
2. pcm_setstatus() to, as the name suggests, set some kind of status, as
opposed to finalizing the registration.

This patch renames pcm_register() to pcm_init(), and pcm_setstatus() to
pcm_register(). Drivers are modified accordingly.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D47325

show more ...


Revision tags: release/13.4.0
# 59121599 03-Sep-2024 Zhenlei Huang <zlei@FreeBSD.org>

sound: Stop checking for failures from malloc(M_WAITOK)

Reviewed by: emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45852


# 5b56413d 25-Jul-2024 Warner Losh <imp@FreeBSD.org>

newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANY

Sponsored by: Netflix


# 3402d474 06-Jul-2024 Christos Margiolis <christos@FreeBSD.org>

snd_uaudio: Remove unused sc_sndstat sbuf

This information is also printed to dmesg(8) on attach.

Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch, markj
Differen

snd_uaudio: Remove unused sc_sndstat sbuf

This information is also printed to dmesg(8) on attach.

Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch, markj
Differential Revision: https://reviews.freebsd.org/D45771

show more ...


Revision tags: release/14.1.0
# 923e0040 06-May-2024 Christos Margiolis <christos@FreeBSD.org>

sound: Move chip.h contents to pcm/sound.h

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D44997


# 44e128fe 11-Apr-2024 Christos Margiolis <christos@FreeBSD.org>

sound: Implement asynchronous device detach

Hot-unplugging a sound device, such as a USB sound card, whilst being
consumed by an application, results in an infinite loop until either the
application

sound: Implement asynchronous device detach

Hot-unplugging a sound device, such as a USB sound card, whilst being
consumed by an application, results in an infinite loop until either the
application closes the device's file descriptor, or the channel
automatically times out after hw.snd.timeout seconds. In the case of a
detach however, the timeout approach is still not ideal, since we want
all resources to be released immediatelly, without waiting for N seconds
until we can use the bus again.

The timeout mechanism works by calling chn_sleep() in chn_read() and
chn_write() (see pcm/channel.c) in order to send the thread to sleep,
using cv_timedwait_sig(). Since chn_sleep() sets the CHN_F_SLEEPING flag
while waiting for cv_timedwait_sig() to return, we can test this flag in
pcm_unregister() (called during detach) and wakeup the sleeping
thread(s) to immediately kill the channel(s) being consumed.

Sponsored by: The FreeBSD Foundation
MFC after: 2 months
PR: 194727
Reviewed by: dev_submerge.ch, bapt, markj
Differential Revision: https://reviews.freebsd.org/D43545

show more ...


# 365067e9 05-Apr-2024 Christos Margiolis <christos@FreeBSD.org>

Revert "sound: Implement asynchronous device detach"

This reverts commit 9eff58c6d52b66eb8abe7f724dabcd804a566df4.

We are reverting dc831e93bad6 ("sound: Get rid of snd_clone and use
DEVFS_CDEVPRIV

Revert "sound: Implement asynchronous device detach"

This reverts commit 9eff58c6d52b66eb8abe7f724dabcd804a566df4.

We are reverting dc831e93bad6 ("sound: Get rid of snd_clone and use
DEVFS_CDEVPRIV(9)"), so revert this commit as well since it depends
dc831e93bad6.

show more ...


# 9eff58c6 31-Mar-2024 Christos Margiolis <christos@FreeBSD.org>

sound: Implement asynchronous device detach

Hot-unplugging a sound device, such as a USB sound card, whilst being
consumed by an application, results in an infinite loop until either the
application

sound: Implement asynchronous device detach

Hot-unplugging a sound device, such as a USB sound card, whilst being
consumed by an application, results in an infinite loop until either the
application closes the device's file descriptor, or the channel
automatically times out after hw.snd.timeout seconds. In the case of a
detach however, the timeout approach is still not ideal, since we want
all resources to be released immediatelly, without waiting for N seconds
until we can use the bus again.

The timeout mechanism works by calling chn_sleep() in chn_read() and
chn_write() (see pcm/channel.c) in order to send the thread to sleep,
using cv_timedwait_sig(). Since chn_sleep() sets the CHN_F_SLEEPING flag
while waiting for cv_timedwait_sig() to return, we can test this flag in
pcm_unregister() (called during detach) and wakeup the sleeping
thread(s) to immediately kill the channel(s) being consumed.

Sponsored by: The FreeBSD Foundation
MFC after: 2 months
PR: 194727, 278055, 202275, 220949, 272286
Reviewed by: dev_submerge.ch, markj
Differential Revision: https://reviews.freebsd.org/D43545

show more ...


Revision tags: release/13.3.0
# a9341f0f 27-Feb-2024 Florian Walpen <dev@submerge.ch>

snd_uaudio(4): Fix sample rate selection after 42fdcd9fd917.

The sample rate selection of snd_uaudio(4) at runtime was implicitly
relying on a specific order in the device config list. In case a def

snd_uaudio(4): Fix sample rate selection after 42fdcd9fd917.

The sample rate selection of snd_uaudio(4) at runtime was implicitly
relying on a specific order in the device config list. In case a default
was set through the hw.usb.uaudio.default_rate sysctl tunable, commit
42fdcd9fd917 removed a duplicate sample rate entry from that list, which
inadvertently broke sample rate selection at runtime. Implement sample
rate selection in a way that works for any order in the device config
list.

Reported by: Lexi Winter <lexi@le-fay.org>
MFC after: 1 week
Reviewed by: christos
Differential Revision: https://reviews.freebsd.org/D44051

show more ...


# f60e99f4 12-Feb-2024 Christos Margiolis <christos@FreeBSD.org>

snd_uaudio: mark selected configurations

snd_uaudio(4) selects the first maching rate/channel/bit/format/buffer
configuration for use during attach, even though it will print the rest
of the support

snd_uaudio: mark selected configurations

snd_uaudio(4) selects the first maching rate/channel/bit/format/buffer
configuration for use during attach, even though it will print the rest
of the supported configurations detected. To make this clear, mark the
selected playback and recording configurations with a "selected" string.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D43766

show more ...


# 42fdcd9f 12-Feb-2024 Florian Walpen <dev@submerge.ch>

snd_uaudio(4): Fix config detection with defaults set.

Let the USB audio descriptor iteration detect configurations with more
channels and larger sample size, even when the following global sysctl
t

snd_uaudio(4): Fix config detection with defaults set.

Let the USB audio descriptor iteration detect configurations with more
channels and larger sample size, even when the following global sysctl
tunables are set to a lower value:

hw.usb.uaudio.default_channels hw.usb.uaudio.default_bits

This improves utility and is closer to the meaning of default.

Also, do not create duplicate sample rate entries.

MFC after: 2 weeks
Reviewed by: christos
Differential Revision: https://reviews.freebsd.org/D43679

show more ...


# b2e97edf 12-Feb-2024 Florian Walpen <dev@submerge.ch>

snd_uaudio(4): Adapt buffer length to buffer_ms tunable.

Adapt the length of the driver side audio buffer to the USB transfer
interval, which is adjustable through the buffer_ms tunable. This
elimin

snd_uaudio(4): Adapt buffer length to buffer_ms tunable.

Adapt the length of the driver side audio buffer to the USB transfer
interval, which is adjustable through the buffer_ms tunable. This
eliminates unnecessary latency in USB audio playback.

To reduce power consumption caused by frequent CPU wakeups, increase the
default buffer_ms value to 4ms. In combination with adaptive buffer
length, this still results in less roundtrip latency compared to the
previous 2ms default.

Extend the buffer_ms value range to 1ms for low latency applications.

MFC after: 2 weeks
Reviewed by: christos
Differential Revision: https://reviews.freebsd.org/D41942

show more ...


# f7d3d0a4 22-Jan-2024 Christos Margiolis <christos@FreeBSD.org>

sound: use device_set_descf() to set device descriptions

Commit 6b6914c1e21b introduced a printf-like version of
device_set_desc(), so use it to simplify device description setting in
the audio stac

sound: use device_set_descf() to set device descriptions

Commit 6b6914c1e21b introduced a printf-like version of
device_set_desc(), so use it to simplify device description setting in
the audio stack.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: dev_submerge.ch, markj
Differential Revision: https://reviews.freebsd.org/D43467

show more ...


# 06a43763 16-Jan-2024 Christos Margiolis <christos@FreeBSD.org>

snd_uaudio: prefix module declaration with "snd_"

Although the module is compiled "snd_uaudio.ko", follow the rest of the
sound modules' naming convention in the declaration as well.

Sponsored by:

snd_uaudio: prefix module declaration with "snd_"

Although the module is compiled "snd_uaudio.ko", follow the rest of the
sound modules' naming convention in the declaration as well.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D43396

show more ...


# 837cd192 16-Jan-2024 Christos Margiolis <christos@FreeBSD.org>

sound: remove PCM_KLDSTRING() and fix status strings

PCM_KLDSTRING() prints the kernel module associated with a given audio
device only when that module is not compiled in. Get rid of
PCM_KLDSTRING(

sound: remove PCM_KLDSTRING() and fix status strings

PCM_KLDSTRING() prints the kernel module associated with a given audio
device only when that module is not compiled in. Get rid of
PCM_KLDSTRING() altogether and print the driver name (even for modules
that are compiled in) instead, as it implies the module as well.

While here, convert all status strings to the following dmesg-like
format:

[<port|mem> <irq>] on <driver>

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: markj, imp
Differential Revision: https://reviews.freebsd.org/D43349

show more ...


# 18d87fe4 16-Jan-2024 Christos Margiolis <christos@FreeBSD.org>

snd_uaudio: provide information about the device name and attached driver

Unlike the other sound drivers, snd_uaudio(4) doesn't provide
information about the device's description and the driver it's

snd_uaudio: provide information about the device name and attached driver

Unlike the other sound drivers, snd_uaudio(4) doesn't provide
information about the device's description and the driver it's attached
to. A side-effect of this is that applications such as mixer(8), that
fetch these strings through the OSS API's SNDCTL_CARDINFO ioctl will
show a USB audio device as:

pcm0:mixer: <USB Audio> at ? kld snd_uaudio

This patch replaces the generic "USB Audio" description with the
device's actual manufacturer and product strings, and the "at ?" string
with the driver it's attached to:

pcm0:mixer: <Focusrite Scarlett Solo USB> at uaudio0 kld snd_uaudio

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: markj, emaste
Differential Revision: https://reviews.freebsd.org/D43347

show more ...


Revision tags: release/14.0.0
# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 71625ec9 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c comment pattern

Remove /^/[*/]\s*\$FreeBSD\$.*\n/


# b61a5730 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSD

The SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catch
up to that fact and revert to their recommended match of BS

spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSD

The SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix

show more ...


Revision tags: release/13.2.0, release/12.4.0, release/13.1.0
# 3390adfe 07-May-2022 John Baldwin <jhb@FreeBSD.org>

sound: Remove unused devclass arguments to DRIVER_MODULE.


# f190f8d1 20-Feb-2022 Hans Petter Selasky <hselasky@FreeBSD.org>

snd_uaudio(4): Set hardware buffering to the minimum by default.

Improves the audio experience when using applications like
audio/jamulus and audio/hpsjam .

MFC after: 1 week
Sponsored by: NVIDIA N

snd_uaudio(4): Set hardware buffering to the minimum by default.

Improves the audio experience when using applications like
audio/jamulus and audio/hpsjam .

MFC after: 1 week
Sponsored by: NVIDIA Networking

show more ...


# 2fcd7d38 17-Dec-2021 Hans Petter Selasky <hselasky@FreeBSD.org>

snd_uaudio(4): Loosen up the USB MIDI permissions.

This makes USB MIDI more userfriendly for desktop users.

PR: 260489
MFC after: 1 week
Sponsored by: NVIDIA Networking


Revision tags: release/12.3.0
# 11f09b17 09-Nov-2021 Hans Petter Selasky <hselasky@FreeBSD.org>

snd_uaudio(4): Fix string index computations for iFeature.

This allows the iFeature strings to be properly read by the snd_uaudio(4) driver,
when parsing the audio feature unit descriptors.

Submitt

snd_uaudio(4): Fix string index computations for iFeature.

This allows the iFeature strings to be properly read by the snd_uaudio(4) driver,
when parsing the audio feature unit descriptors.

Submitted by: Zhichao1.Li@dell.com
MFC after: 1 week
Sponsored by: NVIDIA Networking

show more ...


# 3d6ed119 07-Nov-2021 Gordon Bergling <gbe@FreeBSD.org>

usb_audio: Fix a typo in a source code comment

- s/maxium/maximum/

MFC after: 3 days


12345678910>>...13