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

Sparc loud noise problem #201

Open
GoogleCodeExporter opened this issue Apr 11, 2015 · 4 comments
Open

Sparc loud noise problem #201

GoogleCodeExporter opened this issue Apr 11, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

Using default config with K3520 and E173u2 on debian x86 works fine, but on 
debian sparc (Linux mail 3.2.0-4-sparc64-smp #1 SMP Debian 3.2.65-1+deb7u1 
sparc64 GNU/Linux)  probably a big/little endian problem occurs.

Voice from GSM network to SIP is fine, but from SIP to GSM only loud noise. 
It is not bad codec problem - trying many codecs configs and direct connection 
from one dongle to another without SIP same effect - loud noise.





Original issue reported on code.google.com by [email protected] on 18 Jan 2015 at 11:48

@GoogleCodeExporter
Copy link
Author

This solved the problem:

diff -p5 chan_dongle-1.1.r14/channel.c chan_dongle-1.1.r14.patched/channel.c    

*** chan_dongle-1.1.r14/channel.c       2011-10-03 08:12:31.000000000 +0200     

--- chan_dongle-1.1.r14.patched/channel.c       2015-01-24 13:14:51.706589292 
+0100                                                           
*************** static int channel_write (struct ast_cha                        

*** 821,830 ****                                                                

--- 821,833 ----                                                                

                }                                                                                                                             


                if (pvt->a_timer)                                                                                                             
                {                                                                                                                             
+                   if(is_big_endian())                                         

+                       ast_frame_byteswap_le (f);                              

+                                                                               

                        count = mixb_free (&pvt->a_write_mixb, &cpvt->mixstream);                                                             

                        if (count < (size_t) f->datalen)                                                                                      
                        {                                                                                                                     
                                mixb_read_upd (&pvt->a_write_mixb, f->datalen - count);                                                       
*************** EXPORT_DEF const struct ast_channel_tech                        

*** 1382,1386 ****                                                              

--- 1385,1399 ----                                                              

        .devicestate            = channel_devicestate,                                                                                        
        .indicate               = channel_indicate,                                                                                           
        .func_channel_read      = channel_func_read,                                                                                          
        .func_channel_write     = channel_func_write                                                                                          
  };                                                                                                                                          
+                                                                               

+ int is_big_endian(void)                                                       

+ {                                                                             

+     union {                                                                   

+         uint32_t i;                                                           

+         char c[4];                                                            

+     } e = { 0x01000000 };                                                     

+     return e.c[0];                                                            

+ }                                                                             

+ 

Original comment by [email protected] on 24 Jan 2015 at 12:17

@GoogleCodeExporter
Copy link
Author

thanks for patch

Original comment by [email protected] on 14 Mar 2015 at 4:16

@bg111
Copy link
Owner

bg111 commented Sep 25, 2016

i think is_big_endian not required at all
ast_frame_byteswap_le already have check and this is_big_endian() is dynamic check.

Also this code executed only on timer, chan_dongle can work also w/o timer feature

bg111 added a commit that referenced this issue Sep 25, 2016
@bg111
Copy link
Owner

bg111 commented Sep 25, 2016

fixed in r45, please check

Dexus pushed a commit to Dexus-Forks/asterisk-chan-dongle that referenced this issue Dec 2, 2016
wdoekes added a commit to wdoekes/asterisk-chan-dongle that referenced this issue Sep 13, 2017
This reverts commit ab93953.

Apparently there was too much byteswapping (on big-endian machines)
going on with both ab93953 and 53e83a4. Reverting ab93953 appears to
work for @Infactum.

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

No branches or pull requests

2 participants