summaryrefslogtreecommitdiff
path: root/Libraries/LibAudio
AgeCommit message (Collapse)Author
2020-10-02Everywhere: Fix typosNico Weber
Mostly in comments, but sprintf() now prints "August" instead of "Auguest" so that's something.
2020-10-02AK: Add trivial structure validation to SharedBufferTom
If we're sharing buffers, we only want to share trivial structures as anything else could potentially share internal pointers, which most likely is going to cause problems due to different address spaces. Fix the GUI::SystemTheme structure, which was not trivial, which is now caught at compile time. Fixes #3650
2020-09-21LibAudio: Use InputMemoryStream instead of BufferStream.asynts
2020-08-16AK: Rename KB, MB, GB to KiB, MiB, GiBNico Weber
The SI prefixes "k", "M", "G" mean "10^3", "10^6", "10^9". The IEC prefixes "Ki", "Mi", "Gi" mean "2^10", "2^20", "2^30". Let's use the correct name, at least in code. Only changes the name of the constants, no other behavior change.
2020-07-21AudioServer: Give the AudioClient a way to keep track of the main mix volumeBenoît Lormeau
2020-06-18WavLoader: Search for DATA marker by reading single bytesTill Mayer
Previously 4 bytes at once were read and compared to the string "DATA". This worked when the DATA marker was aligned on a 32-bit boundary relative to the start of the file. However, this is not guranteed to always be the case, and for some files the loader would just keep searching for the marker.
2020-05-14Build: Switch to CMake :^)Sergey Bugaev
Closes https://github.com/SerenityOS/serenity/issues/2080
2020-05-08Services: Renamed from ServersAndreas Kling
It didn't feel right to have a "DHCPClient" in a "Servers" directory. Rename this to Services to better reflect the type of programs we'll be putting in there.
2020-04-15LibAudio: Use NumericLimits<T>Andreas Kling
2020-03-08Userspace: Add missing #includes now that AK/StdLibExtras.h is smallerAndreas Kling
2020-02-28Kernel+LibC: Rename shared buffer syscalls to use a prefixAndreas Kling
This feels a lot more consistent and Unixy: create_shared_buffer() => shbuf_create() share_buffer_with() => shbuf_allow_pid() share_buffer_globally() => shbuf_allow_all() get_shared_buffer() => shbuf_get() release_shared_buffer() => shbuf_release() seal_shared_buffer() => shbuf_seal() get_shared_buffer_size() => shbuf_get_size() Also, "shared_buffer_id" is shortened to "shbuf_id" all around.
2020-02-27WavLoader: Add missing AK/OwnPtr.h includeWilliam McPherson
2020-02-15AK: Remove manual forward declarations with <AK/Forward.h>Andreas Kling
2020-02-14LibCore: Add a forward declaration headerAndreas Kling
This patch adds <LibCore/Forward.h> and uses it in various places to shrink the header dependency graph.
2020-02-10LibAudio/Piano: Replace floats with doublesWilliam McPherson
We should default to double-precision so that clients can make the choice to use float or double.
2020-02-10LibAudio/aplay: Handle WAV header errors properlyWilliam McPherson
We shouldn't just ASSERT() if the header parse fails. This was crashing Piano completely.
2020-02-06IPCCompiler: Put message classes in the Messages namespaceAndreas Kling
2020-02-06LibAudio: Implement Audio::WavWriterWilliam McPherson
This class mirrors WavLoader and uses the same variable names so they can be read side-by-side. In a simple use-case, you construct a WavWriter object with your file path and audio parameters, call write_samples() with your bytes and then either finalize() to finish writing the file or allow the destructor to do it automatically. finalize() is needed because the WAV header cannot be written until the size of the data section is known. You only need to call this manually if you want to write a WAV file and then immediately load it. You can also use one WavWriter instance multiple times by repeatedly calling finalize() and set_file().
2020-02-06LibAudio: Remove leading A from filenamesAndreas Kling
2020-02-06LibCore: Remove leading C from filenamesAndreas Kling
2020-02-06LibIPC: Remove leading I from filenamesAndreas Kling
2020-02-06LibAudio: Put all classes in the Audio namespace and remove leading AAndreas Kling
2020-02-05LibIPC: Put all classes in the IPC namespace and remove the leading IAndreas Kling
2020-02-02LibCore: Put all classes in the Core namespace and remove the leading CAndreas Kling
I've been wanting to do this for a long time. It's time we start being consistent about how this stuff works. The new convention is: - "LibFoo" is a userspace library that provides the "Foo" namespace. That's it :^) This was pretty tedious to convert and I didn't even start on LibGUI yet. But it's coming up next.
2020-01-18Meta: Add license header to source filesAndreas Kling
As suggested by Joshua, this commit adds the 2-clause BSD license as a comment block to the top of every source file. For the first pass, I've just added myself for simplicity. I encourage everyone to add themselves as copyright holders of any file they've added or modified in some significant way. If I've added myself in error somewhere, feel free to replace it with the appropriate copyright holder instead. Going forward, all new source files should include a license header.
2020-01-01AK: Move the userspace SharedBuffer from LibC to AKAndreas Kling
This always felt out-of-place in LibC.
2019-12-28Build: wrap make invocations with flock(1)joshua stein
Lock each directory before entering it so when using -j, the same dependency isn't built more than once at a time. This doesn't get full -j parallelism though, since one make child will be sitting idle waiting for flock to receive its lock and continue making (which should then do nothing since it will have been built already). Unfortunately there's not much that can be done to fix that since it can't proceed until its dependency is built by another make process.
2019-12-25Build: support library and generator dependenciesjoshua stein
Instead of directly manipulating LDFLAGS, set LIB_DEPS in each subdirectory Makefile listing the libraries needed for building/linking such as "LIB_DEPS = Core GUI Draw IPC Core". This adds each library as an -L and -l argument in LDFLAGS, but also adds the library.a file as a link dependency on the current $(PROGRAM). This causes the given library to be (re)built before linking the current $(PROGRAM), but will also re-link any binaries depending on that library when it is modified, when running make from the root directory. Also turn generator tools like IPCCompiler into dependencies on the files they generate, so they are built on-demand when a particular directory needs them. This all allows the root Makefile to just list directories and not care about the order, as all of the dependency tracking will figure it out.
2019-12-20Build: clean up build system, use one shared Makefilejoshua stein
Allow everything to be built from the top level directory with just 'make', cleaned with 'make clean', and installed with 'make install'. Also support these in any particular subdirectory. Specifying 'make VERBOSE=1' will print each ld/g++/etc. command as it runs. Kernel and early host tools (IPCCompiler, etc.) are built as object.host.o so that they don't conflict with other things built with the cross-compiler.
2019-12-08LibAudio: Install library and headersAndreas Kling
2019-12-06LibIPC: Get client/server PIDs using getsockopt(SO_PEERCRED)Andreas Kling
Instead of passing the PIDs back and forth in a handshake "Greet" message, just use getsockopt(SO_PEERCRED) on both sides to get the same information from the kernel. This is a nice little simplification of the IPC protocol, although it does not get rid of the handshake since we still have to pass the "client ID" from the server to each client so they know how to refer to themselves. This might not be necessary and we might be able to get rid of this later on.
2019-12-02LibIPC: Rename base classes to IClientConnection and IServerConnectionAndreas Kling
This matches what we're already calling the server-side subclasses better, though we'll probably want to find some better names for the client-side classes eventually.
2019-12-02LibIPC: Move IPC client/server connection templates to LibIPCAndreas Kling
Move over the CoreIPC::Server and CoreIPC::Client namespace stuff into LibIPC where it will soon becomes LibIPC-style things.
2019-11-26AudioServer: Port to socket takeoverSergey Bugaev
2019-11-23AudioServer: Broadcast muted state changes to all clientsAndreas Kling
2019-11-23LibIPC+AudioServer: Allow unsolicited server-to-client IPC messagesAndreas Kling
Client-side connection objects must now provide both client and server endpoint types. When a message is received from the server side, we try to decode it using both endpoint types and then send it to the right place for handling. This now makes it possible for AudioServer to send unsolicited messages to its clients. This opens up a ton of possibilities :^)
2019-11-22AudioServer: Allow muting the system audioAndreas Kling
This patch adds muting to ASMixer, which works by substituting what we would normally send to the sound card with zero-filled memory instead. We do it this way to ensure that the queued sample buffers keep getting played (silently.) This is obviously not the perfect way of doing this, and in the future we should improve on this, and also find a way to utilize any hardware mixing functions in the sound card.
2019-11-05SoundPlayer: Changed some small cosmetic thingsTill Mayer
Renamed "Position" to "Elapsed". "channel/channels" automatically changes now when more than one channel exist. The current file name is now displayed in the window title.
2019-11-05AWavLoader: Fixed incorrect computation of m_loaded_samplesTill Mayer
m_loaded_samples was incremented with the value of the processed buffer. This causes m_loaded_samples to be bigger at some point than m_total_samples when downsampling, as the buffer would contain more samples than actually loaded.
2019-11-04LibAudio: Added playback control features to audio serverTill Mayer
LibAudio now supports pausing playback, clearing the buffer queue, retrieving the played samples since the last clear and retrieving the currently playing shared buffer id
2019-10-19AudioServer: Added ability to get count of samples in the buffer queueTill Mayer
Now the AClientConnection can get the count of samples still in the buffer queue.
2019-10-16LibAudio: Fixed stuttery playback of audioTill Mayer
When playing an ABuffer, the count of samples were determined by the size of the SharedBuffer. This caused small pauses of up to 512 samples during the playback, when the size of the shared buffer was rounded up to a multiple of 4096. This problem was amplified by the fact that the AResampleHelper was created every time a new chunk of audio was to be processed, causing inconsistencies in the playback of wav files.
2019-09-22LibCore: Remove ObjectPtr in favor of RefPtrAndreas Kling
Now that CObject is fully ref-counted, just use RefPtr everywhere! :^)
2019-09-21LibCore: Convert CFile to ObjectPtrAndreas Kling
2019-09-06AK: Rename <AK/AKString.h> to <AK/String.h>Andreas Kling
This was a workaround to be able to build on case-insensitive file systems where it might get confused about <string.h> vs <String.h>. Let's just not support building that way, so String.h can have an objectively nicer name. :^)
2019-09-04LibAudio: Allow tweaking how much get_more_samples() reads from fileAndreas Kling
2019-09-04LibAudio: Add AClientConnetion::try_enqueue() APIAndreas Kling
This is a variant of the enqueue() API that returns immediately and may fail. It's useful when you don't want to block until the audio server can receive your sample buffer.
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-02LibAudio: Explicitly ignore IPC postprocessing requestsAndreas Kling
We don't need to do any IPC postprocessing in LibAudio (yet.) This is the mechanism used by LibGUI to do repaint coalescing etc.
2019-07-30LibCore: Rename CFileStreamReader => CIODeviceStreamReader.Andreas Kling