Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
A request of `GET_DESCRIPTOR` should be sending the entire configuration
chain, and not just the configuration descriptor.
|
|
This creates all interfaces when the device is enumerated, with a link
to the configuration that it is a part of. As such, a new class,
`USBInterface` has been introduced to express this state.
|
|
|
|
Some other parts of the USB stack may require us to perform a control
transfer. Instead of abusing `friend` to expose the default pipe, let's
just expose it via a function.
|
|
This also introduces a new class, `USBConfiguration` that stores a
configuration. The device, when instructed, sets this configuration and
holds a pointer to it so we have a record of what configuration is
currently active.
|
|
Fixes #13755.
Co-Authored-By: Damien Firmenich <fir.damien@gmail.com>
|
|
|
|
|
|
SQL Studio is a graphical SQL manager program that allows the user
to create and edit SQL scripts.
|
|
|
|
This adds a simple histogram widget that visualizes the rgb-channels
and brightness for a given image. When hovering over the image it will
indicate what brightness level the pixel at the mouse position has.
|
|
Similar to SystemMonitor's option of the same name, this allows you to
launch the given application with the specific tab open.
|
|
This gives us a convenient way to refer to them, which will be used in
the following commit.
|
|
While working on #13764 I noticed that DateTime::to_string() would just
return an empty String if the format included an invalid specifier
(eg `%Q`). This seems to be a mistake. POSIX date(1), which I believe
we are basing our implementation on, only replaces valid specifiers,
and any invalid ones get included as literals in the output.
For example, on Linux `date "+%Quiz"` returns "%Quiz", but we were
returning "".
|
|
Previously, we required local socket addresses to be exactly
sizeof(sockaddr_un). There was no real reason for this, so let's not
enforce it.
|
|
Previously we just wrote the local socket bind path into the sockaddr_un
buffer. With this patch, we actually report the family as well.
|
|
This fixes a bunch of audio clients that don't actually play audio.
|
|
Previously, we were sending Buffers to the server whenever we had new
audio data for it. This meant that for every audio enqueue action, we
needed to create a new shared memory anonymous buffer, send that
buffer's file descriptor over IPC (+recfd on the other side) and then
map the buffer into the audio server's memory to be able to play it.
This was fine for sending large chunks of audio data, like when playing
existing audio files. However, in the future we want to move to
real-time audio in some applications like Piano. This means that the
size of buffers that are sent need to be very small, as just the size of
a buffer itself is part of the audio latency. If we were to try
real-time audio with the existing system, we would run into problems
really quickly. Dealing with a continuous stream of new anonymous files
like the current audio system is rather expensive, as we need Kernel
help in multiple places. Additionally, every enqueue incurs an IPC call,
which are not optimized for >1000 calls/second (which would be needed
for real-time audio with buffer sizes of ~40 samples). So a fundamental
change in how we handle audio sending in userspace is necessary.
This commit moves the audio sending system onto a shared single producer
circular queue (SSPCQ) (introduced with one of the previous commits).
This queue is intended to live in shared memory and be accessed by
multiple processes at the same time. It was specifically written to
support the audio sending case, so e.g. it only supports a single
producer (the audio client). Now, audio sending follows these general
steps:
- The audio client connects to the audio server.
- The audio client creates a SSPCQ in shared memory.
- The audio client sends the SSPCQ's file descriptor to the audio server
with the set_buffer() IPC call.
- The audio server receives the SSPCQ and maps it.
- The audio client signals start of playback with start_playback().
- At the same time:
- The audio client writes its audio data into the shared-memory queue.
- The audio server reads audio data from the shared-memory queue(s).
Both sides have additional before-queue/after-queue buffers, depending
on the exact application.
- Pausing playback is just an IPC call, nothing happens to the buffer
except that the server stops reading from it until playback is
resumed.
- Muting has nothing to do with whether audio data is read or not.
- When the connection closes, the queues are unmapped on both sides.
This should already improve audio playback performance in a bunch of
places.
Implementation & commit notes:
- Audio loaders don't create LegacyBuffers anymore. LegacyBuffer is kept
for WavLoader, see previous commit message.
- Most intra-process audio data passing is done with FixedArray<Sample>
or Vector<Sample>.
- Improvements to most audio-enqueuing applications. (If necessary I can
try to extract some of the aplay improvements.)
- New APIs on LibAudio/ClientConnection which allows non-realtime
applications to enqueue audio in big chunks like before.
- Removal of status APIs from the audio server connection for
information that can be directly obtained from the shared queue.
- Split the pause playback API into two APIs with more intuitive names.
I know this is a large commit, and you can kinda tell from the commit
message. It's basically impossible to break this up without hacks, so
please forgive me. These are some of the best changes to the audio
subsystem and I hope that that makes up for this :yaktangle: commit.
:yakring:
|
|
With the following change in how we send audio, the old Buffer type is
not really needed anymore. However, moving WavLoader to the new system
is a bit more involved and out of the scope of this PR. Therefore, we
need to keep Buffer around, but to make it clear that it's the old
buffer type which will be removed soon, we rename it to LegacyBuffer.
Most of the users will be gone after the next commit anyways.
|
|
|
|
This new class with an admittedly long OOP-y name provides a circular
queue in shared memory. The queue is a lock-free synchronous queue
implemented with atomics, and its implementation is significantly
simplified by only accounting for one producer (and multiple consumers).
It is intended to be used as a producer-consumer communication
datastructure across processes. The original motivation behind this
class is efficient short-period transfer of audio data in userspace.
This class includes formal proofs of several correctness properties of
the main queue operations `enqueue` and `dequeue`. These proofs are not
100% complete in their existing form as the invariants they depend on
are "handwaved". This seems fine to me right now, as any proof is better
than no proof :^). Anyways, the proofs should build confidence that the
implemented algorithms, which are only roughly based on existing work,
operate correctly in even the worst-case concurrency scenarios.
|
|
AnonymousFile always allocates in multiples of a page size when created
with anon_create. This is especially an issue if we use AnonymousFile
shared memory to store a shared data structure that isn't exactly a
multiple of a page in size. Therefore, we can just allow mmaps of
AnonymousFile to map only an initial part of the shared memory.
This makes SharedSingleProducerCircularQueue work when it's introduced
later.
|
|
This is particularly important to avoid false sharing, which thrashes
performance when two process-shared atomics are on the same cache line.
|
|
SystemServer had safety fallbacks to boot into text mode if the user
errorneously specified graphical mode but no video hardware was present.
As it's now possible to do exactly this intentionally, we should allow
it. This would of course make WindowServer fall over and die if
configured improperly, but if you're messing with the kernel command
line in strange ways, you should be able to fix that.
|
|
This screen backend is just memory-backed and doesn't connect to any
screen hardware. That way, we can boot Serenity without video hardware
but in full graphical mode :^)
To create a virtual screen, put something like this in your
WindowServer.ini. There's no way yet to do this through Display
Settings, though an existing virtual screen's settings can be changed
there.
```ini
[Screen0]
Mode=Virtual
Left=1024
Top=0
Width=1920
Height=1080
ScaleFactor=1
```
|
|
This will allow us to change between a couple of properties, for now
it's only Device and Virtual. (How about Remote :^) ) These get handled
by a different screen backend in the Screen.
|
|
This will allow us to use other screen backends in the future instead.
|
|
The ScreenBackend is a thin wrapper around the actual screen hardware
connection. It contains all the variables specific to that hardware and
abstracts away operations that deal with controlling the hardware. The
standard ScreenBackend implementor is HardwareScreenBackend, which
contains all the existing frame buffer & ioctl handling code of Screen.
I took this opportunity to introduce ErrorOr wherever sensible.
|
|
This was very badly named. All that the "FBData" struct contains is the
currently to-be-flushed rectangles plus a fullness flag, so it should
better be called FlushRectData. This rename is similarly applied to all
variable names.
|
|
Previously netstat would print the whole line of an ip address or
resolved hostname. If the hostname was longer than the address column
length, it would push following columns into disaligned output.
This sets the default behavior to truncate any IP address or symbolic
hostname that is larger than the maximum address column size to provide
cleaner output. In the event the user wishes to see the whole address
name, they can then pass the wide option that will output as wide as
necessary to print the whole name.
|
|
|
|
|
|
|
|
|
|
|
|
These are supposed to be used as flags in a bitfield, so let's make
them powers of two.
|
|
This matches how some other systems implement errno, and makes 3rd party
software that expect us to have __errno_location() work.
|
|
|
|
|
|
This allows for calling this function with any argument type for which
the appropriate traits and operators have been implemented so it can be
compared to the Vector's item type
|
|
|
|
- Don't add multiple numbers to nested steps, just the innermost one
(as rendered in the HTML document)
- "Otherwise" comments go before the else, not after it
- "FIXME:" goes before step number, not between it and the comment text
- Always add a period between number and comment text
The majority of these were introduced in #13756, but some unrelated ones
have been updated as well.
|
|
|
|
In most cases it's safe to abort the requested operation and go forward,
however, in some places it's not clear yet how to handle these failures,
therefore, we use the MUST() wrapper to force a kernel panic for now.
|
|
|
|
|
|
|