Issue with audiorecorder, Audiowrite, audioread, play and recordblobking

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue with audiorecorder, Audiowrite, audioread, play and recordblobking

Cleyderman Guerrero
*Hello Team,

I have an issue with my script. I want to record an audio, graph it, save
and play it. This is my script:*

clear all
close all
clc

s=5;
fs=500000;
r = audiorecorder(8000,16,1);
disp('please speak')
recordblocking (r,s);
play(r);
y = getaudiodata(r);
subplot(2,1,1);plot(y,'r');
[a,b]=size(y);
a=a-1;
t=[0:inv(fs):(a/fs)];
aux=input('push any key to continue');
clc

audiowrite('C:\Users\test\Matlab\soundTest1.wav',y,8000);
aux=input('push any key to continue');
[y2,fs]=audioread('C:\Users\test\Matlab\soundTest1.wav');
sound(y2,8000);

*The above worked fine in Matlab, but in Octave don't work. This is the
error when executing the script:*

pi@raspberrypi:~/Desktop/octave/script $ sudo octave Audio.m
octave: X11 DISPLAY environment variable not set
octave: disabling GUI features
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
'defaults.bluealsa.device'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned
error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file
or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
'defaults.bluealsa.device'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned
error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file
or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping
unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping
unlock
warning: Octave:invalid-default-audio-device
warning: called from
    audiorecorder at line 51 column 21
    Audio.m at line 7 column 3
please speak
error: audiorecorder: unable to open audio recording stream
error: called from
    recordblocking at line 32 column 3
    Audio.m at line 9 column 1

*could somebody help me with this? *

Best regards,

Cleyderman Guerrero



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: Issue with audiorecorder, Audiowrite, audioread, play and recordblobking

Mike Miller-4
On Thu, Aug 23, 2018 at 11:50:27 -0500, Cleyderman Guerrero wrote:
> pi@raspberrypi:~/Desktop/octave/script $ sudo octave Audio.m

Why are you running Octave with sudo? Does it work without?

> error: audiorecorder: unable to open audio recording stream
> error: called from
>     recordblocking at line 32 column 3
>     Audio.m at line 9 column 1

Does your system have an audio device? Is it configured to work with
other programs? Do you have examples of audio input and output working
with pulseaudio or alsa or jack?

--
mike



signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Issue with audiorecorder, Audiowrite, audioread, play and recordblobking

Cleyderman Guerrero
Hello Mike,

Yes, it does work without *sudo*.

What do you mean by pulseaudio or alsa? could you explain me better?. I have
tried with one jack connector(which is connected to my Raspberry PI 3 model
B), I have listened to music with it from youtube. Could you give me a
recommendation about what to do?

Best regards,

Cleyderman Guerrero






--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: Issue with audiorecorder, Audiowrite, audioread, play and recordblobking

Mike Miller-4
On Thu, Aug 23, 2018 at 16:01:20 -0500, Cleyderman Guerrero wrote:
> Yes, it does work without *sudo*.

Meaning that audio is working, problem solved?

> What do you mean by pulseaudio or alsa? could you explain me better?. I have
> tried with one jack connector(which is connected to my Raspberry PI 3 model
> B), I have listened to music with it from youtube. Could you give me a
> recommendation about what to do?

These are all audio interface libraries that Octave supports.

If another program works but Octave does not, then some more information
and investigation may be needed to see why that is.

--
mike



signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Issue with audiorecorder, Audiowrite, audioread, play and recordblobking

Cleyderman Guerrero
Dear Mike,

It still doesn't work. I can execute Octave without *sudo*, however, is not
working.

What is the meaning of this?:

*ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.p*

Do I need to install something else?

Best regards,

Cleyderman Guerrero



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: Issue with audiorecorder, Audiowrite, audioread, play and recordblobking

Mike Miller-4
On Mon, Aug 27, 2018 at 08:47:58 -0500, Cleyderman Guerrero wrote:

> What is the meaning of this?:
>
> *ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
> ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
> ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
> ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
> ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
> ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
> ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
> ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
> ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
> ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
> ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
> ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
> ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
> ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
> ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
> ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
> ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
> ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
> ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
> ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.p*
This is normal diagnostic information coming from the portaudio library.
I always see similar output on a system that functions correctly.

> Do I need to install something else?

If you have audio working in another program, then you shouldn't need to
install something else.

What you might need to do is determine how that other program is
accessing the sound hardware, is it with jack, pulseaudio, oss, alsa, or
portaudio? Did you need to select an audio device or did it detect the
correct one automatically? Can you record audio with another program or
only play audio output?

Cheers,

--
mike



signature.asc (849 bytes) Download Attachment