Closed Atemu closed 1 year ago
The plugin should automatically detect pulse or ALSA based on the audio backend Kodi uses. Can you see what audio device is configured in Kodi?
It's an ALSA sink. Pulseaudio is also available but there is only a Bluetooth dummy device and it isn't selected.
Either way, I think there should be an option to let the user choose. No auto-detection is perfect. It's good and appreciated for a default but not the ultimate setting.
The Bluetooth pulseaudio config is default and for Bluetooth speakers.
Are you able start the plugin from the Kodi interface and ssh into your Kodi-box en post the following log file?
cat /storage/.kodi/userdata/addon_data/plugin.program.moonlight-qt/moonlight-qt.log
Starting the plugin from the CLI will result in moonligh-qt defaulting to pulseaudio.
Closing stale issue for now
Hello @veldenb I would like to reactivate this issue as it seems I have the same problem. I have a Soundcard (hifiberry) installed on my Raspberry Pi 3. In Kodi I select it with "ALSA (hifiberry)" and it works. However in moonlight, the audio is played over HDMI (to the TV). Maybe this is related to this?
What do you need from the log file, it's quite long? Here are the lines with "audio" in it...
00:00:04 - SDL Info (0): Desired audio buffer: 480 samples (1920 bytes)
00:00:04 - SDL Info (0): Obtained audio buffer: 480 samples (1920 bytes)
00:00:04 - SDL Info (0): Audio channel count: 2
00:00:04 - SDL Info (0): Audio channel mask: 3
00:00:10 - SDL Info (0): Initializing audio stream...
00:00:10 - SDL Info (0): done
00:00:10 - SDL Info (0): Starting RTSP handshake...
00:00:10 - SDL Info (0): Audio port: 48000
00:00:11 - SDL Info (0): Starting audio stream...
00:00:11 - SDL Info (0): Received first video packet after 0 ms
00:00:11 - SDL Info (0): Desired audio buffer: 480 samples (1920 bytes)
00:00:11 - SDL Info (0): Obtained audio buffer: 480 samples (1920 bytes)
00:00:11 - SDL Info (0): Audio stream has 2 channels
00:00:11 - SDL Info (0): done
00:00:11 - SDL Info (0): Starting input stream...
00:00:11 - SDL Info (0): Received first audio packet after 0 ms
00:00:11 - SDL Info (0): Initial audio resync period: 500 milliseconds
00:00:11 - SDL Info (0): done
@vanMacG can you start moonlight from Kodi and attach the full log file from /storage/.kodi/userdata/addon_data/plugin.program.moonlight-qt/moonlight-qt.log here?
moonlight-qt.log (I only replaced computer names and uuid)
@vanMacG looks ok. Can you start the plugin again and post your /storage/.kodi/temp/kodi.log
?
@veldenb sure: kodi.log
(In /storage/.kodi/userdata/addon_data/plugin.program.moonlight-qt/moonlight-home/
there is no folder "alsa", only a folder called "Moonlight Game Streaming Project".)
@vanMacG does creating the directory fix the issue? you can run this command on your pi:
mkdir /storage/.kodi/userdata/addon_data/plugin.program.moonlight-qt/moonlight-home/.config/alsa/
@veldenb Perfect, now it works like a charm :)
The line in kodi.log changed from
WARNING <general>: Failed to resolve audio output device, audio within Moonlight might not work: [Errno 2] No such file or directory: '/storage/.kodi/userdata/addon_data/plugin.program.moonlight-qt/moonlight-home/.config/alsa/asoundrc'
to
INFO <general>: New ALSA config file written to /storage/.kodi/userdata/addon_data/plugin.program.moonlight-qt/moonlight-home/.config/alsa/asoundrc
In this asoundrc-file, the code was automatically added for my hifiberry:
pcm.!default "sysdefault:CARD=sndrpihifiberry"
Thank you very much! 🚀
@vanMacG great, I'll add a fix for this in the next release :+1:
On my RPI4 running LE 10, audio only works when I run moonlight via ALSA. Pulseaudio seems to be running but Kodi is not configured to use it. It seems Moonlight tries to use pulse despite that.
There should be an option to choose between PA/ALSA.