loader image

ASUS UX582L [Linux, No Audio, Fixed]

What makes us different from other similar websites? Forums Tech ASUS UX582L [Linux, No Audio, Fixed]

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #7998
    thumbtak
    Moderator

    Go to:
    https://fedoraproject.org/workstation/download

    Copy Link:

    Goto:

    https://etcher.balena.io/

    Open:

    balenaEtcher

    Do the following:

    Note:

    Verification might fail. This is the last step. Ignore this.

    Next:

    Unmount the USB drive.

    Next:

    Try the live version of Fedora

    Next:

    Open terminal and run the following commands.

    $ sudo dnf install alsa-tools
    
    $ sudo hda-verb /dev/snd/hwC0D0 0x20 0x500 0x1b
    
    $ sudo hda-verb /dev/snd/hwC0D0 0x20 0x477 0x4a4b
    
    $ sudo hda-verb /dev/snd/hwC0D0 0x20 0x500 0xf
    
    $ sudo hda-verb /dev/snd/hwC0D0 0x20 0x477 0x74
    
    $ sudo dnf install pavucontrol

    Run the following command:

    $ pavucontrol

    Next:

    Next:

    Goto https://www.onlinemictest.com/sound-test/

    Note:

    If you hear sound, the driver is working. You can now proceed with installing Fedora.

    After you finish installing Fedora:

    We need to make sound work on each reboot.

    How to make the commands run on each system start:

    $ sudo dnf install mousepad
    
    $ sudo mousepad /usr/local/bin/audio_fix.sh

    Save the following text in the blank file:

    #!/bin/bash
    sudo hda-verb /dev/snd/hwC0D0 0x20 0x500 0x1b
    sudo hda-verb /dev/snd/hwC0D0 0x20 0x477 0x4a4b
    sudo hda-verb /dev/snd/hwC0D0 0x20 0x500 0xf
    sudo hda-verb /dev/snd/hwC0D0 0x20 0x477 0x74

    Note:

    Save the file.

    Make the script executable:

    $ sudo chmod +x /usr/local/bin/audio_fix.sh

     Create a systemd Service File:

    $ sudo mousepad /etc/systemd/system/audio_fix.service

    Save the following text in the blank file:

    [Unit]
    Description=Audio Fix at Startup
    After=sound.target
    
    [Service]
    Type=oneshot
    ExecStart=/usr/local/bin/audio_fix.sh
    RemainAfterExit=yes
    
    [Install]
    WantedBy=multi-user.target

    Note:

    Save the file.

    Next:

    $ sudo reboot

    Note:
    You should now have audio on each reboot.

    If you experience low volume, run the following command:

    $ alsamixer

    F6 => Select “HDA Intel PCH” => Adjust Master Volume

    • This topic was modified 11 months, 1 week ago by thumbtak. Reason: Added how to fix low volume
    #8058
    thumbtak
    Moderator

    If you find that the sound doesn’t work after a boot, or reboot, do the following.

    Create a service file: Create a new file in /etc/systemd/system/ (e.g., hda-fix.service).

    $ sudo mousepad /etc/systemd/system/hda-fix.service

    Add the service configuration: Paste the following content into the file. The ExecStart lines will execute your commands.

    [Unit]
    Description=HDA-verb commands for audio fix
    After=sound.target
    
    [Service]
    Type=oneshot
    ExecStart=/usr/bin/hda-verb /dev/snd/hwC0D0 0x20 0x500 0x1b
    ExecStart=/usr/bin/hda-verb /dev/snd/hwC0D0 0x20 0x477 0x4a4b
    ExecStart=/usr/bin/hda-verb /dev/snd/hwC0D0 0x20 0x500 0xf
    ExecStart=/usr/bin/hda-verb /dev/snd/hwC0D0 0x20 0x477 0x74
    
    [Install]
    WantedBy=multi-user.target

    Note: I’ve assumed /usr/bin/hda-verb is the correct path. You might need to verify this with which hda-verb.

    Reload systemd and enable the service:

    $ sudo systemctl daemon-reload
    $ sudo systemctl enable hda-fix.service

    Start the service now (optional, to test it):

    $ sudo systemctl start hda-fix.service

    • This reply was modified 8 months, 3 weeks ago by thumbtak. Reason: Fixed the commands
    • This reply was modified 8 months, 3 weeks ago by thumbtak. Reason: Fixed the first line
    #8250
    thumbtak
    Moderator

    My device name recently changed. This is the fix for me.

    1. Check device name:
    $ cat /proc/asound/cards

    2. If you device name is “hwC1D0”, change nothing in the following script. If it isn’t, make sure the script uses the correct device name.

    3. Full script with hwC1Do device name:

    #!/bin/bash
    
    # Script to apply hda-verb commands to the HDA Intel PCH device,
    # which may have a variable card number (C0, C1, etc.) after a reboot.
    
    # --- 1. FIND THE CORRECT DEVICE ---
    # Search /proc/asound/cards for "HDA Intel PCH" and precisely extract its card number (e.g., '1').
    # The -P flag enables Perl-compatible regex for lookbehind to match the number without the space.
    CARD_NUM=$(cat /proc/asound/cards | grep 'HDA Intel PCH' | grep -oP '^\s*\K\d+')
    
    # Check if the card number was found
    if [ -z "$CARD_NUM" ]; then
    echo "ERROR: HDA Intel PCH card not found in /proc/asound/cards." >&2
    exit 1
    fi
    
    # Construct the full device path
    # The D0 is correct for the first device on the card.
    HDA_DEV="/dev/snd/hwC${CARD_NUM}D0"
    
    # Check if the device file exists
    if [ ! -e "$HDA_DEV" ]; then
    echo "ERROR: Device file $HDA_DEV does not exist. Check permissions or driver status." >&2
    exit 1
    fi
    
    echo "Found HDA Intel PCH at Card $CARD_NUM. Corrected device path: $HDA_DEV"
    echo "Applying hda-verb commands..."
    echo "---"
    
    # --- 2. APPLY THE VERBS ---
    sudo hda-verb "$HDA_DEV" 0x20 0x500 0x1b
    sudo hda-verb "$HDA_DEV" 0x20 0x477 0x4a4b
    sudo hda-verb "$HDA_DEV" 0x20 0x500 0xf
    sudo hda-verb "$HDA_DEV" 0x20 0x477 0x74
    
    echo "---"
    echo "All commands executed successfully on $HDA_DEV."
    #8270
    thumbtak
    Moderator

    My device names changed again. The corrected device names are …

    $ sudo hda-verb /dev/snd/hwC1D0 0x20 0x500 0x1b
    $ sudo hda-verb /dev/snd/hwC1D0 0x20 0x477 0x4a4b
    $ sudo hda-verb /dev/snd/hwC1D0 0x20 0x500 0xf
    $ sudo hda-verb /dev/snd/hwC1D0 0x20 0x477 0x74

    Remember to update or create the bash file in $ sudo mousepad /usr/local/bin/audio_fix.sh

    You can test the audio with $ speaker-test -t wav -c 2. Use ctrl + C to stop it.

    • This reply was modified 2 months, 2 weeks ago by thumbtak.
    #8272
    thumbtak
    Moderator

    [SOLUTION] Implementing the Dynamic hda-verb Fix for No/Low Sound

    Following up on our previous discussions about the persistent low-volume or “no sound” issue on certain laptops: this guide details the definitive fix using a dynamic script and systemd. This fix addresses the root hardware bug where a critical internal component, like an amplifier, fails to turn on during the operating system’s startup.

    This fix uses a dynamic script combined with a systemd service to ensure the speakers are always activated correctly upon boot, regardless of which card number your system assigns the sound chip.

    Why The Script Works (The Simple Explanation)

    This boot script’s purpose is to reliably fix the low-volume or mute issue on a specific, known type of audio chip by dynamically identifying and sending the required hda-verb commands. The script achieves this by first iterating through potential sound card slots (C0, C1, etc.) to see which ones are active, and then, crucially, it reads the name of the sound chip (the Codec) from the system files. Only when the script confirms the presence of the exact chip model that requires the fix (e.g., “ALC298”) does it execute the specific, hard-coded hda-verb sequence. This ensures the necessary commands—which directly flip the internal amplifier switch—are applied to the correct device, and only that device, guaranteeing the speakers turn on every time the system boots, regardless of how the operating system numbers the sound cards.

    Step 1: Create the Fix Script

    We’ll create a script named audio_fix.sh in the /usr/local/bin/ directory.

    NOTE: If your codec is NOT ALC298, change the name in the line if [[ "$CODEC_NAME" == "ALC298" ]]; within the script below.

    Use your favorite text editor (e.g., mousepad, nano, or vi) with sudo to create the file:

    $ sudo mousepad /usr/local/bin/audio_fix.sh

    Paste the following content exactly as shown:

    #!/bin/bash
    
    # --- 1. Define the specific fix with its required verbs ---
    # These are the commands that fix YOUR specific audio chip model.
    fix_my_specific_codec() {
    local DEVICE=$1
    echo "Applying fix for Known Codec on $DEVICE..."
    
    # The essential hda-verb commands (replace with yours if needed)
    hda-verb "$DEVICE" 0x20 0x500 0x1b
    hda-verb "$DEVICE" 0x20 0x477 0x4a4b
    hda-verb "$DEVICE" 0x20 0x500 0xf
    hda-verb "$DEVICE" 0x20 0x477 0x74
    
    # Optional: Log success
    echo "hda-verb commands applied successfully."
    }
    
    # --- Main Logic: Find the Device Path and Identify the Chip ---
    # We check through possible sound card slots (0, 1, 2)
    for CARD_ID in 0 1 2; do
    DEVICE="/dev/snd/hwC${CARD_ID}D0"
    
    # Check if the hardware device path exists
    if [ -e "$DEVICE" ]; then
    
    # Read the name of the codec for this card from the kernel files
    CODEC_NAME=$(cat "/proc/asound/card${CARD_ID}/codec#0" 2>/dev/null | grep -i 'Codec:' | awk '{print $NF}')
    
    echo "Found Card $CARD_ID with Codec: $CODEC_NAME"
    
    # --- Send the Direct Commands ---
    # **ACTION:** If the codec name matches the one we need to fix, run the function.
    if [[ "$CODEC_NAME" == "ALC298" ]]; then
    # IMPORTANT: Change "ALC298" to the actual name of your chip if it is different!
    fix_my_specific_codec "$DEVICE"
    
    # Success! Exit the script immediately so we don't check other cards.
    exit 0
    fi
    
    fi
    done
    
    echo "Script finished. No matching known codec found or patched."
    exit 0

    Step 2: Make the Script Executable

    We need to set the executable permission so the system can run the script.

    $ sudo chmod +x /usr/local/bin/audio_fix.sh

    Step 3: Create the Systemd Service File

    Next, we create a service file that tells systemd when and how to run our script during startup.

    Use your text editor with sudo to create the file:

    $ sudo mousepad /etc/systemd/system/audio_fix.service

    [Unit]
    
    Description=Audio Fix at Startup for Specific Codec
    
    After=sound.target
    
    [Service]
    
    Type=oneshot
    
    ExecStart=/usr/local/bin/audio_fix.sh
    
    RemainAfterExit=yes
    
    [Install]
    
    WantedBy=multi-user.target

    Step 4: Activate and Start the Service

    These three commands are essential. They tell systemd to load the new service, set it to run automatically on every boot, and run it immediately for testing.

    1. Reload the systemd manager configuration

    $ sudo systemctl daemon-reload

    2. Enable the service to run automatically on boot

    $ sudo systemctl enable audio_fix.service

    3. Start the service immediately (to test it now without rebooting)

    $ sudo systemctl start audio_fix.service

    Step 5: Test the sound

    $ speaker-test -t wav -c 2

    Stop with ctrl + c.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
TAKs Shack