Showing posts with label Audio. Show all posts
Showing posts with label Audio. Show all posts

[AKM Chip Booster] Audio ADC AK5704 PCB Design

Designing a PCB prototype with AK5704 is not so difficult and I show an example with my design.
People who are not familiar with AK5704, please read my previous post.

I listed some useful information here just in case you want to skip my previous post 🙂 


Let me share the picture of the board that I designed.




For this design, I wanted to have both analog and digital input path, so I added 3.5mm audio jacks (J1-J4) and small connectors (J6-J9).
Power supply is 3V or 5V so that I can use Raspberry Pi or Arduino.

Here is the quick features with this board.
  • Connectors
    • Analog input connector: 3.5 mm audio jack x 4
    • Digital input: 5 pin 1.0 mm pitch connector x 4
    • Host interface: 16 pin 2.54 mm pitch header x 1
  • Power supply: 3V or 5V
  • ADC input: Single-ended or differential input
  • Audio interface: I2S (TDM, PCM)
  • Control interface: I2C
    • I2C address is selectable by resister

It is currently debugging and not 100% sure everything works.
If you are interested in the schematic, please contact me and I might consider sharing the schematic if I feel comfortable 🙂


Notes:
As of 4/11/2020, analog input is working and I was able to stream the audio using Raspberry Pi ❕❕❕

[AKM Chip Booster] AK5704 Low-Power 4-ch 32-bit ADC with MIC-Amp


AK5704 is an audio ADC with microphone amplifier. It has 4 channel and 32 bit resolution.
You can get the information including the datasheet from AKM website.

I listed some useful information here.

According to this article, they built a smart speaker demo using AK5704 and the demo was displayed during the CES 2018. 
News release date in the above link is stated as 2019/06/11, so I guess it officially became available nearly 1.5 years after the CES demo in 2018.

Application using AK5704 includes:
  • Conference system
  • Microphone array system
  • Smart speaker
  • Baby or pet monitor
  • IC recorder

Parts are available from Digikey although the evaluation board is not available.
The chip price is $2.36/pcs (as of 4/11/2020), so it is quite reasonable for the people who want to prototype.


Notes:
QFN package with 28 pins so it is possible to hand solder the chip for the people who want to save the money 🙂
However, the exposed pad is a concern as it should be connected to the ground.
Maybe you can solder the pad easily by PCB design considering more grounding traces to the exposed pad. I don't know....



Also check:

[Raspberry Pi] Bluetooth Audio Headphone

Bluetooth Audio Device with Raspberry PI


Raspberry pi with Bluetooth again.
Last time I connected my DualShock 4 controller to raspberry pi.
This time, my motivation was to use Bluetooth audio headset using Raspberry pi.
I am not sure if this will give me any new project ideas.
Many people have already managed streaming Bluetooth audio from the raspberry pi.
There are a lot of creative projects available.
I hope I can make something unique by learning the Bluetooth audio with raspberry pi.

Setup
I was thinking this would be super easy and just need to work on the pulseaudio. 
This was a bad thought...
Because of this, I created unnecessary problems and took me about 3 hours to make it work.
I added "Note" at the very end of this post if you are interested in what happened.
Anyway, what I learned was that Bluetooth is a little bit tricky depending on the hardware and OS version.
I would highly recommend to double check the hardware and software versions before you start.
    This is the one of the great site to read through.

1. Check hardware version
Hardware version can be referred from cpuinfo file.
$ cat /proc/cpuinfo
When the information is displayed, you can scroll down and find the "Hardware" and "Revision" info.
In my case:
Hardware    : BCM2835
Revision      : a02082

For the relationship between the raspberry pi model and revision number, you can refer to this
I am referring to new style revision code and my hardware is model 3B.
a02082 3B 1.2 1GB Sony UK

If your model is 3B+ with latest raspbian image, I think you can simply follow this.

2. Check OS version
For OS version, you can check os-release file. 
$ cat /etc/os-release

My version is "Stretch". 


3. Testing
You can use desktop Bluetooth icons to pair and connect the device, but here I tried with bluetoothctl.
$ bluetoothctl
After running the bluetoothctl, you can turn on the agent and set it to the default.
agent on
default-agent
Now you are ready to scan the BT devices, and set the headset to pairing mode.
Then type the following command in the bluetoothctl terminal.
scan on

Once your headset is discovered, you will see something like this in the terminal.
[NEW] Device XX:XX:XX:XX:XX:XX  

"XX:XX:XX:XX:XX:XX" is your controller MAC address and type the following command with the MAC address.
Connect XX:XX:XX:XX:XX:XX

Once you see the message "Connection successful", your headset is connected, and last thing you may want to do is remember the device so that it is automatically connected next time.
Trust XX:XX:XX:XX:XX:XX

Now you are ready, and you can close the bluetoothctl by typing "quit".
Before play any audio file, make sure the Bluetooth audio device is selected as playback device.
To do so, right click the volume icon and select the device you want to send the audio.
Try play the audio file, youtube, or any others, and you will hear the audio from your headset! 

You can disconnect the controller from upper right BT icon by selecting "Headset name" > "Disconnect".

Note:
As I mentioned previously, I made big mistake by installing pulseaudio.
Somehow, I was thinking pulseaudio is the must and installed it without checking anything.
Then, I paired my Bluetooth headset without any problem.
I can see my desktop BT icon as connected to the device I want.
Audio device is selected through volume control icon.
However, I could not hear anything...

I run the command "pacmd" to  "list-cards" and what I noticed was there is no BT device indexed...
Just alsa device... hmm...

Then I killed pulseaudio process and restarted, run the "systemctl" command to check the status.
$ sudo systemctrl status bluetooth*

The error message I got was something like below. 
            bluetoothd "unable to get connect data for headset"
From this point, I spend lots of time to solve issue by looking at system, config, and other files.
Until, until I actually found that just simply remove the pulseaudio.
It is always better to read RaspberryPi.org documentation...
It says:
In Jessie, we used PulseAudio to provide support for audio over Bluetooth, but integrating this with the ALSA architecture used for other audio sources was clumsy. For Stretch, we are using the bluez-alsa package to make Bluetooth audio work with ALSA itself. PulseAudio is therefore no longer installed by default, and the volume plugin on the taskbar will no longer start and stop PulseAudio. From a user point of view, everything should still work exactly as before – the only change is that if you still wish to use PulseAudio for some other reason, you will need to install it yourself.

So for the people who see the similar errors, please try removing the pulseaudio ;)
$ sudo apt-get remove --purge pulseaudio

After removing pulseaudio, you can check the bluetooth status with "systemctl" and it should be working now.

Some people might still want to use pulseaudio.
If that is the case, this blog by Youness might help.

Good luck and thank you for reading!




[AKM Chip Booster] Audio ADC AK5704 PCB Design

Designing a PCB prototype with AK5704 is not so difficult and I show an example with my design. People who are not familiar with AK5704,...