Closed jernejmarcic closed 6 months ago
Hi! Can you create a branch in your repository reproducing the bug? Have you tried using the use_zbus
feature in souvlaki?
Hello main branch in my repo does have the bug you can try to use the program yourself (cargo install --git https://github.com/jernejmarcic/RustyPlayer
if you have Linux) therefore you can just run it you will be able to reproduce the error after you skip to the next track.
As you can see on this image when I initially run the program the metadata is correct:
then when I skip to the next song (which re-runs the function that is ran when the program starts) the metadata is still of the first song that is played when the program is initially run:
Here is when the metadata still worked: https://github.com/jernejmarcic/RustyPlayer/tree/d0873d8fe29b7a7d4a71c4a573f9179e651ccf1f. I will try to use z-bus
and raport
Tried using zbus (souvlaki = { version = "0.7.3", default-features = false, features = ["use_zbus"] }
) however that causes my an error during compile:
error[E0432]: unresolved import `nix::unistd::Uid`
--> /home/jernej/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-3.14.1/src/address.rs:9:5
|
9 | use nix::unistd::Uid;
| ^^^^^^^^^^^^^^^^ no `Uid` in `unistd`
|
note: found an item that was configured out
--> /home/jernej/.cargo/registry/src/index.crates.io-6f17d22bba15001f/nix-0.26.4/src/unistd.rs:73:12
|
73 | pub struct Uid(uid_t);
| ^^^
= note: the item is gated behind the `user` feature
If I instead do use_dbus
I get no errors, however my metedata does not get updated.
Ok. I have my suspicions about why the dbus-crossroads backend isn't working. Still, try running cargo update
after changing to zbus and see if it working then (it works on my machine).
updated it and this time it did not crash, however when I run my program and for example skip to the next song I have get this error (I ran it with RUST_BACKTRACE=full
). Also it still only displays the metadata from the song it plays after running. The media keys despite this error continue to work.
Is there any debugging or changes to my code I should to to make it easier for you?
thread '<unnamed>' panicked at /home/jernej/.cargo/registry/src/index.crates.io-6f17d22bba15001f/souvlaki-0.7.3/src/platform/mpris/zbus.rs:100:22:
called `Result::unwrap()` on an `Err` value: NameTaken
stack backtrace:
0: 0x5a41c792cd3c - std::backtrace_rs::backtrace::libunwind::trace::ha69d38c49f1bf263
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
1: 0x5a41c792cd3c - std::backtrace_rs::backtrace::trace_unsynchronized::h93125d0b85fd543c
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x5a41c792cd3c - std::sys_common::backtrace::_print_fmt::h8d65f438e8343444
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/sys_common/backtrace.rs:67:5
3: 0x5a41c792cd3c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h41751d2af6c8033a
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/sys_common/backtrace.rs:44:22
4: 0x5a41c7959ecc - core::fmt::rt::Argument::fmt::h5db2f552d8a28f63
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/fmt/rt.rs:138:9
5: 0x5a41c7959ecc - core::fmt::write::h99465148a27e4883
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/fmt/mod.rs:1114:21
6: 0x5a41c79290ce - std::io::Write::write_fmt::hee8dfd57bd179ab2
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/io/mod.rs:1763:15
7: 0x5a41c792cb24 - std::sys_common::backtrace::_print::h019a3cee3e814da4
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/sys_common/backtrace.rs:47:5
8: 0x5a41c792cb24 - std::sys_common::backtrace::print::h55694121c2ddf918
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/sys_common/backtrace.rs:34:9
9: 0x5a41c792e193 - std::panicking::default_hook::{{closure}}::h29cbe3da3891b0b0
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/panicking.rs:272:22
10: 0x5a41c792deb4 - std::panicking::default_hook::h881e76b2b8c74280
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/panicking.rs:292:9
11: 0x5a41c792e715 - std::panicking::rust_panic_with_hook::hcc36e25b6e33969c
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/panicking.rs:731:13
12: 0x5a41c792e611 - std::panicking::begin_panic_handler::{{closure}}::ha415efb0f69f41f9
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/panicking.rs:609:13
13: 0x5a41c792d266 - std::sys_common::backtrace::__rust_end_short_backtrace::h395fe90f99451e4e
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/sys_common/backtrace.rs:170:18
14: 0x5a41c792e362 - rust_begin_unwind
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/panicking.rs:597:5
15: 0x5a41c7042fb5 - core::panicking::panic_fmt::h452a83e54ecd764e
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/panicking.rs:72:14
16: 0x5a41c7043583 - core::result::unwrap_failed::hed0fccbe07e724fc
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/result.rs:1652:5
17: 0x5a41c70e98ad - core::result::Result<T,E>::unwrap::h4b9d9c485aa66dad
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/result.rs:1077:23
18: 0x5a41c70ef800 - souvlaki::platform::platform::zbus::MediaControls::attach::{{closure}}::h7ca1327dbb556bb4
at /home/jernej/.cargo/registry/src/index.crates.io-6f17d22bba15001f/souvlaki-0.7.3/src/platform/mpris/zbus.rs:99:17
19: 0x5a41c70cfcb6 - std::sys_common::backtrace::__rust_begin_short_backtrace::h241aa8a3f1df878a
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/sys_common/backtrace.rs:154:18
20: 0x5a41c70b2f5c - std::thread::Builder::spawn_unchecked_::{{closure}}::{{closure}}::h9f66f48474faab34
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/thread/mod.rs:529:17
21: 0x5a41c70ffa40 - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h4d6d3116ebad8517
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/panic/unwind_safe.rs:271:9
22: 0x5a41c70b304a - std::panicking::try::do_call::h353543ce1783b972
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/panicking.rs:504:40
23: 0x5a41c70b30fb - __rust_try
24: 0x5a41c70b2fc2 - std::panicking::try::h17f16b51319d6545
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/panicking.rs:468:19
25: 0x5a41c70b2d9d - std::panic::catch_unwind::h10e5b23fb2673eb2
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/panic.rs:142:14
26: 0x5a41c70b2d9d - std::thread::Builder::spawn_unchecked_::{{closure}}::h77ad5f5cafec4010
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/thread/mod.rs:528:30
27: 0x5a41c708e2ae - core::ops::function::FnOnce::call_once{{vtable.shim}}::h7533c118b76878df
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/ops/function.rs:250:5
28: 0x5a41c7933865 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h51435299acd7166e
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/alloc/src/boxed.rs:2007:9
29: 0x5a41c7933865 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h3f833c0a4926bdd4
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/alloc/src/boxed.rs:2007:9
30: 0x5a41c7933865 - std::sys::unix::thread::Thread::new::thread_start::h2c486d0230ab0d99
at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/sys/unix/thread.rs:108:17
31: 0x750ce716f55a - <unknown>
32: 0x750ce71eca3c - <unknown>
33: 0x0 - <unknown>
That error may occur because you have a process of the music player running in the background. Try doing pkill -9 <name of your executable>
My program does not have any slaves, it re-runs, if I pkill
it then the whole program stops. However tryinig this and looking for processes has alerted me to my programs extreme memory usage hopefully fixing that issue will fix the metadata issue as well
I was a brain-dead moron and I had a skill issue
Hahah, don't beat yourself up. I'm curious, what was the issue?
I had a recursion loop, I had a function call itself recursively where it ran itself inside itself, ate 5mb of RAM every time that happened. Fixed it by having it be a loop instead
First of all I would like to apologize as I am new to reporting issues and this may be bad. My repository where my code is located is: https://github.com/jernejmarcic/RustyPlayer
My metadata does not update (it only shows the metadata from the first song after the program is ran), I used the code straight from examples and pasted it in, when I had my music logic all in a loop it worked, however now it no longer works.
Old working code
Working code example, I apologize if I uploaded more than was needed:
Now this implementation is lacking as It did not allow me to have support to play the previous song.
New not working code
This is the function of my new code:
This code fixes my issue and allows me to traverse my song queue however when I ran it I notices that my metadata is no longer updated
How I tried fixing the issue:
First of all I made sure my variables (title, artist, album_url, duration) were being updated and they were. I tried-making sure metadata is ran so I put it in a loop repeating several times, I tried putting it above the mediakey listener but that just broke it, I tried putting the varaible (
let mut controls = MediaControls::new(config).unwrap();
) in a loop several times and it did not worked. As of now no solutions that I thought of have worked.I would like to thank you for all the help in advance :)