summaryrefslogtreecommitdiff
path: root/Servers
AgeCommit message (Collapse)Author
2019-08-12Server: Add TTYServer, a rudimentary text console managerConrad Pankoff
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!
2019-08-12Kernel: Use established device name and number for framebufferConrad Pankoff
This is to prepare for other framebuffer implementations, for which it would be inappropriate to use the /dev/bxvga device name.
2019-08-08WindowServer: Use range-for with InlineLinkedListAndreas Kling
2019-08-03IPCCompiler+AudioServer: Accept "//"-style comments in IPC defintionsAndreas Kling
2019-08-03AudioServer: Port to the new generated IPC mechanismAndreas Kling
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 :^)
2019-08-03AudioServer: Link against LibIPCAndreas Kling
We're not using any of the functionality yet, but soon...
2019-08-03AudioServer: The EnqueueBuffer response needs a success booleanAndreas Kling
This was already in the current version of the code, I'm just updating the soon-to-be-current IPC protocol version of it. :^)
2019-08-03IPCCompiler: Start working on a simple IPC definition languageAndreas Kling
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.
2019-08-01SystemServer: Remove always-true "if (pid == 0)" checkAndreas Kling
This code should probably be structured differently to handle things like children dying, etc. But not right now. Found by PVS-Studio.
2019-07-31WindowServer: Fix bad assertion when setting wallpaperAndreas Kling
The create_thread() syscall returns the thread ID now, not 0.
2019-07-31WindowServer: Allow moving the Launcher window type.Andreas Kling
2019-07-31WindowServer: Control WSClientConnection's window list teardown betterAndreas Kling
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.
2019-07-29AudioServer: Begin work on a new IPC API style.Andreas Kling
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. :^)
2019-07-29AudioServer: Add a "main mix volume" and a simple program to get/set itAndreas Kling
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%
2019-07-28AudioServer+LibAudio: Make mixing queue-based instead of buffer-based.Andreas Kling
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.
2019-07-28AudioServer: Add a buffer queue so we can buffer some sound.Andreas Kling
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.
2019-07-28WindowServer+LibGUI: Remove old "icon path" way of doing things.Andreas Kling
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. :^)
2019-07-28WindowServer+LibGUI: Pass window icons as shared buffers rather than paths.Andreas Kling
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.
2019-07-27AudioServer: Let ASMixer notify ASClientConnection about finished buffers.Andreas Kling
Instead of posting a message directly from ASMixer, notify the client via ASClientConnection::did_finish_playing_buffer().
2019-07-27WindowServer+AudioServer: Add some missing C_OBJECT macros.Andreas Kling
2019-07-27AudioServer: Remove some outdated comments.Andreas Kling
2019-07-27Audio: Make ABuffer sit on top of a SharedBuffer.Andreas Kling
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. :^)
2019-07-27AudioServer: Avoid two heap allocations per mixing iteration.Andreas Kling
2019-07-27Audio: Make basic streaming WAV playback work.Andreas Kling
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.
2019-07-27LibCore: Port CoreIPCServer to using CLocalServer.Andreas Kling
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.
2019-07-27WindowServer: Add missing WSAPITypes.h include in WSClientConnection.hAndreas Kling
2019-07-25LibCore: Introduce a C_OBJECT macro.Andreas Kling
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.
2019-07-24AK: Make HashMap::get(Key) return an Optional<Value>.Andreas Kling
This allows HashMap::get() to be used for value types that cannot be default constructed (e.g NonnullOwnPtr.)
2019-07-24WindowServer: Convert Vector<OwnPtr> to NonnullOwnPtrVector.Andreas Kling
2019-07-24Convert HashMap<Key, OwnPtr<T>> to HashMap<Key, NonnullOwnPtr<T>>.Andreas Kling
In every case I found, we never wanted to support null entry values. With NonnullOwnPtr, we can encode that at the type level. :^)
2019-07-21Userspace: Deal with select() returning EINTR on a signal interruptionRobin Burchell
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.
2019-07-21WindowServer: Disable the global menubar while a modal window is active.Andreas Kling
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. :^)
2019-07-18WindowServer: Fix build after renaming WSMenuBarKeeper => WSMenuManager.Andreas Kling
2019-07-18LibDraw: Introduce (formerly known as SharedGraphics.)Andreas Kling
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. :^)
2019-07-18WindowServer: Rename (files) WSMenuBarKeeper => WSMenuManager.Andreas Kling
2019-07-18WindowServer: Rename WSMenuBarKeeper => WSMenuManager.Andreas Kling
2019-07-18SharedBuffer: Split the creation and share stepsRobin Burchell
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.
2019-07-18CProcessStatisticsReader: Be consistent about terminology from the kernel downRobin Burchell
2019-07-17AudioServer: Use Vector::append(Vector&&) for pending mix buffers.Andreas Kling
Vector::append(Vector&&) is a simple pointer transfer when appending to an empty Vector. :^)
2019-07-17Rename new IPC headers & classesRobin Burchell
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.
2019-07-17WSEventLoop: Remove inheritance from CEventLoopRobin Burchell
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.
2019-07-17Port WSClientConnection to CIPCServerSideClientRobin Burchell
2019-07-17Introduce CIPCServerSideClientRobin Burchell
As a new base class of IPC connections server-side. Port ASClientConnection to CIPCServerSideClient.
2019-07-17ABuffer: clamp -> clipRobin Burchell
More natural term when talking about audio :)
2019-07-17ABuffer: move it and groove itRobin Burchell
2019-07-17Work on AudioServerRobin Burchell
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.
2019-07-16WindowServer: Spawn a SystemDialog when activating the shutdown menu.Andreas Kling
This allows us to ask the user for confirmation instead of just shutting down the system abruptly.
2019-07-14WSEventLoop: Move message processing into WSClientConnectionRobin Burchell
Tidier encapsulation than splitting messages between two classes.
2019-07-14WindowServer: Add a custom window type for LauncherRobin Burchell
This keeps it out of the taskbar window list. The stacking order is a little gnarly, but it seems to work OK still.
2019-07-14WSEventLoop: Treat invalid window types the same as unknown window typesRobin Burchell
And forcefully disconnect the client in both cases.