Friday, 20 October 2017

Fixing broken HDMI audio

Recently I noticed that I had no HDMI audio when running kernels starting from v4.12.0 on an Intel Compute Stick model STK1AW32SC (Cherry Trail).

First I ran the command 'aplay -l' to see I had an HDMI LPE Audio device. In fact I had three:


I then tried playing an audio file on the default device with 'aplay /usr/share/sounds/alsa/Front_Left.wav' which didn't work:


So I listed the PCM devices with 'aplay -L':


and tested each PCM in turn:


which confirmed that audio worked on device 2. 

As the default sink device is 0:


it needs to be changed by editing '/etc/pulse/default.pa'. I can do this manually:


 or write and use a script:


The advantage of the script is that I can make use of it when respinning an ISO with 'isorespin.sh' (using the '-f' option) and automatically fix HDMI audio in the respun ISO for use on this device.

After running the script whilst using Ubuntu 'pulseaudio' needs to be restarted (using 'pulseaudio -k' is sufficient) for the changes to take effect:


Now playing an audio file on the default device with 'aplay /usr/share/sounds/alsa/Front_Left.wav' works together with sound in Chrome and other applications.

Please donate if you find this tip helpful using the following link http://goo.gl/nXWSGf.

12 comments:

  1. I can read as far as aplay -L , but the later text is too small and blurred . I am using the Lenovo 100s , and am useless at linux having recently come over from windows because of the ghastly update schedule. Please post the actual commands full size !!

    ReplyDelete
    Replies
    1. The actual commands will vary depending you your device. In the examples below I substitute '0,2' for ',' as this was one of the values returned by 'aplay -l'.

      Testing command:
      aplay -D plughw:, /usr/share/sounds/alsa/Front_Left.wav
      e.g.
      aplay -D plughw:0,2 /usr/share/sounds/alsa/Front_Left.wav

      Script command:
      sed -i 's/#load-module module-alsa-sink/load-module module-alsa-sink device=hw:,/' /etc/pulse/default.pa
      sed -i '/### Automatically load driver modules depending on the hardware available/,/.endif/ s/^/# LINUXIUM #/' /etc/pulse/default.pa
      e.g.
      sed -i 's/#load-module module-alsa-sink/load-module module-alsa-sink device=hw:0,2/' /etc/pulse/default.pa
      sed -i '/### Automatically load driver modules depending on the hardware available/,/.endif/ s/^/# LINUXIUM #/' /etc/pulse/default.pa

      Checking sinks command:
      pacmd list-sinks

      Also clicking on the images should open a window with them displayed full size after which you can download and zoom them.

      Delete
  2. Awesome, thanks for the solution! I'll try it this weekend and report back.

    ReplyDelete
  3. Thanks! You are save me from glitchy Windows on Meegopad t08, that even freeze on youtube videos on full screen even after all updated and fresh drivers =) Sound works on default Ubuntu 17.10, other things works good, except of Broadcomm WiFi.

    ReplyDelete
    Replies
    1. Did you copy across the wifi firmware from Windows and also restart the 'systemd' service? See both 'Wifi issues' and 'Bluetooth issues' in my documentation ('https://linuxiumcomau.blogspot.com.au/2017/06/customizing-ubuntu-isos-documentation.html').

      Delete

  4. Lenovo 100S. Sound fix for now . If u can work with an external USB sound device , This works well :- http://www.ebay.co.uk/itm/New-Mini-USB-2-0-3D-Virtual-12Mbps-External-7-1-Channel-Audio-Sound-Card-Adapter/192059592566?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649


    Not a long term solution because mint 18.4 is supposed to connect to the Lenovo sound device OK. -- but for £1 it is worth it just to HEAR news on wifi TV

    ReplyDelete
  5. Asus E200 HA Linux 4.13 Artfull
    Doesn't work :(

    tested from hw0,0 to hw1,2

    moi@MonPC:~$ pulseaudio
    W: [pulseaudio] pid.c: Stale PID file, overwriting.
    E: [pulseaudio] module-alsa-sink.c: Failed to parse module arguments
    E: [pulseaudio] module.c: Failed to load module "module-alsa-sink" (argument: "device=hw:0,2 ####################"): initialization failed.
    E: [pulseaudio] main.c: Module load failed.
    E: [pulseaudio] main.c: Échec lors de l'initialisation du démon
    moi@MonPC:~$ pulseaudio
    E: [pulseaudio] module-alsa-sink.c: Failed to parse module arguments
    E: [pulseaudio] module.c: Failed to load module "module-alsa-sink" (argument: "device=hw:0,1 ####################"): initialization failed.
    E: [pulseaudio] main.c: Module load failed.
    E: [pulseaudio] main.c: Échec lors de l'initialisation du démon
    moi@MonPC:~$ pulseaudio
    E: [pulseaudio] module-alsa-sink.c: Failed to parse module arguments
    E: [pulseaudio] module.c: Failed to load module "module-alsa-sink" (argument: "device=hw:0,0 ####################"): initialization failed.
    E: [pulseaudio] main.c: Module load failed.
    E: [pulseaudio] main.c: Échec lors de l'initialisation du démon
    moi@MonPC:~$ pulseaudio
    E: [pulseaudio] module-alsa-sink.c: Failed to parse module arguments
    E: [pulseaudio] module.c: Failed to load module "module-alsa-sink" (argument: "device=hw:1,0 ####################"): initialization failed.
    E: [pulseaudio] main.c: Module load failed.
    E: [pulseaudio] main.c: Échec lors de l'initialisation du démon
    moi@MonPC:~$ pulseaudio
    E: [pulseaudio] module-alsa-sink.c: Failed to parse module arguments
    E: [pulseaudio] module.c: Failed to load module "module-alsa-sink" (argument: "device=hw:1,1 ####################"): initialization failed.
    E: [pulseaudio] main.c: Module load failed.
    E: [pulseaudio] main.c: Échec lors de l'initialisation du démon
    moi@MonPC:~$ pulseaudio
    E: [pulseaudio] module-alsa-sink.c: Failed to parse module arguments
    E: [pulseaudio] module.c: Failed to load module "module-alsa-sink" (argument: "device=hw:1,2 ####################"): initialization failed.
    E: [pulseaudio] main.c: Module load failed.
    E: [pulseaudio] main.c: Échec lors de l'initialisation du démon
    moi@MonPC:~$ pulseaudio
    E: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
    E: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="1" name="platform-bytcht_nocodec" card_name="alsa_card.platform-bytcht_nocodec" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1""): initialization failed.

    ReplyDelete
  6. It was working on zesty 4.10 !! ...

    ReplyDelete
  7. ASUS T100HA. Same problem basically. It turns out that (in my case) the chtrt5645 card is available due to the linuxium added driver stuff but the pulseaudio daemon will not start. I've tried various things suggested on the net but nothing yet. I'll keep hitting it and let you know. If anyone has suggestions I'd love to hear them.

    ReplyDelete
    Replies
    1. Most likely a miss-match between the combination of kernel, PulseAudio and UCM files.

      Delete
  8. I have a problem with my Kino Slimnote 14.1. When I play laptop on battery charger everythings works fine, but when I play laptop on battery a don't have sounds...

    ReplyDelete