-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ALSA cards missing in Kodi's audio device list #15757
Comments
Startup - Dependency issue. A simple: systemctl restart kodi after some 20 seconds of uptime should fix it. |
no, kodi restart doesn't help: http://ix.io/1DGt The missing "default" audio device on the second card is rather consistent. Here's an example with the Cirrus Logic Audio Card, which uses an alsa card conf to create an iec958 PCM (enabling output only on S/PDIF outputs and setting AES status bits) in addition to the default plughw PCM (which outputs both to analog and S/PDIF):
Kodi enumerates bcm2835 ALSA and RPi Cirrus iec958 PCM: http://ix.io/1DGp When bcm2835 is disabled and RPi Cirrus is the only card both default and iec958 are enumerated
Kodi log: http://ix.io/1DGx It looks to me like we need card specific "Analog"/"default" entries which then make it possible to select default:CARD=... (or hw:CARD=...) in addition to the current default entry (which will be useful for systems with Pulseaudio) |
Your kodi.log does not match our enumeration: https://github.com/xbmc/xbmc/blob/master/xbmc/windowing/rpi/WinSystemRpi.cpp#L49 Custom patches in LE? |
LibreELEC contains a patch to register both AESinkALSA and AESinkPulse (the latter is only used for bluetooth audio, Pulse is installed without pulse.conf in alsa.conf.d and doesn't grab any ALSA devices):
|
I know. I wrote that one years ago, but wanted to make sure :-)
Please add some logging so we know where it is skipped.
Matthias Reichl <notifications@github.com> schrieb am Sa., 16. März 2019,
20:35:
… LibreELEC contains a patch to register both AESinkALSA and AESinkPulse
(the latter is only used for bluetooth audio, Pulse is installed without
pulse.conf in alsa.conf.d and doesn't grab any ALSA devices):
https://github.com/LibreELEC/LibreELEC.tv/blob/master/packages/mediacenter/kodi/patches/kodi-100.14-use-alsa-and-pulse-together.patch
but AESinkALSA.cpp is unmodified
https://github.com/popcornmix/xbmc/commits/newclock5_18.1rc1-Leia/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
***@***.***:~/private/libreelec/libreelec-git$ git grep AESinkALSA.cpp packages/mediacenter/kodi/patches/
***@***.***:~/private/libreelec/libreelec-git$
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#15757 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABCfHTxwz_wEk8kk4ddT8sWlK-ErkGLGks5vXUeKgaJpZM4b3tMb>
.
|
I did a test on Raspbian, using plain kodi master (commit 84498a1) with this patch added HiassofT@7dc284c This was with RPi on-board audio (dtparam=audio=on) and RPi-Cirrus card with alsa card conf to get iec958. Like Debian/Ubuntu Raspbian has "defaults.namehint.showall on" in alsa.conf so PCMs without hints (hw, dmix, ...) are enumerated, too. Here's aplay -L output: http://ix.io/1DQs default:CARD=xxx and sysdefault:CARD=xxx are skpped, RPi-Cirrus doesn't have front:... so only iec958 is enumerated. I then did another quick test with sysdefault exclusion dropped HiassofT@705ac0a kodi log http://ix.io/1DQz and audio device list now have additional entries "bcm2835 ALSA, bcm2835 ALSA" and "RPi-Cirrus, Analog". I haven't tested yet on a device with usual front/surround/... PCMs but I guess with the quick hack test sysdefault:xxx and @:xxx would show up with the same display name in the list - so the display name would need to be adjusted so that @:xxx and sysdefault:xxx can be distinguished. Or remove sysdefault: from the list if @: is enumerated - could be a bit tricky though |
Thanks for your testing. |
I am currently away Snowboarding - choose whatever you think is best - I will review it :-) |
enjoy your time! I have a first version running (with sysdefault removed if "@" is present), will PR it after some more testing |
@anssih: what's your take on this? Original code was yours and works for many years now. |
@fritsch thanks for the ping :) @HiassofT Thanks for the analysis, you seem to be right. The assumption that all "sysdefault" devices are accompanied by "front" is not true. One option is indeed to drop sysdefault exclusion and then drop sysdefault if also "@" exists for the CARD, like done in #15744. Another, AFAICS simpler option would be to add "sysdefault" devices as "@" like "front" devices are. Maybe even instead of "front" to simplify the code, as "sysdefault" was added to ALSA already back in 2011. @HiassofT Can you check if such a change would work, instead? And if so, what do you think? |
@anssih thanks a lot for your feedback! I had thought about enumerating sysdefault instead of front as well but one problem is that front has a device assigned (and in theory cards could have multiple front/surround devices on different devs) whereas sysdefault is a "card-global" device without a dev. From a quick glance through the limited sets of cards I have here (Intel HDA, MAudio 2496 with ICE1712 and a USB audio card) DEV of front/... is 0 on all of them and the Alsa card confs shipped with alsa-lib also seem to have DEV 0 for the front/... PCMs (I haven't checked all of the confs though). So while "guessing" DEV=0 would probably work in most of the cases I wasn't quite satisfied with the approach as it could fail in some corner cases or with future cards. Therefore I went for the PRed approach of removing sysdefault if we also enumerate a front as it will work in those corner cases, too. |
Sorry for the delay. @HiassofT OK, makes sense. |
Can you please let me know if this observation is related to the changes above? A fresh installation of LibreELEC 9.1.002 on a Pi 4B shows the following audio devices: Upon upgrading to the latest Milhouse build (via custom channel: http://milhouse.libreelec.tv/builds/master/RPi4) the audio devices change: Is there a way to get the original device list on the Milhouse build? |
@ailicic My "Milhouse" builds do not yet support RPi4 in any meaningful way - there's a lot that doesn't work (which is known, and on a list to be fixed). Any RPi4-based builds of mine that you've found are early pipe-cleaning trial builds and the RPi4 (with Kodi 19 and kernel 5.y) is still some way from where it needs to be for public testing, which is why I'm not yet publicising these builds, or taking bug reports. For RPi4, the only supported releases are currently the official LibreELEC 9.2 alpha builds. |
Alright. Thanks for the info. Great work on the custom build! |
Bug report
Describe the bug
The list of ALSA devices is missing cards, for example on a Raspberry Pi with enabled on-board ALSA audio and an audio card only the on-board ALSA device is listed.
This issue was recently reported on the forum https://forum.kodi.tv/showthread.php?tid=298461&pid=2834194#pid2834194 with LibreELEC Milhouse testbuilds, current LibreELEC 9 and older builds also show this behavior.
Expected Behavior
Kodi lists both on-board ALSA and the addon card.
Actual Behavior
Kodi only lists the on-board audio (bcm2835 ALSA), the addon card is missing in the audio device list.
To Reproduce
Enable both on-board audio and an audio card in config.txt, eg with these line (no actual hardware required)
Debuglog
aplay -L lists both cards:
But Kodi only enumerates bcm2835 - debug log: http://ix.io/1DE9
Additional context or screenshots (if appropriate)
It looks like a key point to trigger the issue is that the addon ALSA card doesn't have (or need) an ALSA card conf which creates additional PCMs like front, surroundX etc. Only the default plughw PCM (plus it's sysdefault mirror) from alsa-lib are created, and that's fine for the card as it's a simple 2-channel only audio device.
From a quick glance at the code the "default" PCM enumeration handling looks a bit odd and doesn't seem to cover the case where multiple card-specific default PCMs are available on the system. Only the first default PCM (which on typical desktop Linux systems with Pulse audio is a global "pcm.!default" PCM) are picked up, other (sys)default PCMs are filtered out, hence the card isn't shown in the list.
Your Environment
Used Operating system: Linux / LibreELEC
Android
iOS
Linux
OSX
Raspberry-Pi
Windows
Windows UWP
Operating system version/name: LibreELEC 9.0.1, LibreELEC Milhouse RPi2 builds
Kodi version: 18.1 master
The text was updated successfully, but these errors were encountered: