Re: wskbd_set_mixervolume

2022-02-07 Thread Alexandre Ratchov
On Mon, Feb 07, 2022 at 06:58:40PM +0100, Anton Lindqvist wrote: > On Mon, Feb 07, 2022 at 11:43:43AM +0100, Alexandre Ratchov wrote: > > On Sat, Feb 05, 2022 at 06:30:43PM +0100, Claudio Jeker wrote: > > > On Sat, Feb 05, 2022 at 12:28:08PM +0100, Mark Kettenis wrote: > >

Re: wskbd_set_mixervolume

2022-02-07 Thread Alexandre Ratchov
On Mon, Feb 07, 2022 at 06:55:21PM +0100, Anton Lindqvist wrote: > On Mon, Feb 07, 2022 at 11:21:43AM +0100, Alexandre Ratchov wrote: > > On Sun, Feb 06, 2022 at 08:40:35AM +0100, Anton Lindqvist wrote: > > > > > > Polished diff. I'm omitting a nec

Re: wskbd_set_mixervolume

2022-02-09 Thread Alexandre Ratchov
On Tue, Feb 08, 2022 at 06:59:39PM +0100, Anton Lindqvist wrote: > On Tue, Feb 08, 2022 at 07:32:38AM +0100, Alexandre Ratchov wrote: > > On Mon, Feb 07, 2022 at 06:55:21PM +0100, Anton Lindqvist wrote: > > > On Mon, Feb 07, 2022 at 11:21:43AM +0100, Alexandre Ratchov wrote: >

Re: wskbd_set_mixervolume

2022-02-11 Thread Alexandre Ratchov
On Thu, Feb 10, 2022 at 04:53:59PM +0100, Anton Lindqvist wrote: > On Wed, Feb 09, 2022 at 09:13:58AM +0100, Alexandre Ratchov wrote: > > On Tue, Feb 08, 2022 at 06:59:39PM +0100, Anton Lindqvist wrote: > > > On Tue, Feb 08, 2022 at 07:32:38AM +0100, Alexandre Ratchov wrote: >

Re: constify *_hw_if

2022-03-21 Thread Alexandre Ratchov
On Mon, Mar 21, 2022 at 12:09:54PM +, Miod Vallat wrote: > The following diff makes {audio,midi,radio,video}_hw_if structs in the > kernel const, in order to move them to rodata. > ok ratchov

sndio: add sio_flush() function

2022-03-23 Thread Alexandre Ratchov
Most audio/video players do a stop/start cycle whenever the play position is changed, track is changed, etc. Currently, stopping drains the play buffer, which by default is very large (to workaround very long kernel non-preemptive code-paths). This makes player controls sluggish. This diff adds a

Re: sndio: add sio_flush() function

2022-03-23 Thread Alexandre Ratchov
On Thu, Mar 24, 2022 at 07:11:42AM +0100, Alexandre Ratchov wrote: > Most audio/video players do a stop/start cycle whenever the play > position is changed, track is changed, etc. Currently, stopping drains > the play buffer, which by default is very large (to workaround very > lon

Re: sndio: add sio_flush() function

2022-04-28 Thread Alexandre Ratchov
On Wed, Apr 27, 2022 at 10:48:42PM +0200, Caspar Schutijser wrote: > Hi, > > On Thu, Mar 24, 2022 at 07:11:42AM +0100, Alexandre Ratchov wrote: > > Most audio/video players do a stop/start cycle whenever the play > > position is changed, track is changed, etc. Currently, st

Re: speaker(4): unhook driver and manpage from build

2022-04-29 Thread Alexandre Ratchov
On Thu, Apr 28, 2022 at 06:34:00AM -0500, Scott Cheloha wrote: > speaker(4) is a whimsical thing, but I don't think we should have a > dedicated chiptune interpreter in the kernel. > > This patch unhooks the driver and the manpage from the build. The > driver is built for alpha, amd64, and i386.

Re: Dumping uaudio(4) frames

2018-02-20 Thread Alexandre Ratchov
On Tue, Feb 20, 2018 at 03:05:33PM +0100, Martin Pieuchot wrote: > Diff below implements the USBPcap interface for dumping USB isochronous > frames. It can be very useful to analyze what the stack is doing. Note > that tcpdump(8)'s snaplen default is too small to capture such frames. I > used the

envy: set base DMA pointers when DMA starts

2018-03-16 Thread Alexandre Ratchov
The allocm() functions are supposed to allocate memory and it's bad style to access the hardware there. The diff moves the DMA base pointers setup to the trigger_xxx() routines which start DMA. No behavior change. OK? Index: envy.c =

envy: fix suspend/resume

2018-03-16 Thread Alexandre Ratchov
The chip is in an undefined state after a suspend/resume cycle so sound doesn't comme back. Most of the resume work is done in the audio(4) layer, so, to fix suspend/resume we just need to reinitize the device. OK? Index: envy.c ===

add mixer-specific suspend/resume code to audio(4)

2018-03-17 Thread Alexandre Ratchov
Volume settings are supposed to be preserved during suspend/resume. Currently certain drivers (ex. azalia, cmpci) have their own mixer save/restore code, others (ex. envy) lack the save/restore code. Rather that trying to fix every single audio driver, add the mixer save/restore code to the audio(

Re: config -e vs ugen(4) fix

2018-04-26 Thread Alexandre Ratchov
On Tue, Apr 24, 2018 at 02:00:02PM +0200, Martin Pieuchot wrote: > Instead of having to disable USB drivers to force some devices to attach > as ugen(4), we can whitelist them. Diff below does that by adding a new > option to usbdevs(8): > > # usbdevs -l 7047:04ca -l a001:1199 > > The logic is

Re: [patch] add missing pledge to aucat(1).

2018-05-04 Thread Alexandre Ratchov
On Thu, May 03, 2018 at 09:48:13PM +0200, Jesper Wallin wrote: > Hi all, > > I just noticed that aucat(1) is missing pledge. However, I'm aware that > aucat(1) is talking to sndiod(8), which is being pledged properly. But > seeing that programs like yes(1) is properly pledged, I don't see any >

Re: [patch] add missing pledge to aucat(1).

2018-05-04 Thread Alexandre Ratchov
On Fri, May 04, 2018 at 11:51:09AM +0200, Jesper Wallin wrote: > On Fri, May 04, 2018 at 09:03:38AM +0200, Alexandre Ratchov wrote: > > Thanks. The promise list to use audio and/or midi is in the > > sio_open(2) man page, so the following seem to be needed: stdio, > > audio

Re: [patch] add missing pledge to aucat(1).

2018-05-06 Thread Alexandre Ratchov
On Fri, May 04, 2018 at 05:31:22PM +0200, Theo Buehler wrote: > On Fri, May 04, 2018 at 09:03:38AM +0200, Alexandre Ratchov wrote: > > On Thu, May 03, 2018 at 09:48:13PM +0200, Jesper Wallin wrote: > > > Hi all, > > > > > > I just noticed that aucat(1) is miss

Re: [patch] add missing pledge to aucat(1).

2018-05-13 Thread Alexandre Ratchov
On Mon, May 07, 2018 at 08:34:32PM +0200, Jesper Wallin wrote: > On Mon, May 07, 2018 at 03:30:19PM +0200, Jesper Wallin wrote: > > I've still not been able to test this using MIDI devices, but everything > > else seems to work as far as I can tell. > > As Theo (tb@) kindly pointed out to me off-l

Re: ksh "clear-screen" editing command

2018-06-05 Thread Alexandre Ratchov
On Wed, Jun 06, 2018 at 12:20:50AM +0200, Alexander Hall wrote: > This adds a "clear-screen" editing command to the emacs editing mode. > This is the same name as bash and zsh uses, and then I stopped looking. > > The default binding of 'redraw' remains for ^L, for now anyway, so > you'll need to

Re: sndiod.8: document how to start with multiple devices

2018-06-24 Thread Alexandre Ratchov
On Sun, Jun 24, 2018 at 05:38:11PM +0200, Landry Breuil wrote: > On Sun, Jun 24, 2018 at 05:23:46PM +0200, Landry Breuil wrote: > > Hi, > > > > here's an attempt at documenting the usecase i always forget when > > playing with multiple devices/mics. Feedback/reworking/tweaks welcome. > > New vers

Re: uaudio: fix detection of a bunch of logitech webcams

2018-07-07 Thread Alexandre Ratchov
On Fri, Jul 06, 2018 at 01:52:57PM +0200, Landry Breuil wrote: > > New diff adding the C250 which also exhibits the same issue. I have an > okay from mpi@ on the previous diff, but i'd like actual reports that it > makes the audio device actually working (mine doesnt now, i'm digging > into it, bu

Re: uaudio: fix detection of a bunch of logitech webcams

2018-07-07 Thread Alexandre Ratchov
On Fri, Jul 06, 2018 at 02:56:37PM +0200, Landry Breuil wrote: > > > > To test: > > > > sysctl kern.audio.record=1 > > aucat -f rsnd/1 -o /tmp/foo.wav (if the uaudio device attaches as audio1) > > > > If this actually records sound (mplayer /tmp/foo.wav to check), you've > > won. if foo.wav is 6

remove unused header from sys/dev/usb/umidi

2018-12-31 Thread Alexandre Ratchov
Found by jcs@. ok? Index: umidi.c === RCS file: /cvs/src/sys/dev/usb/umidi.c,v retrieving revision 1.51 diff -u -p -r1.51 umidi.c --- umidi.c 16 Nov 2018 11:55:56 - 1.51 +++ umidi.c 31 Dec 2018 20:08:57 - @@ -44,

Re: new USB audio class v2.0 driver

2019-01-01 Thread Alexandre Ratchov
On Tue, Jan 01, 2019 at 11:02:39PM -, Christian Weisgerber wrote: > On 2018-12-31, Alexandre Ratchov wrote: > > > Our current USB sub-system has limitations that currently allow only > > the following combinations: > > - USB v2 devices on ehci(4) only > > - U

Re: new USB audio class v2.0 driver

2019-01-23 Thread Alexandre Ratchov
On Wed, Jan 23, 2019 at 01:23:05PM -0200, Martin Pieuchot wrote: > On 31/12/18(Mon) 16:58, Alexandre Ratchov wrote: > > Hi, > > > > Here's a new driver for both USB audio class (UAC) v1.0 and v2.0 > > devices, it would replace the current one. It focus

uhci(4): fix delayed completions for isochronous transfers

2019-02-06 Thread Alexandre Ratchov
When an isochronous transfer of n frames is scheduled, the last frame i.e. frame number (n - 1) is set to generate an interrupt. To figure out which transfer generated the interrupt, the interrupt handler iterates over all outstanding transfers and checks if the last TD of the transfer is active.

Re: new USB audio class v2.0 driver

2019-04-26 Thread Alexandre Ratchov
On Thu, Apr 25, 2019 at 02:49:35AM -0700, alexh wrote: > Hi, > > > Alexandre Ratchov-2 wrote > > If you have an audio device that is class compliant (aka vendor claims > > it's "driverless" on MacOS) *and* one of the above host/hub/device > > com

inteldrm: Use "the flush page mechanism" only on chips having it.

2019-05-08 Thread Alexandre Ratchov
In the intel_gtt_chipset_setup() routine, called at initialization, the driver maps pci space for certain chip models only, but later in intel_gtt_chipset_flush() it calls bus_space_write() on it in cases it's not initialized. This results in crashes during boot with "Pineview" generation chips, w

Re: inteldrm: Use "the flush page mechanism" only on chips having it.

2019-05-09 Thread Alexandre Ratchov
On Thu, May 09, 2019 at 10:26:52PM +1000, Jonathan Gray wrote: > On Thu, May 09, 2019 at 07:45:37AM +0200, Alexandre Ratchov wrote: > > In the intel_gtt_chipset_setup() routine, called at initialization, > > the driver maps pci space for certain chip models onl

Re: scheduler small changes

2019-05-17 Thread Alexandre Ratchov
On Wed, May 15, 2019 at 09:05:32AM -0500, Amit Kulkarni wrote: > > This diff survived multiple tens of kernel builds, a bsd.sp build, > bsd.rd build, a bsd.mp without these changes, userland/xenocara, a > make regress a few days ago all on 3 desktops on amd64. Ran under > all possible scenarios li

Re: envy(4): *sleep(9) -> *sleep_nsec(9)

2019-11-23 Thread Alexandre Ratchov
On Fri, Nov 22, 2019 at 06:41:25PM -0600, Scott Cheloha wrote: > ok? > sure, thanks

Re: bktr(4): tsleep(9) -> tsleep_nsec(9)

2019-12-16 Thread Alexandre Ratchov
On Sun, Dec 15, 2019 at 10:28:32PM -0600, Scott Cheloha wrote: > I don't have any of these cards, but these are straightforward conversions. > > ok? > ok

Re: midi(4): *sleep(9) -> *sleep_nsec(9)

2019-12-18 Thread Alexandre Ratchov
On Tue, Dec 17, 2019 at 07:09:02PM -0600, Scott Cheloha wrote: > The only conversion I'm having trouble with is the tsleep(). > The comment says "20ms", but then we use some arithmetic > to derive a count of ticks. > > Given > > hz * MIDI_MAXWRITE / MIDI_RATE > > You have hz ticks/second,

Re: midi(4): *sleep(9) -> *sleep_nsec(9)

2019-12-19 Thread Alexandre Ratchov
On Wed, Dec 18, 2019 at 10:41:56AM -0600, Scott Cheloha wrote: > On Wed, Dec 18, 2019 at 09:54:43AM +0100, Alexandre Ratchov wrote: > > On Tue, Dec 17, 2019 at 07:09:02PM -0600, Scott Cheloha wrote: > > > The only conversion I'm having trouble with is the tsleep(). >

Re: bktr(4) (again): tsleep(9) -> tsleep_nsec(9)

2020-01-10 Thread Alexandre Ratchov
On Fri, Jan 10, 2020 at 08:23:14PM -0600, Scott Cheloha wrote: > Whoops, missed one last time. > > ok? ok > > Index: pci/bktr/bktr_tuner.c > === > RCS file: /cvs/src/sys/dev/pci/bktr/bktr_tuner.c,v > retrieving revision 1.8 > diff

Re: pci(4): autri(4), eap(4): tsleep(9) -> tsleep_nsec(9)

2020-01-11 Thread Alexandre Ratchov
On Sat, Jan 11, 2020 at 02:33:07AM -0600, Scott Cheloha wrote: > Both of these cards have a 100ms sleep when closed. > > ok? > sure, ok ratchov > Index: pci/eap.c > === > RCS file: /cvs/src/sys/dev/pci/eap.c,v > retrieving revisio

Re: eso(4): msleep(9) -> msleep_nsec(9)

2020-01-16 Thread Alexandre Ratchov
On Thu, Jan 16, 2020 at 10:32:21PM -0600, Scott Cheloha wrote: > Ticks to milliseconds. > > Pretty sure all we need to do to convert the drain timeouts is > substitute 1000 for hz in each expression. > > While we're here, I noticed that at halt time for input/output we > msleep to allow a drain a

Add support for notifications about audio(4) "mixer" controls changes

2020-01-25 Thread Alexandre Ratchov
The diff bellow allows programs to get notifications about changes of audio controls. Programs open the /dev/audioctlN device node and use the read(4) syscall to get the index of each changed control. There may be only one reader at a time. Supporting multiple readers would be much more complicate

Include AUDIO_MIXER_xxx ioctls in the "audio" pledge() promise

2020-02-02 Thread Alexandre Ratchov
The plan is to make sndiod need to control volume knobs. This diff adds the AUDIO_MIXER_xxx ioctls to the "audio" pledge. Another option would be to introduce a new "audioctl" promise, but IMHO we don't seed such fine-grained promises. OK? Index: kern_pledge.c

Re: get rid of almost empty /etc/examples/mixerctl.conf

2020-02-08 Thread Alexandre Ratchov
On Sat, Feb 08, 2020 at 11:04:10PM +0100, Ingo Schwarze wrote: > Hi Theo, > > you have a point, that was a lot of cheap talk and no patch. > > I don't aim at changing yacc(1) grammars. I think most parts of > OpenBSD configuration systems already have sane defaults and most > configuration synta

Audio control API, part 1: libsndio, sndiod bits

2020-02-09 Thread Alexandre Ratchov
@@ major=7 -minor=0 +minor=1 Index: lib/libsndio/sioctl.c ======= RCS file: lib/libsndio/sioctl.c diff -N lib/libsndio/sioctl.c --- /dev/null 1 Jan 1970 00:00:00 - +++ lib/libsndio/sioctl.c 8 Feb 2020 14:49:37 - @@ -0,0 +1,

Audio control API, part 2: add new sndioctl(1) utility

2020-02-09 Thread Alexandre Ratchov
sndioctl.1 diff -N usr.bin/sndioctl/sndioctl.1 --- /dev/null 1 Jan 1970 00:00:00 - +++ usr.bin/sndioctl/sndioctl.1 9 Feb 2020 11:05:02 - @@ -0,0 +1,148 @@ +.\" $OpenBSD$ +.\" +.\" Copyright (c) 2007 Alexandre Ratchov +.\" +.\" Permission to use, copy, modify, a

Audio control API, part 3: switch -lossaudio to sndio

2020-02-09 Thread Alexandre Ratchov
Certain ports use -lossaudio to get access to the volume knobs. This diff updates -lossaudio to use the new sndio API. By default, it exposes both sndiod output level and hardware master input/output knobs (if present). The source selectors are not exposed any longer as sndiod doesn't expose them.

Audio control API, part 4: switch ports to sndio API

2020-02-09 Thread Alexandre Ratchov
There are two ports only using the kernel-based API, this diff updates them to use new libsndio-based API: - sysutils/tray-app - audio/gqmpeg As a side effect, this fixes gqmpeg crashes, makes these programs use the right device, and make them work on many uaudio(4) and envy(4) devices with no

Re: Audio control API, part 2: add new sndioctl(1) utility

2020-02-09 Thread Alexandre Ratchov
On Sun, Feb 09, 2020 at 07:20:15PM +0100, Landry Breuil wrote: > On Sun, Feb 09, 2020 at 01:14:47PM +0100, Alexandre Ratchov wrote: > > Here's a new sndioctl utility similar to mixerctl(1) but using the new > > sndio API. Example:

Re: Audio control API, part 2: add new sndioctl(1) utility

2020-02-10 Thread Alexandre Ratchov
On Mon, Feb 10, 2020 at 09:59:09AM +, Raf Czlonka wrote: > On Sun, Feb 09, 2020 at 12:14:47PM GMT, Alexandre Ratchov wrote: > > Here's a new sndioctl utility similar to mixerctl(1) but using the new > > sndio API. Example:

Re: Audio control API, part 1: libsndio, sndiod bits

2020-02-11 Thread Alexandre Ratchov
On Tue, Feb 11, 2020 at 07:01:28PM +0100, Florian Obser wrote: > I've been running the base diffs since you posted them. Firefox, > chrome and mpv still make noise :) > > I'm puzzled by this: > > $ cat /etc/mixerctl.conf > outputs.master=255,2

Re: Audio control API, part 4: switch ports to sndio API

2020-02-12 Thread Alexandre Ratchov
On Sun, Feb 09, 2020 at 01:27:27PM +0100, Alexandre Ratchov wrote: > There are two ports only using the kernel-based API, this diff updates > them to use new libsndio-based API: > - sysutils/tray-app > - audio/gqmpeg > > As a side effect, this fixes gqmpeg crashes, makes

Re: Audio control API, part 1: libsndio, sndiod bits

2020-02-12 Thread Alexandre Ratchov
On Wed, Feb 12, 2020 at 09:22:20PM +0100, Jan Stary wrote: > Hi, > > On Feb 09 13:13:02, a...@caoua.org wrote: > > cd /usr/src > > patch -p0 <1.diff > > patch -p0 <2.diff > > patch -p0 <3.diff > > cd /usr/src/include && doas make includes > > cd /usr/src/lib/libsndio && make obj && make && doas ma

Re: Audio control API, part 1: libsndio, sndiod bits

2020-02-12 Thread Alexandre Ratchov
On Wed, Feb 12, 2020 at 09:28:38PM +0100, Jan Stary wrote: > Hi, > > On Feb 09 13:13:02, a...@caoua.org wrote: > > cd /usr/src > > patch -p0 <1.diff > > patch -p0 <2.diff > > patch -p0 <3.diff > > cd /usr/src/include && doas make includes > > cd /usr/src/lib/libsndio && make obj && make && doas ma

Re: Audio control API, part 1: libsndio, sndiod bits

2020-02-24 Thread Alexandre Ratchov
On Thu, Feb 13, 2020 at 05:15:34AM +, Raf Czlonka wrote: > On Sun, Feb 09, 2020 at 12:13:02PM GMT, Alexandre Ratchov wrote: > > +++ lib/libsndio/sioctl_aucat.c 8 Feb 2020 14:49:37 - > > [...] > > + * Copyright (c) 2010-2011 Alexandre Ratchov > > > >

Re: Audio control API

2020-02-25 Thread Alexandre Ratchov
sndio/sioctl.c === RCS file: lib/libsndio/sioctl.c diff -N lib/libsndio/sioctl.c --- /dev/null 1 Jan 1970 00:00:00 - +++ lib/libsndio/sioctl.c 24 Feb 2020 06:03:30 - @@ -0,0 +1,177 @@ +/* $OpenBSD$ */ +/* + * Copy

Re: Audio control API

2020-02-25 Thread Alexandre Ratchov
On Tue, Feb 25, 2020 at 01:02:06PM +0100, Alexandre Ratchov wrote: > On Thu, Feb 13, 2020 at 04:52:12AM +, Raf Czlonka wrote: > > > > Hi Alexandre, > > > > I have to say that I also find the two ranges mildly confusing, > > i.e. 0-255 in one place, and 0-

Re: mixerctl(1) to sysctl(8); a simpler interface

2009-11-20 Thread Alexandre Ratchov
On Fri, Nov 20, 2009 at 03:39:55PM +0100, Thomas Pfaff wrote: > Hi. > > I've been thinking a bit about how to simplify the audio interface in > OpenBSD and I thought about sysctl. Personally I find the mixerctl > interface horrible. 88 entries on my system, and I honestly do not > understand wha

Re: mixerctl(1) to sysctl(8); a simpler interface

2009-11-21 Thread Alexandre Ratchov
On Sat, Nov 21, 2009 at 05:54:21AM +, Jacob Meuser wrote: > On Sat, Nov 21, 2009 at 12:28:38AM -0500, Ted Unangst wrote: > > On Fri, Nov 20, 2009 at 3:19 PM, Jacob Meuser > > wrote: > > >> If you don't like mixerctl, there's at least a half dozen mixers in > > >> ports. > > > > > > those don't

aucat on low latency setups

2010-01-16 Thread Alexandre Ratchov
Hi, The diff below allows aucat to use only two audio blocks, which lowers the server-side latency. The diff should not impact stability, actually it should slightly improve it. Yeah, I know, improved stablility with smaller buffers might sound surprising... I'd love if people could test this dif

Re: testers needed for auich(4)

2010-04-02 Thread Alexandre Ratchov
On Thu, Apr 01, 2010 at 05:37:13PM +0200, Christopher Zimmermann wrote: > Hi, > > here's a patch for auich(4). It fixes some issues with SIS 7012 > and possibly others. But since it relies on correct behaviour of > the hardware at some places it needs some testing. Especially try > to run some

Re: New intel X driver requires testing.

2010-04-17 Thread Alexandre Ratchov
On Sat, Apr 17, 2010 at 05:27:30PM +0300, Sviatoslav Chagaev wrote: > DELL Latitude D400 laptop reporting in! > > At first, I accidentally compiled the kernel without the GEM option, as > a result, when I ran X, the screen just went black, and even when I > killed the server through ssh, the scre

Re: [libsndio]: remove superfluous 'return 0' statements

2010-07-21 Thread Alexandre Ratchov
On Wed, Jul 21, 2010 at 08:04:45PM +0200, Remco wrote: > It seems to me that the following 'return 0' statements are unnecessary. > This is just an observation, I didn't actually test-run the patch. > indeed they are useless. Commited the diff, thanks! -- Alexandre

pledge: audio ioctls on disconnected devices

2016-01-18 Thread Alexandre Ratchov
If a usb audio device is disconnected, the device vnode is closed and replaced by a deadfs vnode, of type VBAD. The sndiod process still has a descriptor in use for which any ioctl() fails. It's supposed to get the return value, notice the error and close the file descriptor. Unfortunately, if p

Re: pledge: audio ioctls on disconnected devices

2016-01-18 Thread Alexandre Ratchov
On Mon, Jan 18, 2016 at 12:55:30PM +0100, Alexandre Ratchov wrote: > If a usb audio device is disconnected, the device vnode is closed > and replaced by a deadfs vnode, of type VBAD. The sndiod process > still has a descriptor in use for which any ioctl() fails. It's > supposed

Re: pledge: audio ioctls on disconnected devices

2016-01-18 Thread Alexandre Ratchov
On Mon, Jan 18, 2016 at 01:35:46PM +0100, Sebastien Marie wrote: > On Mon, Jan 18, 2016 at 12:55:30PM +0100, Alexandre Ratchov wrote: > > > > Unfortunately, if pledge is used, pledge_ioctl() checks if the > > vnode type is VCHR and the process ends up killed. > > >

Re: pledge: audio ioctls on disconnected devices

2016-01-18 Thread Alexandre Ratchov
On Mon, Jan 18, 2016 at 06:56:29PM +0100, Sebastien Marie wrote: > On Mon, Jan 18, 2016 at 06:05:31PM +0100, Alexandre Ratchov wrote: > > On Mon, Jan 18, 2016 at 01:35:46PM +0100, Sebastien Marie wrote: > > > On Mon, Jan 18, 2016 at 12:55:30PM +0100, Alexandre Ratchov wrote:

Re: pledge: audio ioctls on disconnected devices

2016-01-18 Thread Alexandre Ratchov
On Mon, Jan 18, 2016 at 06:56:29PM +0100, Sebastien Marie wrote: > > Modulo the ENOTTY error code (see previous comment), yes the purpose is > to early return from pledge_ioctl(). pledge(2) permits to expose only a > portion of deeper kernel code for a set of defined operations. > Better diff: c

audio: expose real device name

2016-01-20 Thread Alexandre Ratchov
This diff makes audioctl(1) display the device name (ex. "azalia0", "cmpci0", etc) in the "name" attribute. This way audioctl(1) output could be correlated with dmesg output. This seems more useful than strings like "HD-Audio" or "CMI8338A". OK? Index: audio.c =

Re: audio: expose real device name

2016-01-20 Thread Alexandre Ratchov
On Wed, Jan 20, 2016 at 11:50:43AM +0100, Mark Kettenis wrote: > > Date: Wed, 20 Jan 2016 09:13:53 +0100 > > From: Alexandre Ratchov > > > > This diff makes audioctl(1) display the device name (ex. > > "azalia0", "cmpci0", etc) in the "nam

audioctl: simpler output

2016-01-21 Thread Alexandre Ratchov
The following attributes are always the same for play and record directions (this is a kernel constraint): - sample rate - encoding (including precision, msb and bps) - block size (in frames per block, not bytes) - pause - active The diff below makes audioctl display a single attribute (

audio simplifications to test

2016-01-29 Thread Alexandre Ratchov
This diff adds 4 ioctls to the audio(4) driver, each does one simple thing only: start and stop DMA, set and get parameters. The new semantics allow to drop significant parts of libsndio that are here to deal complications caused by the old api. The old api will remain some time to allow old bina

Re: New scheduler for OpenBSD

2016-03-15 Thread Alexandre Ratchov
On Sat, Mar 12, 2016 at 05:36:21PM +0100, Michal Mazurek wrote: > > p_usrpri and p_priority will go away, so userland utilities like 'ps' > will need to be changed. > AFAIU, this would hurt interactive programs (audio, players, games, etc). Currently i/o bound processes wake up with increased p

Re: New scheduler for OpenBSD

2016-03-19 Thread Alexandre Ratchov
On Fri, Mar 18, 2016 at 08:00:35PM +0100, Mark Kettenis wrote: > > From: Bob Beck > > Date: Fri, 18 Mar 2016 09:20:35 -0600 > > > > this is cool .. but > > > > I would be interested in someone comparing server workloads, as > > opposed to interactive GUI response, using this. > > > > I wouldn't

Re: Rename the global variable ``ticks''

2016-03-19 Thread Alexandre Ratchov
On Thu, Mar 17, 2016 at 09:02:03PM +0100, Martin Pieuchot wrote: > ``ticks'' is in my opinion a really badly named global variable. But we > all know that finding names is hard ;) > > Since its popularity seems to be really high lately, I'd suggest to > rename it. I chose ``hcticks'' for "hardcl

Re: New scheduler for OpenBSD

2016-03-19 Thread Alexandre Ratchov
On Tue, Mar 15, 2016 at 03:05:47PM +0100, Michal Mazurek wrote: > > Please test, and let me know if the performance of something else > degrades. > With your diff firefox consumes twice less cpu (watched the same video with and without the diff). This suggests firefox spins somewhere and your d

Re: Scheduler hack for multi-threaded processes

2016-03-23 Thread Alexandre Ratchov
On Wed, Mar 23, 2016 at 06:18:59PM -0400, Ted Unangst wrote: > Mark Kettenis wrote: > > So here is a diff that keeps yield() the same and adds the code in the > > sched_yield(2) implementation instead. It also changes the logic that > > picks the priority to walk the complete threads listand pick

Re: Scheduler hack for multi-threaded processes

2016-03-23 Thread Alexandre Ratchov
On Wed, Mar 23, 2016 at 09:35:50PM +0100, Mark Kettenis wrote: > > > > This doesn't only change the sched_yield() behaviour, but also > > modifies how in-kernel yield() calls behave for threaded processes. > > That is probably not right. > > So here is a diff that keeps yield() the same and adds

Re: Scheduler hack for multi-threaded processes

2016-03-28 Thread Alexandre Ratchov
On Mon, Mar 28, 2016 at 12:41:01PM +0200, Henrik Friedrichsen wrote: > Can confirm all the reports regarding desktop apps becoming more > responsive. I do, however, experience sound stutters, e.g. when playing > music in the browser (Google Play Music) or movies with mpv. do you mean that sound st

Re: midiplay: Fix out-of-bounds memory access

2016-05-04 Thread Alexandre Ratchov
On Sun, May 01, 2016 at 12:53:17PM +0300, Vadim Zhukov wrote: > 2016-04-30 7:38 GMT+03:00 Jonathan Gray : > > On Wed, Apr 27, 2016 at 07:49:50PM -0700, Geoff Hill wrote: > >> Fix possible reads past the end of the buffer. > >> > >> Found by random fuzz testing (zzuf). Without the fix the fuzzer cra

Re: remove noises at reboot in azalia(4)

2017-07-05 Thread Alexandre Ratchov
On Wed, Jun 28, 2017 at 04:17:30PM +0200, Manuel Giraud wrote: > Hi, > > This patch removes noises in speaker (or headphone) when rebooting > (tested on only one Conexant CX20724 chip) > Thanks. Works for me and seems useful in many cases. > Index: azalia.c > ==

Re: remove noises at reboot in azalia(4)

2017-08-10 Thread Alexandre Ratchov
On Thu, Aug 10, 2017 at 10:39:36AM -0400, Theo Buehler wrote: > > Here's a diff that takes these comments into account. I've been running > with this since quite some time and it silences the annoying noises. > > Can we get this in? > I'm running with exactly the same diff, but forgot to commit

Re: Please test: HZ bump

2017-08-18 Thread Alexandre Ratchov
On Mon, Aug 14, 2017 at 04:06:51PM -0400, Martin Pieuchot wrote: > I'd like to improve the fairness of the scheduler, with the goal of > mitigating userland starvations. For that the kernel needs to have > a better understanding of the amount of executed time per task. > > The smallest interval

simpler audioctl

2016-06-19 Thread Alexandre Ratchov
-/* $NetBSD: audioctl.c,v 1.14 1998/04/27 16:55:23 augustss Exp $ */ - +/* $OpenBSD$ */ /* - * Copyright (c) 1997 The NetBSD Foundation, Inc. - * All rights reserved. - * - * Author: Lennart Augustsson + * Copyright (c) 2016 Alexandre Ratchov * - * Redistribution and use in source

Re: simpler audioctl

2016-06-19 Thread Alexandre Ratchov
On Sun, Jun 19, 2016 at 05:56:38PM +0200, Sebastien Marie wrote: > > Just one point about the man page: > > Test if the hardware supports 24-bit encoding and 44100Hz sample rate: > >$ audioctl -f /dev/audio0 encoding=s24 rate=44100 > > "Test" is somehow incorrect as if the devi

audio: unused ioctls and macros

2016-06-28 Thread Alexandre Ratchov
This diff removes unused ioctls. Certain macros associated to these ioctls (like AUDIO_PROP_xxx and AUDIO_ENCODING_xxx) are still used by the kernel, in by low-level drivers, so we move them from sys/audioio.h to dev/audio_if.h instead of deleting them. This shouldn't affect ports as we don't use

remove unreachable code from all audio drivers

2016-09-07 Thread Alexandre Ratchov
This diff deletes unreachable code in low-level audio drivers. As this touches all archs, tests (a quick kernel build is enough) are welcome on anything but amd64 and i386. OK? Index: share/man/man9/audio.9 === RCS file: /cvs/src/sh

remove /dev/sound*

2016-09-07 Thread Alexandre Ratchov
As audio(4) manual says "In all respects /dev/audio and /dev/sound are identical". Only one of them is needed and this diff is to remove /dev/sound. OK? Index: etc/MAKEDEV.common === RCS file: /cvs/src/etc/MAKEDEV.common,v retrievin

Re: remove /dev/sound*

2016-09-08 Thread Alexandre Ratchov
On Thu, Sep 08, 2016 at 01:47:02PM +0800, Michael W. Bombardieri wrote: > Hi Alexandre, > > Do you know if any applications in ports use /dev/sound as default audio > device. > Maybe they are not smart enough to try /dev/audio if /dev/sound fails. > Hi, I'm not aware of any port using /dev/sou

Re: remove /dev/sound*

2016-09-08 Thread Alexandre Ratchov
On Thu, Sep 08, 2016 at 08:22:16AM +0100, Stuart Henderson wrote: > On 2016/09/08 13:47, Michael W. Bombardieri wrote: > > Hi Alexandre, > > > > Do you know if any applications in ports use /dev/sound as default audio > > device. > > Maybe they are not smart enough to try /dev/audio if /dev/sound

make sv(4) use the trigger_{intput,output}() interface

2016-09-16 Thread Alexandre Ratchov
This makes sv(4) use the "modern" audio interface. Basically, this blindly concatenates the init_xxx() and start_xxx() functions into a single trigger_xxx() function. OK? Index: sv.c === RCS file: /cvs/src/sys/dev/pci/sv.c,v retriev

remove more unreachable code from audio drivers

2016-09-17 Thread Alexandre Ratchov
Last year we made AUDIO_GETDEV ioctl driver independent but forgot to remove the getdev() methods of all the drivers. OK? Index: share/man/man9/audio.9 === RCS file: /cvs/src/share/man/man9/audio.9,v retrieving revision 1.25 diff -u

few quick arcofi(4) tests needed

2016-09-19 Thread Alexandre Ratchov
I'm trying to switch the arcofi(4) driver to the "new" (as from 1998) audio interface, but I have no access to the hardware. Anyone with a hp9000 with a working arcofi(4) device to run few tests for me? (to check if it works, just play a .wav file) Thanks

Re: important audio simplifications to test and review

2015-06-13 Thread Alexandre Ratchov
On Fri, Jun 12, 2015 at 02:26:34AM +0200, Max Fillinger wrote: > My uaudio device stopped working with this patch: > > $ aucat -i test.wav -f snd/0 > snd/0: couldn't open audio device > > With AUDIO_DEBUG enabled, I see the following output on the console: > > audio1: setpar: req enc=10 bits=16,

Re: important audio simplifications to test and review

2015-06-20 Thread Alexandre Ratchov
On Thu, Jun 18, 2015 at 07:25:31PM +, Christian Weisgerber wrote: > On 2015-06-13, Alexandre Ratchov wrote: > > > Many thanks to all who tested, below is an updated diff with the > > missing i386 bits and "working" uaudio. > > I have run into a serious

Re: sndiod hangs

2015-07-13 Thread Alexandre Ratchov
On Sat, Jul 11, 2015 at 02:23:03PM +0200, Mark Kettenis wrote: > Every now and then sndiod hangs on me. Usually I discover this as > mplayer hangs while playing a video or hangs while opening the audio > device on startup. Restarting sndiod using the /etc/rc.d/sndiod > script doesn't work; it blo

Re: sndiod hangs

2015-07-16 Thread Alexandre Ratchov
On Mon, Jul 13, 2015 at 12:52:14PM +0200, Alexandre Ratchov wrote: > On Sat, Jul 11, 2015 at 02:23:03PM +0200, Mark Kettenis wrote: > > Every now and then sndiod hangs on me. Usually I discover this as > > mplayer hangs while playing a video or hangs while opening the audio > &

Re: sndiod hangs

2015-07-17 Thread Alexandre Ratchov
On Mon, Jul 13, 2015 at 12:52:14PM +0200, Alexandre Ratchov wrote: > On Sat, Jul 11, 2015 at 02:23:03PM +0200, Mark Kettenis wrote: > > Every now and then sndiod hangs on me. Usually I discover this as > > mplayer hangs while playing a video or hangs while opening the audio > &

audio: recover after missed interrupts

2015-07-27 Thread Alexandre Ratchov
Sometimes the system may miss enough audio interrupts for DMA pointers to wrap, which makes upper layers misbahave. This diff makes the audio driver properly recover, by detecting and compensating for the missed interrupts. This requires the hardware to expose working DMA pointers and the low-leve

audio: ioctl to fetch snapshot of counters

2015-07-28 Thread Alexandre Ratchov
There are 4 audio counters, and we've one ioctl() to get each. So userland has to call the ioctl() one by one, and must take care to handle cases when a counters are inconsistent (i.e. don't belong to the same time). Inconsistencies are extreamly rare produce so the code is hard to test. This diff

azalia: rework buffer position reporting code

2015-07-28 Thread Alexandre Ratchov
This diff simplifies the code that reads the DMA pointer and calls the audio(4) driver accordingly. - use simpler (and less) data structures, which makes the code shorter. - if multiple interrupts are missed, call audio(4) as many times as we missed interrupts (unless the pointer wrapped, whi

envy: recover after missed interrupts

2015-07-29 Thread Alexandre Ratchov
This diff allows the audio(4) driver to properly recover, when the envy(4) device misses interrupts. Fixes permanent distortion on MP systems. OK? Index: envy.c === RCS file: /cvs/src/sys/dev/pci/envy.c,v retrieving revision 1.60 dif

add midicat utility

2015-08-30 Thread Alexandre Ratchov
\" Copyright (c) 2015 Alexandre Ratchov +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\"

Re: escape minus signs in sndio manpages

2015-08-31 Thread Alexandre Ratchov
On Sun, Aug 30, 2015 at 03:35:21PM -0400, Peter Piwowarski wrote: > This patch replaces some literal '-' with '\-' in examples for sndio- > related manpages. Certain roff implementations may render '-' as a > hyphen (unicode U+2010) rather than a minus sign (unicode U+002D or ascii > 0x2D); while

<    1   2   3   4   >