veldenb / plugin.program.moonlight-qt

A launcher and updater for running Moonlight-qt on LibreELEC.
GNU General Public License v3.0
86 stars 11 forks source link

No audio with 0.14.0 #42

Closed witchent closed 8 months ago

witchent commented 8 months ago

Hello again, After installing the build everything went fine, but then I just restarted my pi and tried streaming again, and now I cannot get my audio to work. I do have a non-default audio device selected in kodi's setting (and I tried all ALSA devices), but cat /storage/.kodi/userdata/addon_data/plugin.program.moonlight-qt/moonlight-qt.log says:

ALSA lib /build/build.LibreELEC-RPi4.aarch64-12.0-devel/build/alsa-lib-1.2.10/src/pcm/pcm.c:2675:(snd_pcm_open_noupdate) Unknown PCM sysdefault|vc4-hdmi-0 ()
00:00:15 - SDL Error (0): Failed to open audio device: ALSA: Couldn't open audio device: No such file or directory
00:00:15 - SDL Info (0): Audio channel count: 6

I think this is the whole relevant part, everything else also seems to work just fine. But if you need the whole log let me know (as well as if I can try anything here). If I select a different output the error is adapted accordingly.

veldenb commented 8 months ago

Looks like the plugin picks up sysdefault|vc4-hdmi-0 instead of vc4-hdmi-0 as audio device, maybe something changed in Kodi's RPC service or something like that.

witchent commented 8 months ago

Well I just dirty-removed 'sysdefault|' from device_name in moonlight.py, and now it says

ALSA lib /build/build.LibreELEC-RPi4.aarch64-12.0-devel/build/alsa-lib-1.2.10/src/pcm/pcm.c:2675:(snd_pcm_open_noupdate) Unknown PCM vc4-hdmi-0 ()
00:00:08 - SDL Error (0): Failed to open audio device: ALSA: Couldn't open audio device: No such file or directory

So I am guessing this was not it, or did you mean something else?

witchent commented 8 months ago

And actually, if I change the audio output, I sometimes get

ALSA lib /build/build.LibreELEC-RPi4.aarch64-12.0-devel/build/alsa-lib-1.2.10/src/conf.c:5569:(parse_args) Parameter DEV must be an integer
ALSA lib /build/build.LibreELEC-RPi4.aarch64-12.0-devel/build/alsa-lib-1.2.10/src/conf.c:5711:(snd_config_expand) Parse arguments error: Invalid argument
ALSA lib /build/build.LibreELEC-RPi4.aarch64-12.0-devel/build/alsa-lib-1.2.10/src/pcm/pcm.c:2675:(snd_pcm_open_noupdate) Unknown PCM hdmi:CARD=vc4hdmi0,DEV=0|vc4-hdmi-0 (vc4hdmi0)
00:00:05 - SDL Error (0): Failed to open audio device: ALSA: Couldn't open audio device: Invalid argument

instead. Maybe this helps?

witchent commented 8 months ago

I found a solution, at least for me. I will just create a PR. I tested it with LibreELEC 11, and all sound devices I havel and it did not break anything, but better check it as well. Thanks for the guidance already. I created a PR so you can see it, but basically what worked is remove everything from device_name after the |.

veldenb commented 8 months ago

Thanks for the fix, I reworked it a little and added it for the next release.

witchent commented 8 months ago

No problem, thanks again for your work.