Posts by HiassofT

    In general I2S soundcards should work fine, but I'm not familiar with the audioinjector octo card.

    Can you please post the full dmesg and vcdbg log msg output?

    Code
    vcdbg log msg 2>&1 | paste
    dmesg | paste

    You seem to have dtparam=audio=on in config.txt, drop that, it's not needed. Also not sure why you have spi=on and i2c_arm=on in config.txt- the devicetree overlay should enable all components so in general it's enough to add the dtoverlay line.

    so long,

    Hias

    Thanks for testing and the feedback!

    Quite certainly the chinese manufacturer choose some odd audio setup/configuration that isn't supported in Linux. So using a USB soundcard is probably the easiest option.

    Some time ago I bought a cheap PCM2704 based USB audio adapter on ebay (approx. 5 EUR shipped from china), which works out of the box in Linux and Kodi. Build quality is about what you'd expect for the price but it has both analog and digital (coax and toslink) outputs and does it's job.

    so long,

    Hias

    I still suspect it's an audio driver or firmware issue.

    Kodi should be fine, it's the same 18.0rc3 version as in the current LE beta and except for a bunch of errors because the baytrail audio device doesn't support surround the kodi log looks fine (at least for opening the audio device).

    One difference between kodi and speaker-test though is that kodi outputs audio in 24bit format whereas speaker-test uses 16bit.

    An interesting test would be playing a 24bit 48kHz stereo WAV file with aplay. If there's a driver / firmware bug it should give the same (or similar) distortions as kodi.

    Can you also test the ssp0 and windows driver firmware files and the amixer settings as I outlined before?

    so long,

    Hias

    I'm using berryboot

    Don't do that, berryboot is causing exactly the issues you are seeing by swapping out LibreELEC's linux kernel with it's own - which is probably missing the driver or some patches.

    LibreELEC 8.2.5 and current LibreELEC 9.0 alpha releases support the DVB dongle out of the box on RPi, without needing to enable any DVB drivers or other stuff.

    Just install LibreELEC directly to an SD card, without using berryboot, or use NOOBS/PINN if you want to have a multi-boot setup.

    so long,

    Hias

    Kodi supports an EjectTray() function, see List of built-in functions - Official Kodi Wiki which is mapped for (infrared) remotes, but not for keyboards.

    The easiest solution is to manually create a .kodi/userdata/keymaps/keyboard.xml file with the appropriate config. eg something like this:to eject the tray when you press e

    Code
    <keymap>
      <global>
        <keyboard>
          <e>EjectTray()</e>
        </keyboard>
      </global>
    </keymap>

    Instead of <e>EjectTray()</e> you can also specify keycodes via eg <key id="123">EjectTray()</key> - see the kodi keymap wiki page for details Keymap - Official Kodi Wiki

    so long,

    Hias

    Thanks for the feedback! Getting "something" out indeed is a bit of a progress :)

    Out of curiosity: what do these "beeps" sound like? speaker-test -t sine should output a 440Hz sine alternating on left and right channels.

    Baytrail audio seems to be a really deep rabbit hole and I'm a bit running out of ideas. Testing different firnwares and trying a few other settings look worthwihile though - although these are just (educated) guesses.

    The driver loads the firmware from `intel/fw_sst_0f28.bin`, so you can create a .config/firmware/intel directory and try with other firmware files - they have to be named `fw_sst_0f28.bin"` and stored in that directory. Just reboot after changing the file and it should be picked up (you can check with `ls -la /lib/firmware/intel/fw_sst_0f28.bin`, that should be a symlink pointing to /storage/.config/firmware/intel/fw_sst_0f28.bin).

    One firmware to test would be /lib/firmware/intel/fw_sst_0f28_ssp0.bin, you can also try the realtek_fw_sst.bin from the windows driver (not idea though if that will work).

    With the ssp0 firmware and maybe also with the realtek firmware you could try alternate config settings related to ssp0 firmwares - I noticed this in /usr/share/alsa/ucm/codecs/rt5640/EnableSeq.conf:

    Code
    # uncomment to enable swap between AIF1 and AIF2
    # warning: can only work with SSP0 firmware enabled
    cset "name='SDI select' 0"
    cset "name='DAI select' 0"
    #cset "name='SDI select' 1"
    #cset "name='DAI select' 1"

    So after configuring the device with alsaucm try the following 2 commands, after that try speaker-test

    Code
    amixer cset name='SDI select' 1
    amixer cset name='DAI select' 1


    You'll probably have to test all combinations of firmware and with/without these amixer commands, maybe some combination of these will succeed.

    When searching the web for baytcr, rt5640 and fw_sst_0f28.bin I came across some (github) repos which had different fw_sst_0f28.bin firmware files for some devices (eg this one firmware/intel at master · Asus-T100/firmware · GitHub) - maybe one of these contain firmware matching your baytrail box.

    so long,

    Hias

    Thanks for the logs! dmesg spam seems to be gone, but there are lots of Alsa errors in the kodi log. I think it's best to focus on getting speaker-test working.

    I looked through the alsaucm docs and noticed I missed an important step: after setting the _verb we also need to enable the (output) device. The output devices "Headphones" and "Speaker" look like good candidates.

    Please try these commands:

    Code
    alsaucm -c bytcr-rt5640 set _verb HiFi
    alsaucm -c bytcr-rt5640 set _enadev Headphones

    Then run speaker-test -c 2 -t sine again and upload dmesg.

    If it didn't work try with the Speakers device - but before we need to disable the Headphones device

    Code
    alsaucm -c bytcr-rt5640 set _disdev Headphones
    alsaucm -c bytcr-rt5640 set _enadev Speaker

    According to the manual using the "reset" command should also work, this should allow us to start from scratch:

    Code
    alsaucm -c bytcr-rt5640 reset
    alsaucm -c bytcr-rt5640 set _verb HiFi
    alsaucm -c bytcr-rt5640 set _enadev Speaker

    Try speaker-test again and grab dmesg.

    If you get any errors on the terminal these would be interesting, too.

    so long,

    Hias

    Read through the IR remote wiki page Infrared Remotes [LibreELEC.wiki] , it contains detailed descriptions and examples which commands to use and how. eg to stop kodi and eventlircd you have to use

    Code
    systemctl stop kodi
    systemctl stop eventlircd

    The posting you linked to includes the same keytable file as we already include in LibreELEC - so that won't help. Also better don't follow the instructions from that post, thinks have change a bit since then and blindly copying udev rule files may make things worse.

    It could be that your old configuration settings are somehow interfering so it's best to drop them. Delete all files in .kodi/userdata/keymaps/ and then reboot so you can start from scratch.

    Before you start tweaking kodi's keymap file verify that kodi is receiving all buttons correctly. Enable debug logging, ssh in and run the following command to get a "live view" on kodi's logfile:

    Code
    tail -f .kodi/temp/kodi.log

    Now press buttons on your remote. For each button press you should see 2 lines logged like these:

    Code
    12:54:03.957 T:1936904864 DEBUG: Keyboard: scancode: 0x66, sym: 0x0116, unicode: 0x0000, modifier: 0x2000
    12:54:03.957 T:1936904864 DEBUG: HandleKey: home (0xf088) pressed, action is FirstPage

    The first line tells you which keycode kodi received, the scancodes should be different for all buttons on your remote. If it's not something's wrong with the ir-keytable configuration.

    The second line tells you the resulting action after kodi applied it's keymap.xml files - you can use this info to verify if you got your keymap.xml file right after you started tweaking it.

    so long,

    Hias

    Can you test this build: libreelec-generic.x86_64-9.0-devel-20181217224448-658cde5.tar

    It includes the Alsa UCM configuration tool and files needed to manually setup baytrail audio.

    After boot quickly ssh in and stop kodi so dmesg doesn't get spammed with "no backend DAI" messages:

    Code
    systemctl stop kodi

    Then run alsaucm to configure the audio device

    Code
    alsaucm -c bytcr-rt5640 set _verb HiFi

    Now use speaker-test to check if you can get audio from the analog output / Line out:

    Code
    speaker-test -c 2 -t sine

    Abort speaker-test with control-c after a couple of seconds and then post dmesg - if you didn't get audio it could be because something else is still missing and/or you may need a different firmware file (maybe the one from the windows driver you mentioned).

    If you got audio, start kodi again with systemctl start kodi and check if it works there, too. If it does. add the alsaucm command to autostart.sh to make the configuration permanent.

    so long,

    Hias

    Thanks a lot for the logs, the firmware error is gone which is a good sign!

    I've checked the alsa-devel mailing list and it looks like baytrail needs some userspace configuration in place before the audio device can be used.

    This stuff (alsaucm) is currently missing in LibreELEC, I'll prepare a new build and post an update when it's finished.

    so long,

    Hias

    Can you test if this build works: libreelec-rpi2.arm-9.0-devel-20181217124947-c8d99e0.tar

    We were missing the driver for the miniuart in the RPi kernels - probably noone noticed that until now as most people only used the pl011 UART (I also usually just disable BT to get a full serial console).

    I did a quick test with this build, with an IQaudio DAC board installed on an RPi3B and console=ttyS0,115200 worked with it (that didn't work before).

    so long,

    Hias