Posts by ippon


    ippon - I answered your post in the main 509/509X thread. I'm not sure why you have the issue in Kodi 17 and not in Kodi 16. Either way, you are using the S/PDIF interface whereas I am using HDMI, so results will be somewhat different. S/PDIF carries only two channels so is limited to PCM stereo or compressed Dolby/DTS multichannel. That said, it should accept all bitrates up to 192kHz and there shouldn't be any re-sampling going on. You mentioned DLNA in your posts also. That could be confusing the issue also. Have you tried playing the files directly from the box (on a USB stick or SD card)? My situation is that I play FLAC compressed files from a network server over SMB or NFS. No DLNA used.


    fat-tony - I try to answer your points:

    • the upsampling happens in both versions (Kodi17 and Kodi16). It was fixed in one Libreelec version (009) and this was a Kodi16.
    • Yes, in fact S/PDIF makes the different. I played a bit around with my boxes today and found that the upsampling happens only on S/PDIF. The output via HDMI has the correct bitrates. Also the dmesg output from Libreelec shows the correct sampling rates (in all Libreelec/Kodi versions). This means 44.1 stereo PCM is played correct via HDMI but it is upsampled to 48k via S/PDIF. I didn’t realize this before, because my Rotel reciever has no HDMI. I had to use a different receiver for testing.
    • I need the S/PDIF only for PCM stereo and for 5.1 passthrough. So the limitation that S/PDIF can’t transport 5.1 PCM is not a problem for me.
    • Yes DLNA is confusing, sorry. You can ignore this. The S/PDIF upsampling happens independent from the music source (I tried also USB stick, SMB, local file system). And it happens independent if the file format (I tried MP3, Flac, WAV).


    As result of your feedback and of my testing today, I meanwhile think that this upsampling has nothing to do with Kodi version or with the librelec implementation (especially because the dmesg shows the correct values and because of the correct bitrates via HDMI). I think it has something to do with the S/PDIF part of the Amlogig audio driver. Also Kszaq wrote that this Amlogig driver if very messy, but that's Kwiboo is working on it. I hope that he can (re-)introduce a fix for this S/PDIF section.

    I don't think my issue is the same. My 44.1kHz / 48kHz / 88.2kHz / 96kHz / audio is all played back at the correct sampling rate according to my amplifier display. I only have issues with 176.4 / 192kHz stereo output. When I was using Kodi on android Marshmallow (the Chinese box default), everything was being re-sampled to 48kHz, but once I installed LibreELEC most of my audio issues went away. I think your problems may be with a setting error somewhere in Kodi. I will have a read of your issue and see if I can see anything.
    [hr]

    That’s really interesting, that audio works in your setup. Here are some more details from my setup:

    • For testing, I always use a clean SD Card setup with kszaq image + device tree
    • I test with my MXQPro 4k (S905), but I have the same upsampling with TX-III (S905X) and Nexbox A95 (S905).
    • I have my receiver (Rotel RSX 1065) connected via SPDIF to the Kodi box
    • I’ve no audio entries in the advancedsettings.xml
    • My receiver shows immediately after kodi startup a bitrate = 48k. Only in version 7.0.2.009 it shows 44.1k. In 7.0.2.009 it changes depending on the source material to the right bitrate. In all other versions it uses only 48k, 96k or 192k.
    • The upsampling happens with any 44.1k audio file (mp3, flac, wav).

    I did some more testing with downloaded clips. 5.1 audio plays back fine at 192kHz. It's just the stereo audio that won't so I think it's selecting the wrong playback format. Works if I use "fixed" sample rate of 192kHz.

    kszaq - what did you change to enable 192kHz playback on S905X?

    Hi fat-tony,

    your audio issue seems to be very close to the issue then I have. All 44.1k two channel audio is upsampled to 48k and, if I try to force Kodi to use 88.1k is uses 96k (see my post here thread-1492.html?highlight=44.1). It was solved in one older version (7.0.2.009), but however the fix hat been reverted in all later versions.

    You may can try the version 7.0.2.009 and see if it works better for you.


    Thanks for this guide. Everything works for me except one thing:
    I changed the Power button and I can turn the box off with it but I can't turn it on with the same button.
    For that I still have to use the original remote. Is there a workaround?

    I think all boxes use their old (Android) mechanism for the remote if they a swiched of. The remote.conf is used when libreelec is running. So I dont see any workaround on the libreelec level.


    felixob Changes that improved audio had to be reverted because clicks and pops. I think Kwiboo is still working on improving audio for S905 devices: sound/soc/aml/m8: work-in-progress by Kwiboo · Pull Request #23 · LibreELEC/linux-amlogic · GitHub

    When the PR is considered final and I am able to confirm that there are no issues with clicks/pops etc., I will merge the changes back.

    I checked 8.0.1b.
    44.1 is converted to 48k and sound is worse then in 7.0.2.009 :(.


    ippon I wrote about S905, not S802. These devices use a different kernel version. There will be no difference in how audio works between 7.0 and 8.0 for S802.


    kszaq
    Ah, now I understand. Before, I thought it were the same for 905 and 802, because also the 802 images do the upsampling.

    I'm aware that the 7.x.x for 802 will have the behaviour then the 8.x.x for 802. In case of my 802 box, it doesn't matter, because I'll not use it for music. I'd prefer the 7.0 on the 802 because then I can use it with my video99 MYSQL database.

    By the way, do you think that the audio enhancements for the 905 boxes will be re-introduced eventually for the 8.x.x versions?


    Am not going to downgrade a feature because your music is encoded at 44.1 sorry.Most users use it at 99% as a movie player and as such 48k is better. Did you try flac?

    Sent from the Island of Venus

    Ups, this was a missunderstanding. I didn't want a downgrade. I only wanted a version from your 7.0.3 from the MX-III-1G (I found it only for the S82). Then I can use my MX-III as videoplayer with my MYSQL database (video99).

    Yes I tried flac (I tried nearliy erverthing) with the same result. I'f I understood kszaq right, the librelec developers stay actually on an older version from the Amlogic audio drivers. This old drivers have the umsampling problem. They tried a newer version of the drivers (in 7.2.0.9) - this fixed the upsampling but brought other problems, so they reverted back to the older dirver version in the newer releases.


    I can fix it but 48k is better than 44.1k and output is native weird you think it sounds worse

    Sent from the Island of Venus

    Yes, of course 48k is better then 44.1. But only if the material is recorded in 48k (like movies or music from DVDs like a live concert). Most of my musik is recorded in 44.1 (standard audio CD). Whenever this material is upsampled, the quality goes a bit down (not dramatically, but I can hear it). In Version 7.2.0.9 it works perfektly (44.1 music ist planed in 44.1 and 48k movies are planed in 48k over SPDIF). All other libreelec versions convert erverything to 48k.

    Anyway I've two 905 boxes and I use them for music. Here I stay on version 7.2.0.9 until the upsamling issue is fixed. My 3. box is the MX-III-1G. I'll use it only for video so upsamling is not an issue here. Because of my shared MYSQL Media-Database I can't mix Jarvis (7.2.0.9) and Krypton. That was the reason why I asked you to compile a 7.x.x version for the MX-III-1G.

    On the other hand, if you are able to fix the upsampling, of couse I will try it.

    Hi Demetris,

    gerat work! I've tested all your 8.x.x Versions on my MX-III-1G and they are running perfectly.

    The only issue I have with all libreelec versions it that audio over SPDIF is always upsampled from 44.1k to 48k and the audio quality gets worse (see thread-1492.html?highlight=44.1). Because of this a stay for a while on version 7.0.2.009 with my S905Box in the living room where I use SPDIF. I use a cantral mysql database, so I don't want to mix Jarvis and Kypton.

    Is is possible, that you genarate a 7.x.x version for the MX-III-1G?

    Cheers,
    ippon

    Hi kszaq,

    I would really like to switch to your newest version (especally for getting kodi 17), but I stiil stick on 7.0.2.009 becouse this the only version where the audio upsampling (44.1 -> 48) was fixed. I while ago, you wrote that the audio driver had been reverted becouse of 'klicking and poping' sounds in version 7.0.2.009 but is will be upgraded when this issues are fixed.

    In the meantime: is it possible to exchange this audio driver in an existing installation (e.g. your 8.0.0e) with the audio driver from version 7.0.2.009 (if yes, how)?. If this is not possible, my I ask you to compile a subversion with the changed audio driver?

    Best regards,
    ippon

    I have ben banging my head against the wall for almost 2 hours now. I almost exclusively use a 2.4 mini Keyboard and today trying to use the stock remote I have hit a wall. I attempted to copy and the remote,conf from android and paste it into LE without any success. No button on the remote generates anything, I tried to use the KeyMap Editor thinking maybe it just wasn't lined up right, but it does not detect any keypresses.
    Anyone have this, or any imput that I may have not tried?
    Yes I replaced the batteries first

    I've had the same problem. I've created a new remote.conf for my box and now it's working. Here is the HowTo (Title ' Create remote.conf from scratch ' ).

    thread-3581.html?highlight=remote.conf

    I have a new TX3-Pro (S905X- Android 6) box. I run it with kszaq 7.0.2.009 version (thanks to kszaq, great job!). The only problem I had was that the remote control didn’t work at all. Also copying remote.conf from the Android /etc folder to libreelec /storage/.config didn’t help. I thought a while, that may be the device tree (dtb) was wrong for my box but this wasn’t. It was the remote.conf. It seems to me, that Android 6 uses a remote configuration different from the /system/etc/remote.conf.

    After ‘googleing’ a while, I found a description from a openelec user. He build a romete.conf from scratch for a WeeTeck-Box. I tried and it works. I was able to generate a working remote.conf for my box and now may remote works perfectly. Another benefit is, I was able to do my preferred key mapping.

    I’ve seen a lot of posts regarding a not working remote-control. Hopefully my post will help a little bit.

    1) Peparation
    Copy a remote.conf file to libreelec Configuration folder over SSH :
    /storage/.config
    or using Windows shares:
    \\your_box_IP\Configuration

    You can either use my file from the post or the file from your Android. If you use your file, take care that:

    • all lines between key_begin and key_end are deleted or marked as comment (leading #)
    • debug_enable = 1


    2) Set Factory Code
    Open the /storage/.config/remote.conf in any editor. You can also use the windows share \\your_box_IP\Configuration.
    Open a SSH session to your box (I use putty for this. User root, password libreelec).
    Type ‘dmesg –c’ in the ssh terminal. Ignore the message, it’s only for clearing the cache.
    Press any key in your remote control and directly dmesg -c in the ssh terminal. You will get something like this:

    Code
    wrong custom code is 0xXXYYZZZZ

    Go to the editor with the remote.conf. You will find a line like this:

    Code
    factory_code = 0x12340001

    Change the factory_code with this 0xZZZZ0001 (ZZZZ is the digits you have got as 'wrong custom code is' from the ssh above).
    For example if you get in the dmesg wrong custom code is 0x14fg76ad then your factory_code should be 0x76ad0001.
    Save the remote.conf and type 'remotecfg remote.conf' in the shell (or reboot your box). Factory code is set.

    3) Key Map
    Open the remote.conf in editor and the ssh in 2nd window again. Type Type ‘dmesg –c’ in the ssh terminal and ignore the message.
    Press any key in your remote control and directly dmesg -c in the ssh terminal. You will now get something like this:

    Code
    remote: scancode is 0x0043,invalid key is 0x0000.


    If you get this, the Factory code was set correctly.

    Now you can start the do the keymapping. In my remote.conf file, you’ll find the lines between key_begin and key_end likes this:
    # 0xca 116 ;POWER
    # 0x07 105 ;KEY_LEFT
    Start with the fist line. Press the POWER button on your remote. Type dmesg -c in the ssh terminal. You will now get something like this:

    Code
    remote: scancode is 0x0043,invalid key is 0x0000.

    Change the 1st line in the remote.conf to
    0x43 116 ;POWER
    This means:
    - removing the leading # (line is active)
    - change 0xca to 0x43 (change old/wong remote code with the correct code.)
    - keep 116 (this is the linux code for POWER button).You need to do this for all lines in the file. Don’t forget to save from time to time.

    Do this for all lines in the file.
    If you have no corresponding button on the remote, keep the line unchanged or delete it.
    If you have keys on the remote with no corresponding line in the file, you can create a new line. For this, you need to now the right linux code. In the link below, you’ll find all avalible codes. Not all of them work in Kodi, so you need to play a bit with the codes.
    linux/input-event-codes.h at master · torvalds/linux · GitHub

    If you set the code for all buttons on your remote, save the remote.conf and and type 'remotecfg remote.conf' in the shell (or reboot your box). Key Maping is done.

    4) Mouse
    If you like to use the mouse function on your remote, you have to define one key on your remote as mouse key. To get the mouse working, you also need to set the values in the upper section of the remote.conf. This are the lines you need to change. The '0x25' is the value you need to change with the value you got bavk from the ‘dmesg –c’. You also need to remove the leading '#'.



    5) repeat key section
    This is for keys on your remote where you like to have a repeat function if you press the key and keep it pressed. The only thing you need to do is to copy the relevant lines from the key section into the repeat_key section. I did it with the for lines for 'left', 'right', 'up', 'down'.

    Hi kszaq,

    I've tested the 64Bit 7.0.3.011 version with device tree gxbb_p200_1G_100M on my MXQ-Pro 4k, S905, 1GRam, 8GRom (only on SD card install)

    + update worked (I cpoied .gz and device tree in update folder)
    - after 1st reboot the box was in black sceen (after MXQ Logo). Same in 2nd reboot. After 3rd reboot it came up all times.
    + the box was stable and everything worked
    - my music is upsampled from 44k to 48k (connected via SPDIF). This was fixed in version 7.0.2.009 but in .010 and .011 it's back again.

    I'll stick on version .009 becouse of the upsampling. Is it possible to get a 32bit Version of .009?

    Hi kszaq,

    I've tested the 32Bit 7.0.3.010 version with device tree gxbb_p200_1G_100M (12. Dec) on my MXQ-Pro 4k.

    + update worked (I cleaned the cache and updated all apps)
    + the box was stable and all apps work
    + I had no booting issues when the Box was conntected at my Sony TV
    - the Box didn't boot when it was conntected at my Philips TV and the TV is in standby. When TV is switched on, Kodi boots. I gues the booting issue has something to do with HDMI-CEC.
    - after choosing "update channel" in libreelec settings, the libreelec setting page was blanc.
    - my music is upsampled from 44k to 48k (connected via SPDIF). This was fixed in version 7.0.2.009 but now it's back again.