Age | Commit message (Collapse) | Author |
|
This should probably call out to a login program at some point. Right now
it just puts a root terminal on tty{1,2,3}.
Remember not to leave your Serenity workstation unattended!
|
|
This is to prepare for other framebuffer implementations, for which it
would be inappropriate to use the /dev/bxvga device name.
|
|
|
|
|
|
Fork the IPC Connection classes into Server:: and Client::ConnectionNG.
The new IPC messages are serialized very snugly instead of using the
same generic data structure for all messages.
Remove ASAPI.h since we now generate all of it from AudioServer.ipc :^)
|
|
We're not using any of the functionality yet, but soon...
|
|
This was already in the current version of the code, I'm just updating
the soon-to-be-current IPC protocol version of it. :^)
|
|
Instead of doing everything manually in C++, let's do some codegen.
This patch adds a crude but effective IPC definition parser, along
with two initial definition files for the AudioServer's client and
server endpoints.
|
|
This code should probably be structured differently to handle things
like children dying, etc. But not right now.
Found by PVS-Studio.
|
|
The create_thread() syscall returns the thread ID now, not 0.
|
|
|
|
A lot of things happen in response to window destruction, and some of
them may call into the window's WSClientConnection and ask it to look
through its window list.
If we're right in the middle of tearing down the window list, it's not
a great idea to start iterating over it.
Fixes #386.
|
|
The goal here is to generate most of this code from IPC protocol
descriptions, but for now I've spelled them all out to get started.
Each message gets a wrapper class in the ASAPI_Client or ASAPI_Server
namespace. They are convertible to and from the old message structs.
The real hotness happens when you want to make a synchronous request
to the other side:
auto response = send_sync<ASAPI_Client::GetMainMixVolume>();
Each request class knows his corresponding response class, so in the
above example, "response" will be an ASAPI_Server::DidGetMainMixVolume
object, and we can get the volume like so:
int volume = response.volume();
For posting messages that don't expect a response, you can still use
post_message() since the message classes are convertible:
post_message(ASAPI_Server::DidGetMainMixVolume(volume));
It's not perfect yet, but I already really like it. :^)
|
|
Give the mixer a main volume value (percent) that we scale all the
outgoing samples by (before clipping.)
Also add a simple "avol" program for querying and setting the volume:
- "avol" prints the current volume.
- "avol 200" sets the main mix volume to 200%
|
|
Each client connection now sets up an ASBufferQueue, which is basically a
queue of ABuffers. This allows us to immediately start streaming the next
pending buffer whenever our current buffer runs out of samples.
This makes the majority of the skippiness go away for me. :^)
Also get rid of the old PlayBuffer API, since we don't need it anymore.
|
|
The idea here is to keep a small number of sample buffers queued in the
AudioServer so we don't get caught without something to play.
|
|
Now that we can set icons directly "by bitmap", there's no need for passing
around the icon paths anymore, so get rid of all the IPC and API related
to that. :^)
|
|
Now that we support more than 2 clients per shared buffer, we can use them
for window icons. I didn't do that previously since it would have made the
Taskbar process unable to access the icons.
This opens up some nice possibilities for programmatically generated icons.
|
|
Instead of posting a message directly from ASMixer, notify the client via
ASClientConnection::did_finish_playing_buffer().
|
|
|
|
|
|
This allows us to carry the same buffer all the way from the WAV loader
to the AudioServer mixer.
This alleviates some of the stutter, but there's still a noticeable
skip when switching buffers. We're gonna need to do better. :^)
|
|
|
|
I had to solve a bunch of things simultaneously to make this work.
Refactor AWavLoader to be a streaming loader rather than a one-shot one.
The constructor parses the header, and if everything looks good, you can
repeatedly ask the AWavLoader for sample buffers until it runs out.
Also send a message from AudioServer when a buffer has finished playing.
That allows us to implement a blocking variant of play().
Use all of this in aplay to play WAV files chunk-at-a-time.
This is definitely not perfect and it's a little glitchy and skippy,
but I think it's a step in the right direction.
|
|
Use CLocalServer to listen for connections in WindowServer and AudioServer.
This allows us to accept incoming CLocalSocket objects from the CLocalServer
and construct client connections based on those.
Removed COpenedSocket since it's replaced by CLocalSocket.
|
|
|
|
This macro goes at the top of every CObject-derived class like so:
class SomeClass : public CObject {
C_OBJECT(SomeClass)
public:
...
At the moment, all it does is create an override for the class_name() getter
but in the future this will be used to automatically insert member functions
into these classes.
|
|
This allows HashMap::get() to be used for value types that cannot be default
constructed (e.g NonnullOwnPtr.)
|
|
|
|
In every case I found, we never wanted to support null entry values.
With NonnullOwnPtr, we can encode that at the type level. :^)
|
|
Add a trivial CSafeSyscall template that calls a callback until it stops
returning EINTR, and use it everywhere we use select() now.
Thanks to Andreas for the suggestion of using a template parameter for
the syscall function to invoke.
|
|
This makes it much harder to screw with an application while it's showing
a modal window, and matches what some other systems are doing. :^)
|
|
|
|
Instead of LibGUI and WindowServer building their own copies of the drawing
and graphics code, let's it in a separate LibDraw library.
This avoids building the code twice, and will encourage better separation
of concerns. :^)
|
|
|
|
|
|
This allows us to seal a buffer *before* anyone else has access to it
(well, ok, the creating process still does, but you can't win them all).
It also means that a SharedBuffer can be shared with multiple clients:
all you need is to have access to it to share it on again.
|
|
|
|
Vector::append(Vector&&) is a simple pointer transfer when appending to an
empty Vector. :^)
|
|
Sticking these in a namespace allows us to use a more generic
("Connection") term without clashing, which is way easier to understand
than to try to come up with unique names for both.
|
|
The only reason for the inheritance was to add FDs to the select set.
Since CNotifier is available (and now also quite useful), we can make use of it
instead, and remove the inheritance.
|
|
|
|
As a new base class of IPC connections server-side.
Port ASClientConnection to CIPCServerSideClient.
|
|
More natural term when talking about audio :)
|
|
|
|
The center of this is now an ABuffer class in LibAudio.
ABuffer contains ASample, which has two channels (left/right) in
floating point for mixing purposes, in 44100hz.
This means that the loaders (AWavLoader in this case) needs to do some
manipulation to get things in the right format, but that we don't need
to care after format loading is done.
While we're at it, do some correctness fixes. PCM data is unsigned if
it's 8 bit, but 16 bit is signed. And /dev/audio also wants signed 16
bit audio, so give it what it wants.
On top of this, AudioServer now accepts requests to play a buffer.
The IPC mechanism here is pretty much a 1:1 copy-paste from
LibGUI/WindowServer. It can be generalized more in the future, but for
now I want to get AudioServer working decently first :)
Additionally, add a little "aplay" tool to load and play a WAV file. It
will break with large WAVs (run out of memory, heh...) but it's a start.
Future work needs to make AudioServer block buffer submission from
clients until it has played the buffer they are requesting to play.
|
|
This allows us to ask the user for confirmation instead of just shutting
down the system abruptly.
|
|
Tidier encapsulation than splitting messages between two classes.
|
|
This keeps it out of the taskbar window list.
The stacking order is a little gnarly, but it seems to work OK still.
|
|
And forcefully disconnect the client in both cases.
|