DreamPi Software (DC <> Pi)

Discussion in 'Sega Dreamcast Development and Research' started by kazade, Sep 2, 2015.

  1. Jon

    Jon No longer active

    Joined:
    Nov 5, 2015
    Messages:
    50
    Likes Received:
    24
    OK, so with the Dreamcast, turning the dial-tone off doesn't make much of a difference. I still suspect some kind of timing issue, and that the PowerBook is just more tolerant.

    I tried the default-asyncmap addition and tried to connect with various games, attached a few logs:

    Starlancer: Took 3 tries. When it did finally connect, it did the rage-quit thing and dropped the connection immediately. Could be a DNS issue, but nothing apparent in the logs.
    Maximum Pool: Same as Starlancer -- eventual connect, then rage-quit after a few packets.
    Quake 3: Good connection after 3 tries, but it couldn't find any servers with the DNS provided by the Pi. Over-riding Pi's DNS and using 8.8.8.8 didn't help, using the DC-Talk DNS (currently 173.69.38.20) didn't help either. I had to remove the default-asyncmap line to get Quake working again (its the only one that I've ever had much luck with!)
    4x4 Evo: Blind dials, still took 8 tries, and rage quit as soon as it was connected. Syslog shows similar behavior to Starlancer...a couple send actions, then it hangs up. Again, could be that DNS doesn't work, it doesn't find anyone to talk to, so it hangs up. Hard to tell.

    I've sent $15 via Patreon, and I think you should let me send you one of these modems, since they both exhibit the same behavior. Happy to send to a neutral address or PO box, there must be PM feature in here...
    None of them have any model information on them, although one has Dell branding on it. When plugged into Windows, Device Manager identifies that one as "Conexant USB CX93010 ACF" and the other partially working one just as "USB Data Fax Voice Modem" with a driver supplied by "Conexant Systems, Inc." The one that doesn't work at all is called a "USB Soft Data Fax Modem with SmartCP" by Windows, with a driver supplied by "Conexant." It physically looks identical to my first modem.
     

    Attached Files:

    Last edited: Nov 25, 2015
  2. kazade

    kazade Spirited Member

    Joined:
    Jul 22, 2015
    Messages:
    155
    Likes Received:
    164
    Wait! There is one difference between you and I that we haven't accounted for! Maybe we're looking at the wrong modem!

    Are you using a 56k Dreamcast modem? I'm using a PAL 33.6k one! This might explain everything!

    When the dreampi software detects the speed of the modem, what does it say? I'm betting it says 230400.

    Try changing this line to 230400: https://github.com/Kazade/dreampi/blob/master/dreampi.py#L31

    Alternatively, perhaps we are going too fast and rather than detecting the modem speed it should just stick to 115200 throughout.

    P.S. Thanks again for the donation, I've just purchased Starlancer. Looks like my next funding goal might be for a U.S. 56k modem :)
     
    Last edited: Nov 25, 2015
  3. Jon

    Jon No longer active

    Joined:
    Nov 5, 2015
    Messages:
    50
    Likes Received:
    24
    Yes, I'm on a 56k US modem on both my Dreamcasts.
    I tried changing line 31 to 230400, and it did seem to improve reliability a little bit.

    However, the connection info says "9600", "230400" or sometimes "460800" regardless of what's specified at line 31. Successful connections usually say "9600" or "230400" as well, but I remember seeing them in excess of "300000" as well (380400 IIRC).

    It does seem like this is some kind of race condition, so modem speed is likely a factor. Sorry I didn't think of it earlier!

    Update: I modified the function detect_device_and_speed()to always return 230400, it initially seemed to make a difference, but after rebooting the PI, it proved only temporary. However, when I did get connected with 4x4, it didn't rage quit on me and I even got to a lobby for the first time ever.
     
    Last edited: Nov 25, 2015
  4. kazade

    kazade Spirited Member

    Joined:
    Jul 22, 2015
    Messages:
    155
    Likes Received:
    164
    @Jon I just made some changes locally and DRASTICALLY improved the connection speed! Hopefully this might improve your connection too, I'll try and get a new release out later!

    Update:

    So what I've done is this:

    - Fixed the communication speed between the Pi and the USB modem at 115200. This seems like a safe baud rate to use. wvdial tries 9600 and 115200 but nothing faster so perhaps this was the issue. Setting that speed to the speed that the modem can communicate across a phone line was probably very wrong indeed!
    - Set the 115200 in the peers configuration to the actual speed of the modem. If I understand this correctly it means that PPP has more room to negotiate a speed with the Dreamcast and provides better performance. I can now connect to PSO so quickly that the loading "diamonds" barely flash on screen!
    - Hard coded the Starlancer DNS lookups into the dnsmasq configuration
     
    Last edited: Nov 26, 2015
    Anthony817, Jon and Helder like this.
  5. kazade

    kazade Spirited Member

    Joined:
    Jul 22, 2015
    Messages:
    155
    Likes Received:
    164
  6. Jon

    Jon No longer active

    Joined:
    Nov 5, 2015
    Messages:
    50
    Likes Received:
    24
    Sounds like good fine tuning, unfortunately, it had no impact for me. Connections are still roughly 1/3, most games still hang up immediately after connecting (4x4 Evo, Maximum Pool, Starlancer)

    Next payday I'll try to sponsor a little more dough for you to get a US modem, clearly there's something different going on with that hardware.

    Update: now that we know this is a real issue, and not just an "IO" (Idiot Operator) error, or an environmental/defective hardware problem, I've created it as an Issue in your GitHub project. I'm not sure what more help I can be, but I'll be happy to help QA if you think you've found a fix. Even with the 1/3 success rate, and only Quake working, I can still participate in Fraggin Fridays AND I got an excuse to buy a Raspberry PI! Thanks for all your hard work!
     
    Last edited: Nov 26, 2015
  7. kazade

    kazade Spirited Member

    Joined:
    Jul 22, 2015
    Messages:
    155
    Likes Received:
    164
    I'm determined to fix this! I have someone else with a U.S. modem but a line simulator instead of a line voltage inducer. He seems to be able to connect OK, but his DNS is messed up (I think this might be because .100 is in use elsewhere on his network). I'm coding a potential fix to this, but if his works fine then the culprit might actually be the amount of voltage being provided. It may just be that the voltage is just a tiny a bit low (I'm using 18v). I'll keep testing, I might fiddle around with the AT commands a little bit and see if that makes any difference.

    Thanks so much for all your help!
     
  8. Jon

    Jon No longer active

    Joined:
    Nov 5, 2015
    Messages:
    50
    Likes Received:
    24
    I've been tinkering with the AT commands too, nothing seems to make a difference, but I don't really know what I'm doing...
    How do you get 18v into the line? Just two 9v batteries solder on in series? Or is there some trick to it!
     
  9. kazade

    kazade Spirited Member

    Joined:
    Jul 22, 2015
    Messages:
    155
    Likes Received:
    164
    yeah exactly that :)
     
    sa1 likes this.
  10. kazade

    kazade Spirited Member

    Joined:
    Jul 22, 2015
    Messages:
    155
    Likes Received:
    164
    @Jon Good (?) news! I've managed to recreate your problem with Starlancer! So PSO works perfectly, as does DreamKey - but Starlancer suffers the problem you reported.. the thing just won't answer!

    I'm working on it! :)
     
    Jon likes this.
  11. Jon

    Jon No longer active

    Joined:
    Nov 5, 2015
    Messages:
    50
    Likes Received:
    24
    Alright, my son and I re-built my Line Voltage Inducer with two power supplies, and measured the output at 18v with our multi-meter. No impact on connection rate, no impact on reliability once connected. Line voltage doesn't seem to be the problem.

    I put a Phone Line Simulator on my Christmas Wish List on Amazon :) Otherwise, I think I'd have to fund raise for it myself -- that plus the Pi totals more than a BBA!

    All that said, I had a fun time with 3 other guys playing Quake 3 online last night!

    I'm not sure if that's the problem I have. I can get it to answer, it just immediately hangs up as soon as it does. You can see from the logs attached above, that it even sends a few quick packets, before hanging up.
     
    Last edited: Nov 28, 2015
  12. kazade

    kazade Spirited Member

    Joined:
    Jul 22, 2015
    Messages:
    155
    Likes Received:
    164
    New release, 0.96!

    @Jon there's definitely something different between PSO and Starlancer. Starlancer PPP configuration fails EVERY TIME for me, yet PSO and Dreamkey work perfectly...
     
  13. Jon

    Jon No longer active

    Joined:
    Nov 5, 2015
    Messages:
    50
    Likes Received:
    24
    Much to my accountant/wife's chagrin, I've ordered a line simulator. On the theory that I'll return it if the line isn't the problem...seems to be the only way to know for sure. If it resolves my issues, I'll have to sell some gadgets to fund it post-facto (anyone want to buy an Android-hacked HP TouchPad?!)
    I'm going to leave it alone until the part arrives though. Getting a little tired of nothing working :-/
     
  14. kazade

    kazade Spirited Member

    Joined:
    Jul 22, 2015
    Messages:
    155
    Likes Received:
    164
    I'm feel bad for causing you to keep spending money :( Here's the deal so far... Pcwzrd13 has everything working fine, including Starlancer. He's using 56k and a line simulator. I can get PSO and Dreamkey working perfectly, but Starlancer fails to connect 100% of the time. You have random failures depending on the game... This is so hard to debug!
    I'll keep fiddling until I get Starlancer to connect, then hopefully that will solve the root cause of all the issues... Hopefully!
     
  15. Jon

    Jon No longer active

    Joined:
    Nov 5, 2015
    Messages:
    50
    Likes Received:
    24
    Oh at this point, we've entered into the realm of stubborn determination. Its not about playing Dreamcast games any more, its about making it work!

    I'm sure you've thought of this, but just in case: have you thought about building a PC-DC (Ubuntu) VM then comparing the PPP and other options to what you've got set in Raspian Linux to see what's different?

    http://www.dreamcast-scene.com/guides/pc-dc-server-guide-win7/
    http://dreamcast.onlineconsoles.com/phpBB2/viewtopic.php?p=79753
    http://dreamcast-talk.com/forum/viewtopic.php?t=2427
     
  16. kazade

    kazade Spirited Member

    Joined:
    Jul 22, 2015
    Messages:
    155
    Likes Received:
    164
    Yeah don't worry, I use Linux 100% of the time (haven't used Windows since ~2004) so I've been experimenting. The real issue is the dial tone generation - this is still fundamentally the problem. The modem gets left in a weird state after the tone generation and although my random AT commands seem to work with PSO, there's still something that causes certain modems, and apparently Starlancer to go a bit funny...

    I've started tearing apart the code, and cleaning it up. In particular I'm going to try to send the minimum number of AT commands I can, and rather than waiting for the Dreamcast to finish dialling before answering, I'm instead waiting for the first digit, then effectively hanging up immediately so that we can answer with a fresh modem a few seconds later. I'm not putting out any more releases until Starlancer *and* PSO work for me, and at that point I think it should magically fix everything :)

    If the line simulator works for you, then I'm totally wrong and there's still something wrong with the line voltage, but FWIW this is the USB modem that pcwzrd has used without any issues: http://www.amazon.com/Dell-NW147-Ex...8&qid=1448804735&sr=8-1&keywords=dell+56k+usb
     
  17. kazade

    kazade Spirited Member

    Joined:
    Jul 22, 2015
    Messages:
    155
    Likes Received:
    164
    Holy crap! I got it to work!! Just need to test with PSO etc!
     
    Anthony817 and Bad_Ad84 like this.
  18. kazade

    kazade Spirited Member

    Joined:
    Jul 22, 2015
    Messages:
    155
    Likes Received:
    164
    0.97 Released! @Jon Could you try this version? It's a complete rewrite :)
     
    Last edited: Nov 29, 2015
  19. treyldog

    treyldog Active Member

    Joined:
    Jul 22, 2015
    Messages:
    28
    Likes Received:
    8
    Alright, do i need to order a line simulator now? or just go for a voltage inducer?
     
  20. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Has sending mail from the browser been looked into or are there plans to look into that?
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page