summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibAudio/ClientConnection.cpp
AgeCommit message (Collapse)Author
2021-11-15Audio: Fix code smells and issues found by static analysiskleines Filmröllchen
This fixes all current code smells, bugs and issues reported by SonarCloud static analysis. Other issues are almost exclusively false positives. This makes much code clearer, and some minor benefits in performance or bug evasion may be gained.
2021-09-12Audio: Add per-client volumekleines Filmröllchen
Note: While ClientAudioStream has had a volume property, it is only now used in the mixer.
2021-09-12Audio: Change how volume workskleines Filmröllchen
Across the entire audio system, audio now works in 0-1 terms instead of 0-100 as before. Therefore, volume is now a double instead of an int. The master volume of the AudioServer changes smoothly through a FadingProperty, preventing clicks. Finally, volume computations are done with logarithmic scaling, which is more natural for the human ear. Note that this could be 4-5 different commits, but as they change each other's code all the time, it makes no sense to split them up.
2021-07-05LibAudio: Add ClientConnection::async_enqueue()kleines Filmröllchen
async_enqueue() is a wrapper over the async_enqueue_buffer() call to AudioServer. This allows users to asyncronously enqueue audio samples, when the program requires non-blocking audio streaming. This also makes ClientConnection use east-const everywhere.
2021-07-05LibAudio: Improve latency on audio queue failureskleines Filmröllchen
We don't know what is a good time to wait after an audio buffer fails to be processed by AudioServer. However, it seems like decreasing the wait time to 10ms after such a failure should improve latency and has not caused issues in my testing. After all, 10ms is quite some time in audio sample magnitudes.
2021-06-21SoundPlayer: Handle any input file sample rateNick Miller
This commit addresses two issues: 1. If you play a 96 KHz Wave file, the slider position is incorrect, because it is assumed all files are 44.1 KHz. 2. For high-bitrate files, there are audio dropouts due to not buffering enough audio data. Issue 1 is addressed by scaling the number of played samples by the ratio between the source and destination sample rates. Issue 2 is addressed by buffering a certain number of milliseconds worth of audio data (instead of a fixed number of bytes). This makes the the buffer size independent of the source sample rate. Some of the code is redesigned to be simpler. The code that did the book-keeping of which buffers need to be loaded and which have been already played has been removed. Instead, we enqueue a new buffer based on a low watermark of samples remaining in the audio server queue. Other small fixes include: 1. Disable the stop button when playback is finished. 2. Remove hard-coded instances of 44100. 3. Update the GUI every 50 ms (was 100), which improves visualizations.
2021-06-21LibAudio: Sleep less when the audio buffer is fullNick Miller
When using `aplay` to play audio files with a sample rate of 96000, there were occasional one-second gaps in playback. This is because the Audio::ClientConnection sleeps for a full second when the audio buffer is full. One second is too long to sleep, especially for high-bitrate files. Changing the sleep to a more reasonable value like 100 ms ensures we attempt to enqueue again before the audio buffer runs empty.
2021-05-23LibIPC: Remove unnecessary IPC::ServerConnection::handshake()Andreas Kling
This is no longer used by any of our IPC pairs.
2021-05-23AudioServer: Remove unnecessary greet() messageAndreas Kling
2021-05-03Userland: Make IPC results with one return value available directlyGunnar Beutner
This changes client methods so that they return the IPC response's return value directly - instead of the response struct - for IPC methods which only have a single return value.
2021-05-03Userland: Update IPC calls to use proxiesGunnar Beutner
This updates all existing code to use the auto-generated client methods instead of post_message/send_sync.
2021-05-03Userland: Change IPC funcs to use plain arguments instead of a structGunnar Beutner
Instead of having a single overloaded handle method each method gets its own unique method name now.
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-02-01LibIPC: Stop sending client ID to clientsAndreas Kling
The client ID is not useful to normal clients anymore, so stop telling everyone what their ID is.
2021-01-17AudioServer+LibAudio: Pass audio buffers as Core::AnonymousBufferAndreas Kling
This was the last remaining user of shbufs! :^)
2021-01-16Everywhere: Remove a bunch of <AK/SharedBuffer.h> includesAndreas Kling
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling