Repository navigation
General Clean-up - #1411
General Clean-up#1411
Conversation
roderickvd
left a comment
There was a problem hiding this comment.
The changelog has other entries referencing DeviceNotAvailable that should be updated (if we decide to indeed change). The upgrade guide should be updated as well for anything that breaks the public API.
I'd like to think over if it's worth breaking it.
| let start = std::time::Instant::now(); | ||
| let handle = thread::Builder::new() | ||
| .name("pw_in".to_owned()) | ||
| .name("cpal_pw_in".to_owned()) |
There was a problem hiding this comment.
This (and others) will cause existing WirePlumber rules and stream-restore entries to break, and should be logged.
There was a problem hiding this comment.
Right I've just gone off and done some (Edit: A lot now) research regarding PipeWire persistence (I've rewritten this reply a couple of times, after realizing I was completely wrong multiple times), the change you replied to just changes the thread name, which PipeWire is oblivious to.
The actual places where the stream's name is set is here (and the corresponding input path):
// Before
let stream = StreamRc::new(
core.clone(),
&format!("cpal-playback-{}", std::process::id()),
properties,
)?;
// After
let stream = StreamRc::new(
core.clone(),
&format!("cpal_pw_out_{}", std::process::id()),
properties,
)?;The only thing which changed was the naming, the stream name itself was never a stable persistence key beforehand, it included the PID before and still does. So this rename doesn't change whether WirePlumber can match it.
Client Naming
| Host | Before | After | Persistence | Name Char Limits (Worst-Case Scenario) |
|---|---|---|---|---|
| JACK | "cpal_client_{pid}" | "cpal_jack_client_{pid}" | X | 27/64 |
| PulseAudio | "cpal-pulseaudio-{pid}" | "cpal_pulseaudio_client_{pid}" | X | 33/128 |
| PipeWire | unset | unset | ? |
The longest possible PID is 10 digits, on Windows.
I've added a note in the CHANGELOG.md mentioning the thread and client/node etc naming convention normalization. However, I haven't added anything to UPGRADING.md, because there was no promise of persistence beforehand.
Please let me know if you'd still like anything changed :)
|
I noticed the tests in |
|
I just merged #1382 , which already included the fix for |
…pulseaudio can but is awaiting a PR merge
… for failing to spawn a thread rather than unwraping
3cfd2c6 to
85767ce
Compare
|
I've rebased onto master again then, anything else before I can merge? (I presume Squash is the best option here, due to reverting some things etc.?) |
|
I haven't done a thorough review of this branch yet, lemme do that now |
unsafe impl Send for Devices {}
unsafe impl Sync for Devices {}Found this in wasapi/device.rs when grepping for "{}", is this required? I thought only pub trait HostTrait {
/// The type used for enumerating available devices by the host.
type Devices: Iterator<Item = Self::Device>;It doesn't seem to require Send or Sync here, and here's /// Construct a custom host from an arbitrary [`HostTrait`] implementation.
pub fn from_host<T>(host: T) -> Self
where
T: HostTrait + Send + Sync + 'static,
T::Device: Clone,
<T::Device as DeviceTrait>::SupportedInputConfigs: Clone,
<T::Device as DeviceTrait>::SupportedOutputConfigs: Clone,
{I don't see why this can't be removed, @LastExceed ? |
|
Alright, LGTM. As for merge strategy, I'd personally prefer a merge commit, as the result is ultimately the same as squash merging (namely a single commit on master), except that the reference to the source branch is preserved. Squashing is typically done to reduce complexity in the git history, but since your branch is already sitting at the top of master, I don't see any complexity emerging (also modern git clients typically have a "first parent" option which effectively visualizes the history as if all merge commits were squash merges). |
|
Regarding the unsafe impls, you can just remove them and see if the code still compiles. |
|
Local |
|
wait I totally forgot, |
|
Aaandddd back they go 😄 |
As I code a keep a notepad window open and jot down anything I want to think about later, these were a few small tweaks which I've decided to squash into one PR
- RenameCancelled due to not wanting the API breakage.DeviceNotAvailable->DeviceUnavailable:- Why?: Better English, less words, shorter, matches
HostUnavailablecpal_<host>_client_<pid>cpal_<host>_<dir>(in/out/dup)frames_to_durationon Windowstry_emit_errorin aaudio, when not --featurerealtimeFrom<ndk::audio::AudioError> for Error.From<jack::Error> for Error.extern cratesyntax.ErrorKind::ResourceExhaustedwhen failing to spawn a worker threadunwrap()."{text}"rather than"{}", text.xruns are not reported.crate::duplex::validate_duplex_configduplex::validate_duplex_configthen checking their own reqs