[mythtv] MythPhone: no incoming sound & microphone bug (tiny patch attached for the latter)

Ari Koivisto ari.koivisto at gmail.com
Mon Mar 7 03:51:54 UTC 2005


I've been trying to get MythPhone up and running and run into few problems:

1. No sound is heard from the other end. 

I can create/receive calls OK and the other end can hear my voice, but
I cannot hear anything. The sound is received by MythPhone, but
something goes wrong when it is fed to the soundcard (integrated ATI
IXP with Alsa driver 1.0.8). I modified rtp.cpp to write the received
packets into a file in rtp::PlayOutAudio and if play the resulted file
with aplay I can hear the other party's speech fine.

Also I can see the "green bar" under the picture move along with the
speech, but no sound through the speaker. Adjusting volume does not
help. Other SIP phones e.g. kphone work work fine in the same
computer. Any ideas?


2. Using the same device for audio input/output does not work. There
is a small bug in rtp::StartTxRx():
---clip---
    // Open the audio devices
    if ((rxMode == RTP_RX_AUDIO_TO_SPEAKER) && (txMode ==
RTP_TX_AUDIO_FROM_MICROPHONE) && (spkDevice == micDevice))
        speakerFd = OpenAudioDevice(spkDevice, O_RDWR);
 else
    {
        if (rxMode == RTP_RX_AUDIO_TO_SPEAKER)
            speakerFd = OpenAudioDevice(spkDevice, O_WRONLY);

        if ((txMode == RTP_TX_AUDIO_FROM_MICROPHONE) && (micDevice != "None"))
            microphoneFd = OpenAudioDevice(micDevice, O_RDONLY);
    }
.
.
.
    if (microphoneFd != -1)
    {
        txSequenceNumber = 1;
        txTimeStamp     = 0;
        MicrophoneOn = true;
    }
    else
        txMode = RTP_TX_AUDIO_SILENCE;
---clip---

When the same device is used as microphone and speaker the
microphoneFd is always -1 and no sound will be recorded. Patch
attached.

Any help on the first problem would be greatly appreciated! MythPhone
is shaping to be a very nice voip client!

Cheers,
Ari
-------------- next part --------------
--- mythphone/rtp.cpp	2005-02-09 13:06:53.000000000 -0800
+++ mythphone_patched/rtp.cpp	2005-03-06 19:40:34.794504952 -0800
@@ -337,7 +337,10 @@
 
     // Open the audio devices
     if ((rxMode == RTP_RX_AUDIO_TO_SPEAKER) && (txMode == RTP_TX_AUDIO_FROM_MICROPHONE) && (spkDevice == micDevice))
-        speakerFd = OpenAudioDevice(spkDevice, O_RDWR);    
+    {
+        speakerFd = OpenAudioDevice(spkDevice, O_RDWR);
+        microphoneFd = speakerFd;
+    }
     else
     {
         if (rxMode == RTP_RX_AUDIO_TO_SPEAKER)


More information about the mythtv-dev mailing list