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
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.
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
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
/*
* Copyright 2016 <Admobilize>
* MATRIX Labs [http://creator.matrix.one]
* This file is part of MATRIX Creator HAL
*
* MATRIX Creator HAL is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <gflags/gflags.h>
#include <fstream>
#include <iostream>
This file has been truncated. show original
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
@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?
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
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 .
Regards,
Kevin Patino
milode
June 5, 2018, 6:16pm
#9
is it already possible to use headphone jack as a Linux device?
milode
June 28, 2018, 3:49pm
#10
You were already close to solution? please can you tell me how can I use it?
milode
November 19, 2018, 6:11pm
#11
Hi @kevindpatino ,
now its mid of November, does Matrix voice headphone jack work already???