Robopanda Hacks and mods

281 posts / 0 new
Last post
milw
milw's picture

Thanks Sevik. I did read your README (really!) but didn't find any mention of encode.py in there.

sevik
sevik's picture

:))

encode.py is a moving target :))

but readme is really outdated... will fix :))

sevik
sevik's picture

I'm back :))

Analyzed interactions between bands - with only 2 and 6 band with main_volume >0 they both got 8 bytes format in nibbles 30-37 and 47-54 respectively...

test_interactions_2_6.wav
test_interactions_2_6.aud
test_interactions_2_6.frame
test_interactions_2_6.txt

.txt file - notes from Audacity, you can import it with "Import Notes"

digging further... :))

Generator code:

    data = silence.pack() * 15 + start_marker.pack()*3 + silence.pack() * 4
    data += start_frame.pack()*20 + silence.pack() * 4

    main_band = 2
    add_bands = [6]
    frame_num = 0
    for add_nibble in range(16, 64):
        for add_nibble_val in [0,1,7,8,9,15]:
            frame = Frame()
            frame.bands[main_band].volume = 13
            for b in add_bands:
                frame.bands[b].volume = 12
            f = frame.encode()
            f[add_nibble] = add_nibble_val
            sys.stderr.write("FRAME: %d: add_nibble %d add_nibble_val %d \n" % 
                    (frame_num, add_nibble, add_nibble_val))
            frame_num += 1

            data += start_frame.pack()*5 + frame.pack(f)*10 + silence.pack()*4

    data += end_marker.pack() + silence.pack() * 4

sevik
sevik's picture
sevik
sevik's picture

2+4 - [30-37] + [44-51]

dumps and files - exercise for interested readers :))

sevik
sevik's picture

6+8 - [40-47] + [49-56]

sevik
sevik's picture

3+7+13 - [30-37] + [41-48] + [54-61]
1+3+7+13 [22-29] + [32-39] + [43-50] + [56-61]

sevik
sevik's picture

15+13+11+9+7+5+3+1 = [56-63] + [47-54] + [38-45] + [31-36] + [24-29] + [21-22] + [19] + [17]

seems that number of bits per band assigned according to main_volume and number of band in sequence 8,8,8,6,6,2,1,1,1,...

sevik
sevik's picture

Will rework decoder according to latest findings tomorow... :))

Will see what is wrong this time :))

sevik
sevik's picture
sevik
sevik's picture
sevik
sevik's picture

heh

8,6 and 1 nibbles bands format decoded.

2 nibbles format remains.

sevik
sevik's picture
milw
milw's picture

great work, Sevik. I've been busy with some other things, and still have to work out a way to transfer files from my PC into the cartridge flash.

sevik
sevik's picture

I think simple parallel port programmer should work...

Something like this:

http://www.lancos.com/prog.html
http://tools.asix.net/dwnld_up.htm

PS I can't insist but consider switching to some more development friendly OS :))

Nocturnal
Nocturnal's picture

I'm going with transferring the images over the serial port using XMODEM, to a micro controller which handles the actual programming. The fact that XMODEM functions for the AVR line were available in a handy appnote had absolutely nothing to do with my decision... obviously.

Any parallel interface that does SPI will work, though you'll probably have to write your own software (I didn't find any suitable when I looked).

A parallel interface wouldn't do me much good (neither technically would a serial interface), The computer I am currently using to do most things has neither serial port nor parallel port. I have about 5 usb->serial adapters floating around though.

milw
milw's picture

Same here, it's usb all the way. i just ordered a USB memory stick interface for my Prop board, so I can have a goodly amount of data directly accessible by the Prop.

milw
milw's picture

It's quiet- too quiet! I've been out of town (small vacation) and trying to get the USB stick interface working now. Succeeded last night, so just have to erase the flash and then try loading Sevik's test image!

sevik
sevik's picture

:)) I was on business trip last days, completed new decoder and encoder offline :)) Returned 1 hour ago and going to sleep :))

http://sevik.org/robopanda/test_encoder.wav - original file
http://sevik.org/robopanda/test_encoder.aud - encoded file
http://sevik.org/robopanda/test_encoder_dec.wav - decoded encoded file :))
http://sevik.org/robopanda/test_encoder.bin - cartridge image with encoded file

You can try this cartridge image instead of test.bin :)) (I have not tested it on harware)

milw
milw's picture

That's getting pretty good Sevik! It must have been a very boring business trip, but I'm glad you're back.

sevik
sevik's picture

Have you tried this image on robopanda?

Buseness trip - it was IPTV Forum 2008 Russia/CIS :)) With many interesting speaks , some not so interesing and some just read-from-the-slides type of presentations :)) And there was a lot of power outlets :))

sevik
sevik's picture

Checked test image on robopanda - it really works :))

sevik
sevik's picture

tools updated with new encoder and decoder:

http://sevik.org/robopanda/robopanda_tools-200806272214.tar.gz

I think current audiocodec state is good enought :))

So it's time for returning to bytecodes and mover scripts :))

sevik
sevik's picture

All audio chunks in black cartridge decoded into mp3s:

http://sevik.org/robopanda/robopanda_mp3s-200806280046.tar.gz

songs encoded in 9 codec decoded wrong (as 7 codec)

sevik
sevik's picture

heh, with codec 9 encoded not a songs, but a long stories... Seems not olny I can't get acceptable encoding quality for fast speaking on codec 7 :))

Seems that codec 9 uses one additional subband format - 4 nibbles and has other sequence of formats to get 48 byte frame:

codec 7: 8,8,8,6,6,2,1,1,1,1,1,1,1,1,1,1 = 48 + 16 (main volumes) = 64 nibbles frame
codec 9: 8,8,8,8,8,8,6,6,4,4,2,2,2,2,2,2 = 80 + 16 (main volumes) = 96 nibbles frame

Anyone wanna hack this? :))

PS this guessing based on magic frame contents only:

Codec 9 magic frame:

00 00 00 00 00 00 00 00  - main volumes
18 11 11 11 - sb8
18 11 11 11 - sb8
18 11 11 11 - sb8
18 11 11 11 - sb8
18 11 11 11 - sb8
18 11 11 11 - sb8
18 11 55    - sb6
18 11 55    - sb6
58 55       - sb4
58 55       - sb4
58          - sb2
58          - sb2
58          - sb2
58          - sb2
58          - sb2
58          - sb2

Compare with codec 7 magic frame:

00 00 00 00 00 00 00 00   - main volumes
18 11 11 11  - sb8
18 11 11 11  - sb8
18 11 11 11  - sb8
18 11 55     - sb6
18 11 55     - sb6
58           - sb2
8            - sb1
8            - sb1
8            - sb1
8            - sb1
8            - sb1
8            - sb1
8            - sb1
8            - sb1
8            - sb1
8            - sb1

milw
milw's picture

Now I'm on a business trip ;) but just wanted to let you know that I got test_encoder.bin transferred to the Spansion flash chip last night and it played in the Robopanda (as you already know). It seemed a bit slower paced from panda than the original wav and encoded-decoded wav, but I didn't time it exactly. Could just be the difference between hearing it from my PC vs from the panda's speaker.
Rock on, Sevik! If I get a break I may try to emulate your works on codec 9, but I'm pretty heavily tied up this summer :(

sevik
sevik's picture
sevik
sevik's picture
sevik
sevik's picture

decoder and encoder updated according to generic subband format (as in spreadsheet)

corrected phases for subbands

some more experiments with encoder (working with interframe dependencies)

http://sevik.org/robopanda/robopanda_tools-200807090943.tar.gz

Encoder needs work for correct accounting of interframe dependencies! Are there someone with real DSP background?

sevik
sevik's picture

heh, some reading on topic suggests that encoder must be implemented using MDCT...

Pages