No audio on intel baytrail minipc

  • 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

  • Before getting any sound I should do:

    Code
    alsaucm -n -b - <<EOM
    open bytcr-rt5640
    reset
    set _verb HiFi
    set _enadev Headphones
    EOM
    Quote

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

    By seeing 'sine' I thought it should make some varying pitch sound. Only after a while I remembered any sound is some kind of sine :)

    Those beeps are fixed-pitch sounds in both ears at the same time. If I set -c 1 then it plays same beeps in both ears, just quieter.

    I also tested with some mono wav from internet:

    http://www.mauvecloud.net/sounds/pcm1644m.wav

    This plays it loud: speaker-test -c 2 -r 44100 -t wav -w /storage/pcm1644m.wav

    This plays it quiet: speaker-test -c 1 -r 44100 -t wav -w /storage/pcm1644m.wav

    The sound is correct (laugh), just on both ears instead of one.

    Also, when I try to play something with kodi, the sound output gets some garbage - some high-pitched distortion of the original sound.

    I did not try any alternative firmware. Maybe I'll find some time later today.

    Andrius

  • Hello,

    today I tried another one headphone and it seems, that speaker-test now works as expected (after putting alsaucm config into autostart.sh). The other headphones probably had some problems with correct contacts...

    But Kodi on this Hiassoft build spoils the sound - after systemctl start kodi the earphones start getting white noise. Also, kodi seems unstable - it struggles to play movies and music. It plays music too fast and very very quietly, it jumps a second here and there, it loops movies unexpectedly. Is there any way to use the kernel with firmware loading from the build like this, but take the kodi from a more stable branch?

    Andrius

  • 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

  • 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.

    Yes, you're right. I downloaded a sample from here: audiotestfiles.zip

    I tried aplay audiotestfiles/sourceCode\sourceCode/WAV/PCM 24 bit/pcm stereo 24 bit 48kHz.wav and it sounded very quietly, way too fast and without any stereo effect.

    An additional problem with Kodi is if I do not stop it after booting libreelec, it makes the system freeze - the picture on the screen stays static as it was before the freeze, mouse pointer does not move, ssh on port 22 not responding. Can it happen because of audio fw/driver issues?

    I'll try with different firmware files and will post the results here.

    Andrius

  • First try - with local fw_sst_0f28_ssp0.bin:

    Code
    minipc:~ # cp /lib/firmware/intel/fw_sst_0f28_ssp0.bin .config/firmware/intel/fw_sst_0f28.bin
    minipc:~ # ls -la .config/firmware/intel
    total 696
    drwxr-xr-x    2 root     root          4096 Dec 27 12:41 .
    drwxr-xr-x    4 root     root          4096 Dec 22 18:19 ..
    -rw-r--r--    1 root     root        701622 Dec 27 12:41 fw_sst_0f28.bin
    minipc:~ # reboot 
    Code
    minipc:~ # cat /storage/.config/autostart.sh 
    alsaucm -n -b - <<EOM
    open bytcr-rt5640
    reset
    set _verb HiFi
    set _enadev Headphones
    EOM
    minipc:~ # aplay pcm\ stereo\ 24\ bit\ 48kHz.wav 
    Playing WAVE 'pcm stereo 24 bit 48kHz.wav' : Signed 24 bit Little Endian in 3bytes, Rate 48000 Hz, Stereo

    Does not play any music, I can only hear two little "clicks": when starting to play and also when finishing to play.

    Same result - no music, just small "clicks".

  • Second try - with file from windows driver package: I5qudong/DriverPackage/Installer/PlatformInstaller/Drivers/audio/realtek_fw_sst.bin

    speaker-test does not play anything at all - no clicks. Also, there are some errors in dmesg output. The pc probably did not like the firmware...

  • I also tried the Asus-T100 firmware you referenced previously - the result the same as with default firmware included in hiassoft build - after alsaucm cofinguration I get a working speaker-test, but distorted sound and unstable Kodi.

    Out of curiosity, I also tried to reboot with an empty firmware file:

    Code
    minipc:~ # rm .config/firmware/intel/fw_sst_0f28.bin 
    minipc:~ # touch .config/firmware/intel/fw_sst_0f28.bin 

    As a result I got dmesg with some firmware loading errors (as expected). Also, video playing was smoth - without any jumps or gui appearances.

    But after stopping the movie, it froze at some moment. Maybe some kernel/OS issue?

    My ideas/questions for now are these:

    1) is it possible to get Kodi talk to audio port just like speaker-test does - using 16 bits?

    2) maybe it will be easier to buy an USB audio adapter and make Kodi talk to it instead of baytrail audio? Is it easy to direct Kodi sound to usb? Is there a known list of (cheap) working usb sound cards?

    Kind regards

    Andrius

  • 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