xfangfang / Macast

Macast is a cross-platform application which using mpv as DLNA Media Renderer.
https://xfangfang.github.io/Macast/
GNU General Public License v3.0
6.08k stars 381 forks source link

Works but no visibility on Ubuntu 22.04.03 Wayland #173

Open Linwood-F opened 11 months ago

Linwood-F commented 11 months ago

Versions

Problem

When installed from the .deb package, it works, however it seems inaccessible on the GUI. I confirmed that:

gnome-shell-extension-appindicator/jammy,jammy,now 42-2~fakesync1 all [installed,automatic]

As well as

gir1.2-appindicator3-0.1/jammy,now 12.10.1+20.10.20200706.1-0ubuntu1 amd64 [installed]

are present. When logged in (it's an auto login if that matters) the program auto-starts (I manually put it into the autostart set) and gives this in a little popup at the top of the screen which shortly vanishes:

Macast is hidden
Running at desktop panel

It's not visible anywhere that i can find though it is running, it is as though it cannot connect to the desktop. Looking at it in PS you see:

ferguson    1485    1139  0   894  2304   3 13:21 ?        00:00:00 /bin/macast
ferguson    1780    1485  0 473147 74124  4 13:21 ?        00:00:04 /bin/macast
ferguson    1967    1780  0 171326 55424  2 13:21 ?        00:00:00 mpv --input-ipc-server=/tmp/macast_mpvsocket2734 --image-display-duration=inf --idle=yes --no-terminal --on-all-workspaces --hwdec=yes --save-position-on-quit=yes --script-opts=osc-timetotal=yes,osc-layout=bottombar,osc-title=${title},osc-showwindowed=yes,osc-seekbarstyle=bar,osc-visibility=auto --ontop --geometry=98%:5% --autofit=20%

The file .config/Macast/macast_setting.json is present, I tried setting start at login and maybe some other changes without any impact, it only starts at login if I put it in the desktop startup group. The contents at present are:

   "Additional_Interfaces": [],
    "ApplicationPort": 33081,
    "Blocked_Interfaces": [],
    "CheckUpdate": 1,
    "DLNA_FriendlyName": "Macast(piano)",
    "Macast_Protocol": "DLNA Protocol",
    "Macast_Renderer": "MPV Renderer",
    "MenubarIcon": 1,
    "PlayerDefaultVolume": 100,
    "PlayerHW": 1,
    "PlayerOntop": 1,
    "PlayerPosition": 2,
    "PlayerSize": 1,
    "StartAtLogin": 1,
    "USN": "1bbc4793-ff61-46ca-9910-f3293e1c45b0"

mpv never appears visibly even if running and playing.

No plugins are installed, just the deb package.

Is it not compatible with Wayland and 22.04.03? Or did I perhaps do something incorrectly?

Linwood

huhaorui commented 11 months ago

I have the same problem with you, do you have any ideas now?

Linwood-F commented 11 months ago

No, I just gave up on it.

dreamtale90 commented 1 month ago

Oh, I just upgraded from Deepin 20.9 to V23 and the same thing happened. The MACAST versions of the two systems are the same. I noticed that the MPV version has been upgraded from 0.29 to 0.38, so I debugged the MPV program and found that it did receive instructions from MACAST. I think it may be necessary to adapt to version 0.38 of MPV.

dreamtale90 commented 1 month ago

After some debugging, I found the cause of the problem. The loadfile interface has changed on version 0.38 of MPV.

    - add `index` argument to `loadfile` command. This breaks all existing
      uses of this command which make use of the argument to include the list of
      options to be set while the file is playing. To address this problem, the
      third argument now needs to be set to -1 if the fourth argument needs to be used.
    - move the `options` argument of the `loadfile` command from the third
      parameter to the fourth (after `index`)

Ref: https://github.com/mpv-player/mpv/blob/master/DOCS/interface-changes.rst

The following is an explanation about the index parameter:

The third argument is an insertion index, used only by the insert-at and insert-at-play actions. When used with those actions, the new item will be inserted at the index position in the playlist, or appended to the end if index is less than 0 or greater than the size of the playlist. This argument will be ignored for all other actions.

I finally traced it to MPVRenderer:: set_media_url. Because Macast involves multiple platforms, compatibility with both old and new versions of MPV needs to be considered here. But I don't know how to modify it perfectly, please help adapt.@xfangfang