element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products & Partners
    Products & Partners
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products & Partners
  • More
Arduino
Blog Playing a .WAV file using the Media Carrier Board on the Uno Q
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: ralphjy
  • Date Created: 17 Nov 2026 4:51 PM Date Created
  • Views 40 views
  • Likes 3 likes
  • Comments 0 comments
  • arduino uno q
  • arduino media carrier
  • WAV audio
Related
Recommended

Playing a .WAV file using the Media Carrier Board on the Uno Q

ralphjy
ralphjy
17 Nov 2026

I'm still working on a Face Recognition App using the IMX219 with the Media Carrier Board, but since that has a lot of moving parts - it's going to take me a bit longer.  I thought I would take a break and try using the audio interfaces on the Media Carrier.  I thought that was going to be reasonably straightforward, but as always - the Devil is in the details...

Arduino implemented 3 different audio interfaces on the Media Carrier.  The Line Out and Earphones Out use TRS jacks and the Mic/Headphones uses a TRRS jack.

  

Jack on Media Carrier

Signal Type

Intended Hardware

Line Out

Differential (Balanced) Mono (TRS)

Differential Class-D amp boards, PA mixers, balanced studio monitors.

Earphones Out

Differential Class-AB Earpiece (TRS)

Raw 10.67–32 Ω mini speakers, telephone handsets, or intercom earpieces (no external amp needed).

Mic / Headphones

Unbalanced Stereo + Mic (TRRS)

Standard consumer headphones, powered desktop stereo speakers (TRS), and TRRS headsets.

 

My initial thought was that I would just plug a battery powered speaker that I have into the Line Out TRS jack until I realized that it was a differential (balanced) mono output instead of the typical unbalanced stereo output.  I don't have anything with a differential interface, but I guess I could build an adapter with an isolation transformer..  I thought of using the Earpiece output, but I only have small 8 ohm speakers around and also don't have a TRS pigtail, so I would have to sacrifice one of my TRS cables.  I could fix the impedance problem with a small resistor, but decided that I would buy a pigtail with a TRS plug and try that later.  Not sure why Arduino chose to make things so difficult.  If I didn't want to use an external microphone, I could just plug the TRS plug of the powered speaker into the Mic/Headphones TRRS jack since that would just ground the microphone input.  But, of course, I want to use an external microphone and had already bought a splitter to convert the TRRS jack into two TRS jacks for the speaker and microphone.  

I did try out using headphones with the TRRS jack and that almost worked as expected.  I have Apple earphones with an inline microphone and I gave that a try.  The earphones worked fine, but when I tried to record with the inline mic - that just ended up recording an awful squeal - probably from a feedback problem.  I fiddled with gain settings, but couldn't get it to work.   This particular headset works fine with an old iPad and an iPhone 6, but I've never tried it with other devices.  I tried using a cheap electret mike that I got from Amazon with the TRS input on the splitter, but that had very low volume and lots of noise.  I suspect that the 1.8V bias voltage provided by the Uno Q is too low for this particular microphone (wasn't specified on Amazon).

I did find that a Klipsch headset with an inline mic that does work, so I have been able to test recording using the TRRS interface.  Not sure what the issue is with the Apple headset.  I am still having a problem increasing the record volume without picking up a lot of noise.

So, that gets me to my current configuration - the powered speaker on the TRS splitter (green) plugged into the TRRS jack.  That is shown below.  I'll still have to see if I can find electret mic that will work on the mic side (pink) of the splitter.

image

 

The documentation for the Media Carrier Audio interface is here: https://docs.arduino.cc/tutorials/uno-media-carrier/user-manual/#audio.

Audio playback and capture are handled by the ALSA (Advanced Linux Sound Architecture) framework available in the UNO Q's Debian OS.

I did all the interface testing using an SSH terminal and using the audio examples in the documentation.

E.G. to play a WAV file through the speaker on the TRRS jack:

Configure the interface:

amixer -c0 cset iface=MIXER,name='RX_CODEC_DMA_RX_0 Audio Mixer MultiMedia1' 1
amixer -c0 cset iface=MIXER,name='RX_MACRO RX0 MUX' 'AIF1_PB'
amixer -c0 cset iface=MIXER,name='RX_MACRO RX1 MUX' 'AIF1_PB'
amixer -c0 cset iface=MIXER,name='RX INT0_1 MIX1 INP0' 'RX0'
amixer -c0 cset iface=MIXER,name='RX INT1_1 MIX1 INP0' 'RX1'
amixer -c0 cset iface=MIXER,name='RX INT0 DEM MUX' 'CLSH_DSM_OUT'
amixer -c0 cset iface=MIXER,name='RX INT1 DEM MUX' 'CLSH_DSM_OUT'
amixer -c0 cset iface=MIXER,name='RX_COMP1 Switch' 1
amixer -c0 cset iface=MIXER,name='RX_COMP2 Switch' 1
amixer -c0 cset iface=MIXER,name='HPHL_RDAC Switch' 1
amixer -c0 cset iface=MIXER,name='HPHR_RDAC Switch' 1
amixer -c0 cset iface=MIXER,name='HPHL_COMP Switch' 1
amixer -c0 cset iface=MIXER,name='HPHR_COMP Switch' 1
amixer -c0 cset iface=MIXER,name='HPHR Switch' 1
amixer -c0 cset iface=MIXER,name='HPHL Switch' 1
amixer -c0 cset iface=MIXER,name='RX_RX0 Digital Volume' 80
amixer -c0 cset iface=MIXER,name='RX_RX1 Digital Volume' 80

Then play the file:

aplay -D plughw:0,0 /usr/share/sounds/alsa/Front_Center.wav

And that worked, but I had to adjust the RX_RX volumes down to 40 because it was too loud.

 

Next step is to try the interface using AppLab.

I decided that I would just use the Sound Generator "Play a Wav file" example.

image

Very simple program that looked easy to use.

image

And it ran successfully, but had an issue with low volume even the master_volume is set to 100%.

image

ALSA has lots of volume settings and the AppLab apps run with the host settings unless you explicitly change them.  So, the settings that I used with the command line testing didn't work with Sound Generator.  It turns out there are some bugs with the Sound Generator play_wave code.

When I tried to play a different WAV file other than the sample provided, I encountered failures due to format issues.

======== App failed to start ========================
Unexpected error in main.py, line 13:
  ValueError: Error converting WAV to audio: WAV channels (2) do not match speaker channels (1)
Trace:
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/arduino/app_peripherals/speaker/base_speaker.py", line 291, in _wav_to_pcm
    raise ValueError(f"WAV channels ({wav_channels}) do not match speaker channels ({self.channels})")
ValueError: WAV channels (2) do not match speaker channels (1)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/app/python/main.py", line 13, in <module>
    player.play_wav("assets/techmusic.wav", block=True)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/arduino/app_bricks/sound_generator/__init__.py", line 920, in play_wav
    self._output_device.play_wav(wav_audio)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/arduino/app_peripherals/speaker/base_speaker.py", line 253, in play_wav
    pcm_audio = self._wav_to_pcm(wav_audio)
  File "/usr/local/lib/python3.13/site-packages/arduino/app_peripherals/speaker/base_speaker.py", line 380, in _wav_to_pcm
    raise ValueError(f"Error converting WAV to audio: {e}")
ValueError: Error converting WAV to audio: WAV channels (2) do not match speaker channels (1)
=====================================================
2026-11-15 19:53:27.252 INFO - [MainThread] Peripherals:  Releasing 1 peripheral(s)
2026-11-15 19:53:27.254 INFO - [stop-ALSASpeaker] ALSASpeaker:  Stopping speaker...
2026-11-15 19:53:27.314 INFO - [stop-ALSASpeaker] ALSASpeaker:  Successfully stopped Built-in Audio Headphones playback
exited with code 1

It turns out there are bugs in the Sound Generator play_wav code that only make it work with mono 32-bit 48kHz formatted files and the file I tried was a stereo 16-bit 44.1 kHz file.  ALSA at the command line uses the plughw PCM device plugin that automatically converts sample rates, formats, and channel counts to match your sound hardware's native capabilities.  The bug in play_wav prevents this plugin from being used and defaults to a single format.  It appears that the volume problem is also a bug.

With some AI help I created an app the doesn't use Sound Generator, but uses the Speaker module instead.

image

This app works great and handles multiple formats using plughw.  A quick demo below (not sure how to play an audio fie in this editor, so this is a video).

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

Have to make myself an Audio brick that allows me to configure ALSA settings.

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube