[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Linphone-developers] liblinphone: Ringtone from config and sound device
From: |
Radu Cristescu |
Subject: |
[Linphone-developers] liblinphone: Ringtone from config and sound device |
Date: |
Wed, 31 Oct 2007 17:43:24 +0200 |
User-agent: |
Icedove 1.5.0.12 (X11/20070607) |
Hi,
Somewhere between Linphone 1.3.5 and 1.5.1 there were two regressions
(that I found so far), one about the ringtone, and one about the sound
device to use for playback and ringing.
For the ringtone, I made a simple patch (see attachment - hopefully the
list accepts it). This bug is present in 1.5.1 and 1.7.1 equally. The
patch is against the latest 1.7.1 source from the Linphone website.
Something similar to this should be made for the ringback sound, which
currently can't be changed, even though there is a config option for it.
The other issue is about the sound device to use. In 1.3.5 there was a
"alsadev" config option. Since 1.5.1 that option is gone and as far as I
see it was replaced with something called mediastreamer, which is
configured using the playback_dev_id, ringer_dev_id and capture_dev_id
options. Now, compared to the "alsadev" option in 1.3.5, the
mediastreamer is extremely limited when it comes to selecting the sound
device. Here's what I want to do and can't: play the sound through
S/PDIF instead of Stereo. Since mediastreamer associates "ALSA: default
device" with plughw:0, and spdif is, well "spdif", I can't use linphone
through S/PDIF without modifying the code. Even more, I created my own
"asym_spdif" ALSA device like so:
/etc/asound:
----------------- CUT -----------------
pcm_slave.convert48k {
pcm "spdif"
rate 48000
}
pcm.spdif_playback {
type plug
slave convert48k
}
pcm.asym_spdif {
type asym
playback.pcm "spdif_playback"
capture.pcm "plughw:0"
}
----------------- CUT -----------------
and with 1.3.5 I used the alsadev option like this:
"alsadev=asym_spdif". Since the alsadev option is gone and mediastreamer
is not smart enough for my needs, I can't do this.
Now I'm not too much of a fan of complaining and more of a fan of
writing code to fix the behavior and make the application do what I
need, but I need some advice before I start implementing anything and
submitting a patch for it. How would you do it?
Options:
1. Modify mediastreamer (there is a lot of modifying to do if taking
this approach)
2. Add the alsadev option back and make it override the values for
playback_dev_id, ringer_dev_id and capture_dev_id.
3. Add extended alternatives to the playback_dev_id, ringer_dev_id and
capture_dev_id options, possibly called alsa_playback_dev,
alsa_ringer_dev and alsa_capture_dev, for people that can't write
asound.conf files like I did.
4. Implement both options 2 and 3, all options operating on the same
values, but alsadev would set playback, ringer and capture devices
together, while the others set these values independently, and the user
would use whatever suits his needs best.
What do you think?
Obviously, I'm not taking into account anything about the GTK
application. I'm only interested in liblinphone as a backend. :)
Radu
diff -r 67119a19b5e2 -r 8c3763454dd5 coreapi/linphonecore.c
--- a/coreapi/linphonecore.c Wed Oct 31 15:40:24 2007 +0200
+++ b/coreapi/linphonecore.c Wed Oct 31 16:29:14 2007 +0200
@@ -287,7 +287,7 @@ void sound_config_read(LinphoneCore *lc)
tmpbuf=PACKAGE_SOUND_DIR "/" LOCAL_RING;
tmpbuf=lp_config_get_string(lc->config,"sound","local_ring",tmpbuf);
- if (access(tmpbuf,F_OK)==0) {
+ if (access(tmpbuf,F_OK)!=0) {
tmpbuf=PACKAGE_SOUND_DIR "/" LOCAL_RING;
}
if (strstr(tmpbuf,".wav")==NULL){
@@ -299,7 +299,7 @@ void sound_config_read(LinphoneCore *lc)
tmpbuf=PACKAGE_SOUND_DIR "/" REMOTE_RING_FR;
tmpbuf=lp_config_get_string(lc->config,"sound","remote_ring",tmpbuf);
- if (access(tmpbuf,F_OK)==0){
+ if (access(tmpbuf,F_OK)!=0){
tmpbuf=PACKAGE_SOUND_DIR "/" REMOTE_RING_FR;
}
if (strstr(tmpbuf,".wav")==NULL){
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Linphone-developers] liblinphone: Ringtone from config and sound device,
Radu Cristescu <=