Matrix Voice headphone jack?


#1

Hi guys,
I’ve got my demo app up and running on the pi3 + matrix voice! thanks so much for the help! right now i’m using the pi3’s mic out port, but I’d like to use the mic out port on the matrix voice. I’m wondering now how I can do that? I don’t see an example for it in the hal repo here:

and I don’t see the actual output device when I do aplay -L or aplay -l.

pi@ApolloVoicePi:~/apollo $ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
sc
mic_channel0
mic_channel1
mic_channel2
mic_channel3
mic_channel4
mic_channel5
mic_channel6
mic_channel7
mic_channel8
default
sysdefault:CARD=ALSA
    bcm2835 ALSA, bcm2835 ALSA
    Default Audio Device
dmix:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Direct sample mixing device
dmix:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Direct sample mixing device
dsnoop:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Direct sample snooping device
dsnoop:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Direct sample snooping device
hw:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Direct hardware device without any conversions
hw:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Direct hardware device without any conversions
plughw:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Hardware device with all software conversions
plughw:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Hardware device with all software conversions
sysdefault:CARD=Dummy
    Dummy, Dummy PCM
    Default Audio Device
dmix:CARD=Dummy,DEV=0
    Dummy, Dummy PCM
    Direct sample mixing device
dsnoop:CARD=Dummy,DEV=0
    Dummy, Dummy PCM
    Direct sample snooping device
hw:CARD=Dummy,DEV=0
    Dummy, Dummy PCM
    Direct hardware device without any conversions
plughw:CARD=Dummy,DEV=0
    Dummy, Dummy PCM
    Hardware device with all software conversions
pi@ApolloVoicePi:~/apollo $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Dummy [Dummy], device 0: Dummy PCM [Dummy PCM]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7

How do I set output to the jack on the matrix voice board?

thanks in advance!

-Thomas


#2

Anyone have any info on this? I see that there’s a spec sheet for the headphone driver, but I don’t know how to access it.


#3

Hello @unicornmafia

We are preparing an Audio Output release, It will be posted on Monday(12th Febrary). We will share the HAL library.

Thank You!

Kevin Patino


#4

Hello @unicornmafia,

We add an audio output example in our latest release of matrix-creator-hal : https://github.com/matrix-io/matrix-creator-hal/releases/tag/v0.2.1

If you want to run this example you need to convert the file audio to 16 Bit unsigned raw file, I recommend you to use sox and run:

sox file.wav -r 44100 -c 2 -e unsigned  -b 16  file.raw

Then run the example as:

./demos/audio_output --raw_file=/PATH/file.raw --output=H --volumen=50 --sampling_frequency=44100

So it will play this file and set up the output in the headphone with the 50% of the volume.

Let me know how it works.

Regards,

Kevin Patino


Matrix Voice: Beamforming, AEC, dereverberation and noise cancellation
Playing audio out of speaker connector on Matrix Voice
#5

@kevindpatino I can confirm that this works. It has a little hum, but other than that it’s pretty good.

However, what I really need is to be able to write to this as a real linux device. I use mpg123 to play mp3 files in my app, and I need to be able to play them out to these speakers. Doing it by hand like this is just too cumbersome, as I would need to do the decoding myself.

Is this possible?


#6

ok. I think I’ve got a solution for this: I changed a couple tiny things in your demo app and wrote a script to play an mp3 out of the speaker port. here are my files:
https://drive.google.com/open?id=1od5kHKmjJe5yzZkhKkfS1qkloHD5Mo8u

https://drive.google.com/open?id=1i8ks4tFs8jMRU-LwrF55tDuaY6SJmzST


#8

Hello @unicornmafia,

Yes, with the kernel layer abstraction you could use MATRIX Voice as a linux device. We are working hard on it! We are close :slight_smile:.

Regards,

Kevin Patino


#9

is it already possible to use headphone jack as a Linux device?


#10

You were already close to solution? please can you tell me how can I use it?


#11

Hi @kevindpatino,
now its mid of November, does Matrix voice headphone jack work already???


#12