Jump to content

Enable audio output/input with USB sound card dongle on Amlogic Tv Boxes


Recommended Posts

Posted (edited)

I have installed Armbian community images several times on different tv boxes that have an Amlogic S905x3, and usually there was no sound ♫. I wanted to get sound out of the tv box. So, I purchased a generic USB sound card audio dongle from Aliexpress for about $2 to $3 USD. (see attached photo). The USB audio device is described in Linux as a Texas Instruments PCM2902 Audio Codec (USB PnP Sound Device device 0 USB Audio), and when you run the command lsusb you will see the id numbers 08bb:2902.  However, the specific hardware chip in the device that you receive may be different. I updated the databases for repositories by running sudo apt update -y and installed necessary packages to support the USB audio device and to use a graphical desktop such as XFCE4, for example:

 

sudo apt install -y smplayer alsa-base alsa-oss alsa-tools alsa-utils alsamixergui pulseaudio pavucontrol pavumeter

 

You can use smplayer or vlc or another as long as it is modern media player or audio player. Now make a backup copy of these two text files /etc/modules and /etc/modprobe.d/alsa-base.conf and save the backup copies in your home directory.

 

Without quotes, edit the text file /etc/modules and write “snd-usb-audio” at the end of the file. Also, edit the text file /etc/modprobe.d/alsa-base.conf and change a few things.

 

Put a hash # symbol in front of every “options snd-usb-audio index=-2” that you see in the file /etc/modprobe.d/alsa-base.conf . I found two of them. Add these two lines of text to the bottom of /etc/modprobe.d/alsa-base.conf without quotes.

"alias snd-card-0 snd-usb-audio"

"options snd-usb-audio index=0"

 

Make sure that your user is in the 'audio' group. Run the usermod command against a regular user (not root) that you want to use often. And reboot.

sudo usermod -a G audio {username here}

sudo reboot 

 

Login to the graphical desktop, open the volume control program by clicking on the panel Applications, Multimedia, PulseAudio Volume Control. Click the Configuration tab at the far right of the volume control program and change the profile to Analog Stereo. * Important – now connect a headset, earphone, or amplifier to the 3.5mm (⅛’’) 🎧 headphone receptacle on the USB audio dongle and play some sounds, music or youtube. You can use wav audio files in the directory /usr/share/sounds/alsa/ if you don't have an internet connection.

 

usb-dongle-audio-adapter-sound-card-3d_transp.jpg.4de59863f2844ce9823c9107a4b4debe.jpg

 

Screenshot_2024-10-28_12-37-54.png

Edited by Pita Bread
add text
  • Pita Bread changed the title to Enable audio output/input with USB sound card dongle on Amlogic Tv Boxes
Posted

The previous post was mostly for slightly older releases of Armbian which includes Ubuntu 23 or Debian 10 and lower releases installed on a Tv Box.

 

This short guide is for Ubuntu 24.04 and later releases installed on a Tv Box. This guide should also work for latest versions of Debian (but I didn't test it). Get a generic USB "sound card" audio adapter dongle from AliExpress, eBay, Amazon (etc). See the photo posted above (LINK). These gadgets are often between $2 and $5 USD but they all are usually similar, so I just got the lowest priced one at about $2.50 USD. Insert the USB "sound card" audio adapter dongle into your tv box.

 

Create a new regular user in Linux, and login with the new user (not root).
sudo adduser {user-name}

 

Be sure your user is in the group 'audio', and be sure you have logged in as the user (not root).
sudo usermod -a -G audio {username}

 

Now let's install and setup audio sound using Pipewire and WirePlumber (but not Pulse). First, install alsa base, and mixer software.
sudo apt install -y alsa-base alsa-tools alsa-utils alsamixergui qasmixer

 

Make a backup copy of these two text files /etc/modules and /etc/modprobe.d/alsa-base.conf and save the backup copies in your home directory.
cp -v /etc/modules $HOME/modules.backup
cp -v /etc/modprobe.d/alsa-base.conf $HOME/alsa-base.conf.backup

 

Edit the text file /etc/modules and write “snd-usb-audio” without quotes at the end of the file, and then save and close the file.
sudo nano /etc/modules

 

Edit the text file /etc/modprobe.d/alsa-base.conf and change and add some text
sudo nano /etc/modprobe.d/alsa-base.conf

 

Put a hash # symbol in front of every “options snd-usb-audio index=-2” that you see in the file /etc/modprobe.d/alsa-base.conf - I found two instances.

 

Add these two lines of text to the bottom of the file /etc/modprobe.d/alsa-base.conf, and then save and close the file.
  alias snd-card-0 snd-usb-audio
  options snd-usb-audio index=0

 

Install pipewire and wireplumber and support files
sudo apt install -y pipewire pipewire-pulse wireplumber pipewire-audio-client-libraries gstreamer1.0-pipewire

 

Optional to install a graphical media player smplayer, vlc, totem, (etc). and optional install a graphical audio player rhythmbox, audacious, (etc).
sudo apt install -y smplayer
sudo apt install -y audacious

 

In case that the pulse audio system is still installed, we will disable it for the local user.
systemctl --user --now disable pulseaudio.service pulseaudio.socket

 

Enable pipewire for the local user
systemctl --user --now enable pipewire pipewire-pulse

 

To be sure everything will work, let's reboot
sudo reboot

 

Login as the regular user, and run some informative commands to prove that the USB dongle and the pipewire audio system are working.
Use alsa player to list audio devices.
aplay -l

 

Use alsa player to list PCM audio outputs (use capital "L").
aplay -L

 

Use wireplumber control to show status of audio outputs/inputs via pipewire.
wpctl status

 

Use wireplumber control to show a volume level of default output
wpctl get-volume @DEFAULT_AUDIO_SINK@

 

Change the volume using alsa mixer, after running it, press up/down arrow keys, and press "q", "e", "z", "c" and "s" keys.
alsamixer

 

Change the volume +/- by ten percent using wireplumber control.
wpctl set-volume @DEFAULT_AUDIO_SINK@ 10%+
wpctl set-volume @DEFAULT_AUDIO_SINK@ 10%-

 

* Important * connect a headphone, or amplifier to the 3.5mm output jack 🎧 of the USB adapter dongle and play some audio files.
aplay /usr/share/sounds/alsa/Front_Center.wav
aplay /usr/share/sounds/alsa/Noise.wav

 

You can also login to the graphical desktop such as lxde or xfce4 and open a video/media player or an audio player software and play some audio files. I used Audacious for this example. Again, audio files are available in the directory /usr/share/sounds/alsa/

 

From here, you can use the wpctl command (LINK) or another control program for wireplumber. Maybe some of the Pulse audio tools would still work. Audacious works fine when playing locally stored audio files. The same should be true for using SMPlayer or VLC to play video files. Note that depending on the speed of  your tv box, Youtube in Chrome / Chromium is sometimes laggy, has delays and resets. Other than that, it's all good.

Enjoy ♪ ♫ ☺

 

pipewire-qasmixer-Youtube-lxde-graphical-usb-sound-IMG_20250630_152449.thumb.jpg.93b171a5fa2a1f6f6885ae63e2782012.jpg

 

pipewire-qasmixer-audacious-lxde-graphical-usb-sound-IMG_20250630_152448.thumb.jpg.f3ce9307cb379c55bbeb317b64fc394a.jpg

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines