Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix problem of "one-way-audio" #20

Open
lelandg opened this issue Feb 22, 2016 · 9 comments
Open

Fix problem of "one-way-audio" #20

lelandg opened this issue Feb 22, 2016 · 9 comments
Assignees
Labels

Comments

@lelandg
Copy link
Owner

lelandg commented Feb 22, 2016

Right now, you can transmit your voice to the camera system (if you have a speaker on it) but you cannot receive audio.

@lelandg lelandg self-assigned this Feb 22, 2016
@lelandg lelandg added bug and removed enhancement labels Feb 22, 2016
@lelandg
Copy link
Owner Author

lelandg commented Feb 22, 2016

I'm not sure if this is a limitation of Linphone (it appears to be so) or the RPi (which I can't believe).

This might involve encoding the audio and video into one stream, or it may be better to use a separate audio stream.

It looks like the real issue is that Linphone will not let you actually assign a microphone channel. (But perhaps I don't yet know how to access that/specify the correct device.)

@lelandg
Copy link
Owner Author

lelandg commented Mar 19, 2016

I got a reply from Alex on the Linphone-developers mailing list. He gave me more information to track down and use the correct audio device (for other microphone). For posterity, and for everyone else to findi in searches and be able to see, here's what he said:

Regarding your question: To get audio input from a mic you will need a soundcard with such capacity. I used a cheap USB sound card. Some devices tested on the PI can be find here:
http://elinux.org/RPi_VerifiedPeripherals#USB_Sound_Cards

First, check that with your device that you are able to record sounds (e.g. arecord). You can easily find posts about this. Once you have the sound card configured, it should be easy to use in your python script.

In the script you are based on from https://wiki.linphone.org/wiki/index.php/Raspberrypi:start, I just had to change the snd_capture parameter with the id string related to my sound device (snd_capture=id_device) . You can find the id_device string in alsamixer, or just in the first lines of the log output when running the python script. In my case I had to set "snd_capture='ALSA: USB PnP Sound Device'". Hope this helps.

Best
Alex

@zahersyed
Copy link

Can Gstreamer be utilized for audio/video? It is open source and free to use. I have raspberry pi3 and I don't think linphone works with ARM7m or I could be wrong.

@toshibochan
Copy link

Zahersyed linphone work on raspberry pi 3

@lelandg
Copy link
Owner Author

lelandg commented May 20, 2016

@zahersyed Yes, Toshibochan is correct, Linphone works the same on RPi 2 or 3.

I don't know what it would take to make an alternate configuration that uses gstreamer. I might look into that when I get some other projects finished.

@And1DS
Copy link

And1DS commented Jun 5, 2016

Hi, thanks for the script, its great. however i cannot get sound to work.

I have a USB microphone attached and

arecord -l

shows it correctly

`**** List of CAPTURE Hardware Devices ****

card 1: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]

Subdevices: 1/1
Subdevice #0: subdevice #0`

i can also record audio using arecord. however it seems that linphone doesn't recognize it properly. I checked the logs and found the following:

WARNING: no card with id ALSA: USB PnP Sound Device

somehow it doesn't seem to find the card.
I cannot hear anything both ways / neither from the raspi to the iPhone, nor from the iPhone to the raspi. all i can hear is some noise when i talk to the raspi microphone - but you cannot understand anything.

would be great if you could point me to the right direction.

my ./asoundrc looks like this:

`pcm.!default {
type asym
playback.pcm "hw:0,0"
capture.pcm "hw:1,0"
}

please help, thanks!

@lelandg
Copy link
Owner Author

lelandg commented Jun 5, 2016

@AjejeBraso , I'm sorry, it seems that you have hit a bug. At this point I do not know if the bug is in my script or if it's Linphone.

I appreciate your detailed info! This should help me in resolving the problem. However, I cannot say for certain when that will be. (I have problems with my hands, so cannot type very much at times. Fortunately I can still draw, so during those times I can focus on my artwork. BTW, I do have dictation software, and it works great for stuff like writing this comment, it just does not cut it for doing programming/debugging.)

I will try to get to this sooner than later – I just cannot give an estimated time. I hope you understand.

Regardless of how long it takes me, I will get this figured out! ✌😎👍☮

If anyone knows any Python/Linphone Gurus, please feel free to invite them over. 🙂

The only other suggestion I have or a short-term fix is to see the getting started on the Linphone page (which links back to this project, but has a script below that). That page is here: https://wiki.linphone.org/wiki/index.php/Raspberrypi:start

Perhaps someone could figure out why their example script works but mine does not? That is the real question. 👍

@And1DS
Copy link

And1DS commented Jun 5, 2016

@lelandg Thanks for the quick reply. Sorry to hear about your problems with the hands, hope you will get better soon! wish you all the best

i will post it in the linphone mailing list, i will post back if i get a solution.
I am currently working on a raspberry pi based letterbox with integrated doorbell, which will inform me if the postman came by or somebody pressed the bell (after 4 years without doorbell its finally time to get a 21st century voip enabled doorbell based on a raspberry pi 2 ;-)

cheers!

@lelandg
Copy link
Owner Author

lelandg commented Jun 5, 2016

@AjejeBraso That would be totally grand of you, if you can figure this out – I will give you credit in the main documentation! :-)

I have likewise been without a doorbell for a long time. However, in my case it is going on 11 years. We just do not answer the door unless someone we know is coming over – or unless you get very lucky. :-) (In most of the house we would not hear the front door if someone is just knocking.)

Like you, I decided it's time to move into the 21st century and do something like this.

Anyway, I would sure appreciate any help you can come up with – that's true for anyone. 👍

Cheers to you as well! 😎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants