UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    USB DAC not recognized

    Scheduled Pinned Locked Moved Unsolved Support
    usb dac driver
    5 Posts 3 Posters 969 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      JEffnot
      last edited by

      Hi there, I wanted to connect my Headphone to my USB DAC with my Xiaomi Mi A2. DAC is not recognized by UT. Are external devices not supported?

      arubislanderA 1 Reply Last reply Reply Quote 0
      • arubislanderA Offline
        arubislander @JEffnot
        last edited by

        @jeffnot UT uses the same (build of the) kernel that Android on your device came with. This is to ensure all the on board peripherals have a chance of working. Often these kernels do not include support for external audio devices over USB.
        But if the kernel and hardware support it, in principle it should 'just work''β„’

        πŸ‡¦πŸ‡Ό πŸ‡³πŸ‡± πŸ‡ΊπŸ‡Έ πŸ‡ͺπŸ‡Έ
        Happily running Ubuntu Touch
        JingPad (24.04-1.x daily)
        OnePlus Nord N10 5G (24.04-2.x daily)
        PinePhone OG (20.04)
        Meizu Pro 5 (16.04 DEV)

        J 1 Reply Last reply Reply Quote 0
        • J Offline
          JEffnot @arubislander
          last edited by

          @arubislander thx for your fast reply. On my Android I have to activate OTG to get the DAC working. Is there a similar way on UT?

          J 1 Reply Last reply Reply Quote 1
          • J Offline
            JEffnot @JEffnot
            last edited by JEffnot

            I can find my DAC with "aplay -l"

            And I can load my DAC with "pactl load-module module-alsa-sink device=hw:2"

            Where 2 is the index of my USB DAC.

            Now I got Sound!

            How can i make this permanent, or maybe hotplug?

            1 Reply Last reply Reply Quote 0
            • H Offline
              here_is_mike
              last edited by

              Hey I tried the following:

              make / writable.

              check Vendor ID and Product ID with after you have plugged in the USB DAC :

              dmesg | grep Vendor
              

              for me
              =>
              "New USB device found, idVendor=05ac, idProduct=110a, bcdDevice=26.50"
              (it is a: Apple, Inc. USB-C to 3.5mm Headphone Jack Adapter)
              (for another product with another Vendor and Product ID icould also get another DAC work)

              in cd /etc/udev/rules.d create:
              
              # USB-DAC plug in
              ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="110a", ACTION=="add", RUN+="/usr/local/bin/load_dac_module.sh"
              
              # USB-DAC unplug
              ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="110a", ACTION=="remove", RUN+="/usr/local/bin/unload_dac_module.sh"
              

              reload udev rules:

              sudo systemctl daemon-reload
              
              sudo udevadm trigger
              

              check aplay -l
              for me:
              =>
              card 1 and Device 0

              in /usr/local/bin/ create the scripts:
              1.
              /usr/local/bin/load_dac_module.sh

              #!/bin/bash
              sleep 1
              sudo -u phablet pactl --server "unix:/run/user/32011/pulse/native" load-module module-alsa-sink device=hw:1,0
              

              /usr/local/bin/unload_dac_module.sh

              #!/bin/bash
              
              # search for loaded module
              
              
              sleep 1
              USER="phablet"
              #USERID from phablet= "32011
              PULSE_SERVER="unix:/run/user/32011/pulse/native"
              
              MODULE_ID=$(sudo -u $USER pactl --server "$PULSE_SERVER" list short modules | grep module-alsa-sink | awk '{print $1}'   )
              
              # unload PulseAudio-Module , if it was loaded before
              if [ -n "$MODULE_ID" ]; then
              #    pactl unload-module $MODULE_ID
              sleep 1
              sudo -u phablet pactl --server "unix:/run/user/32011/pulse/native" unload-module $MODULE_ID
              fi
              
              

              make the files writable:

              sudo chmod +x /usr/local/bin/load_dac_module.sh
              sudo chmod +x /usr/local/bin/unload_dac_module.sh
              

              unplug USB DAC
              reboot
              (if the USB DAC was plugged at boot it seem that the DAC does not work than.)
              on a FP4 it took nearly 4 sec till the sound comes from the DAC

              Could somebody test and verify it?

              PS:
              this helped me:
              https://wiki.archlinux.org/title/PulseAudio/Examples#Automatically_switch_audio_to_HDMI

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better πŸ’—

              Register Login
              • First post
                Last post