Skip to content

Multiple USB DACs don't work properly, which were previously reported as working #715

Closed

Description

@unrau

PLATFORM:
Trimui Brick (Hammer)

DACs:

  • Fiio Snowsky Tiny B
  • JCally JM7 Max

NEXTUI VERSION:
NextUI-20260407-0 2fc849a (v6.10.0)

STOCK OS VERSION:
1.1.1

BEHAVIOUR:
(Same behaviour with both DACs.)

  • Whether the DAC is already plugged in on system start, or it's plugged in after system has already booted: (EDIT: This issue only occurs when the DAC is plugged in during boot. If it's plugged in after boot, it functions as expected. This is still sub-optimal, and I'd still consider it a bug).
  • Headphone icon appears as expected.
  • Sound does come through the DAC while playing Pico8 Native games.
  • Changed volume setting in Pico8 doesn't persist after restart, although this is likely a separate issue.
  • Sound does come through the DAC when a targeted file is played in SSH terminal with aplay -D hw:B,0 ('B' here is the name string given to the Snowsky Tiny B by asound, used rather than index number, since index can change ((EDIT: With DAC plugged in during boot, asound seems to consistently apply index 1 to the DAC, and 0 to audiocodec.)))
  • Sound does not come through the DAC under any other circumstance I've tried. Not in SSH terminal with aplay without -D hw: parameter, not emulators, not PAK music player apps, not Rockbox installed via Portmaster, or within Portmaster itself, etc. The audio either comes through the speakers, or isn't audibly played at all. I didn't keep track of the circumstances under which this result changed, but neither result was the expected one: of audio coming through the DAC.

ATTEMPTED FIXES:

  • Power off, leaving powered off for 30 minutes, restart.
  • Factory reset performed in stock OS settings menu, formatting of SD card (Lexar 128GB) and re-installation of NextUI.
  • Various modifications to the /etc/asound.conf file to explicitly set all sound output to 'B' (Snowsky Tiny B). asound.conf file restored to its original state after testing a modification.
  • Creation of persistent user code in /mnt/SDCARD/.userdata/tg5040/auto.sh to override asound.conf. Commands in this file did execute, but did not solve the issue.
  • There was one instance where targeting the index number for the DAC in asound.conf did get audio to play properly through the DAC in other apps and games, but this fixed failed upon restart, and didn't resume working when I changed the asound target from the index number to its name string. Trying the identical fix after factory reset and re-installation of NextUI did not reproduce the temporary fix.

NOTES:

  • Neither of the DACs I tried have their own volume controls.
  • When modifying the asound.conf file, I tried altering the target device in various places within that code, as well as replacing the code altogether. I didn't keep track of specific attempted changes.

Activity

  1. added theissue type on May 2, 2026
  2. unrau commented on May 5, 2026

    @unrau
    Author

    I'd be happy to cooperate with any attempts to fix this, including live chat and remote SSH into my Trimui Brick.

  3. frysee commented on May 5, 2026

    @frysee
    Member

    It is entirely possible a random stock OS update introduced some changes that would explain why it works some users, and entirely fails for others. If I remember correctly, the default asound.conf thats shipping with stock always expect the internal audio path on device index 0. Any chance you could check what constellation you end up with while booting w/ DAC plugged in?

  4. unrau commented on May 6, 2026

    @unrau
    Author

    @frysee , it changes when I boot. Here's the current output of cat /proc/asound/cards:

    0 [B ]: USB-Audio - SNOWSKY TINY B FIIO SNOWSKY TINY B at usb-sunxi-ehci-1, high speed
    1 [audiocodec ]: audiocodec - audiocodec audiocodec
    

    But sometimes the index is swapped.

    Could you share your own asound.conf (or anyone whose usb audio functions), and I can replace mine with that, and see if it works?

    Searching the NextUI code for asound shows references to "/mnt/SDCARD/.userdata/" PLATFORM "/.asoundrc", but that file doesn't exist in my installation of NextUI (where platform is tg5040, for the Trimui Brick). Is it supposed to?

    In case it's helpful, here are the contents of my stock asound.conf, without any of the modifications I attempted:

    # A133
    # audiocodec
    # ac107
    
    ctl.!default {
        type hw
        card audiocodec
    }
    
    pcm.!default {
        type asym
        playback.pcm "Playback"
        capture.pcm "Capture"
    }
    
    pcm.Playback {
        type plug
        slave.pcm {
            type softvol
            slave.pcm PlaybackDmix
            control {
                name "Soft Volume Master"
                card audiocodec
            }
            min_dB -51.0
            max_dB 0.0
            resolution 256
        }
    }
    
    pcm.PlaybackDmix {
        type plug
        slave.pcm {
            type dmix
            ipc_key 1111
            ipc_perm 0666
            slave {
                pcm "hw:audiocodec,0"
                format S16_LE
                rate 48000
                period_size 2048
                buffer_size 8192
                periods 4
            }
        }
    }
    
    pcm.Capture {
        type hw
        card audiocodec
    }
    
    pcm.CaptureAc107 {
        type hw
        card sndac10710036
    }
    
    pcm.CaptureDsnoop {
        type plug
        slave.pcm {
            type dsnoop
            ipc_key 1111
            ipc_perm 0666
            slave {
                pcm "hw:sndac10710036"
                format S16_LE
                rate 16000
                period_size 1024
                periods 4
            }
        }
    }
    
    pcm.PlaybackHpoutSpeaker {
        type hooks
        slave.pcm "PlaybackDmix"
        hooks.0 {
            type ctl_elems
            hook_args [
                {
                    name "HpSpeaker Switch"
                    optional true
                    value 1
                }
            ]
        }
    }
    
    pcm.PlaybackLineoutSpeaker {
        type hooks
        slave.pcm "PlaybackDmix"
        hooks.0 {
            type ctl_elems
            hook_args [
                {
                    name "LINEOUT Output Select"
                    optional true
                    value 1
                }
                {
                    name "LINEOUT Switch"
                    optional true
                    value 1
                }
                {
                    name "LINEOUT volume"
                    optional true
                    value 20
                }
            ]
        }
    }
    
    pcm.CaptureMic {
        type hooks
        slave.pcm "CaptureAc107"
        hooks.0 {
            type ctl_elems
            hook_args [
                {
                    name "Channel 1 PGA Gain"
                    optional true
                    value 20
                }
                {
                    name "Channel 2 PGA Gain"
                    optional true
                    value 20
                }
            ]
        }
    }
    
    pcm.CaptureReference {
        type hooks
        slave.pcm "Capture"
        hooks.0 {
            type ctl_elems
            hook_args [
                {
                    name "ADCL Input MIC1 Boost Switch"
                    optional true
                    value 1
                }
                {
                    name "ADCR Input MIC2 Boost Switch"
                    optional true
                    value 1
                }
                {
                    name "MIC1 gain volume"
                    optional true
                    value 0
                }
                {
                    name "MIC2 gain volume"
                    optional true
                    value 0
                }
            ]
        }
    }
    
    pcm.CaptureAec {
        type plug
        slave.pcm {
            type multi
            slaves {
                a { pcm "CaptureMic" channels 2 }
                b { pcm "CaptureReference" channels 2 }
            }
            bindings {
                0 { slave a channel 0 }
                1 { slave a channel 1 }
                2 { slave b channel 0 }
                3 { slave b channel 1 }
            }
        }
        ttable.0.0 1
        ttable.1.1 1
        ttable.2.2 1
        ttable.3.3 1
    }
    
    
  5. unrau commented on May 6, 2026

    @unrau
    Author

    OK, update:

    Using ChatGPT (I know, I'm desperate), I tried plugging in the DAC after booting, and now it seems to be working consistently. I know I tried that previously, but maybe something else prevented it from working that time, who knows.

    Anyway, for what it's worth ChatGPT thinks that something in the code is expecting the onboard audio to always be index 0, and that this is what's causing the issue. I don't know if that's true, but I did find this in /etc/modprobe.d/alsa-usb.conf:

    options snd_usb_audio index=0
    options snd_audiocodec index=1
    

    Changing it did not persist upon reboot, so I couldn't test if that would work or not.

    In retrospect, the occasional flipping of the indices may have been due to my tinkering with asound.conf.

    I would like to just glue my DAC in place with it plugged into the Brick, so it would be amazing if we could get it working even if it's plugged in during boot.

    I know that the alsa code isn't part of NextUI, but maybe there's something that can be done in NextUI to account for this? If anyone has a suggestion for me to try, I'd love to hear it.

  6. frysee commented on May 6, 2026

    @frysee
    Member

    Searching the NextUI code for asound shows references to "/mnt/SDCARD/.userdata/" PLATFORM "/.asoundrc", but that file doesn't exist in my installation of NextUI (where platform is tg5040, for the Trimui Brick). Is it supposed to?

    I am creating that on the fly for Bluetooth and USB-C, yeah.

    I know that the alsa code isn't part of NextUI, but maybe there's something that can be done in NextUI to account for this? If anyone has a suggestion for me to try, I'd love to hear it.

    The challenge is finding a way to work with the stock OS, not against it so to say. I'm trying to change as little as possible that would affect people down the line, e.g. when booting into stock or changing to another CFW.

  7. reopened this on May 19, 2026
  8. frysee commented on May 19, 2026

    @frysee
    Member

    Reopening for visibility, this one has more information than the other one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions