Re: [Redbutton-devel] Problems running on arm platform...
Brought to you by:
skilvington
|
From: Simon K. <s.k...@er...> - 2010-01-27 13:25:19
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Stuart Hopkins wrote:
> Simon Kilvington wrote:
> Hi,
>
> from past experience with ARM processors, I would guess the reason
> the
> wrong value is getting read is because it is not aligned on a 4-byte
> boundary in memory - in theory the fix should be fairly trivial - change
> the biop_uint32 function to take a pointer to the uint32 rather than the
> actual value - but it means changing every instance in the code where
> the biop_uint32 function is called.
>
> try adding this function to the biop.c file:
>
> uint32_t
> biop_puint32(uint8_t byte_order, uint8_t *raw)
> {
> uint8_t *p = raw;
> uint32_t val;
>
> if(byte_order == BIOP_BIGENDIAN)
> val = (p[0] << 24) + (p[1] << 16) + (p[2] << 8) + p[3];
> else
> val = (p[3] << 24) + (p[2] << 16) + (p[1] << 8) + p[0];
>
> return val;
> }
>
> then change line 278 from:
>
> if(biop_uint32(profile_bo, *((uint32_t *) profile.data)) !=
> TAG_ObjectLocation)
>
> to:
>
> if(biop_puint32(profile_bo, profile.data)) != TAG_ObjectLocation)
>
> if that fixes the first fatal error, then do the equivalent change
> for
> every other call to biop_uint32... there's only about 9 in total - let
> me know if it works and if you need a hand - if it fixes it I'll update
> the code.
>
> Stuart Hopkins wrote:
>
>>>> Hi,
>>>> I've been trying to get rb-download to work on an arm platform
>>>> (Sheevaplug) but it's having some trouble decoding the data. The
>>>> standard error message I get is:
>>>>
>>>> Expecting BIOP::ObjectLocation
>>>>
>>>> However after some hacking around with the C code it looks like a
>>>> conversion problem in biop_uint32. Some details below:
>>>>
>>>>
>>>> Waiting for tuner to lock on
>>>> Retuned
>>>> original_network_id=9018
>>>> PMT PID: 4163
>>>> PID=600 video stream_type=0x2
>>>> PID=600 component_tag=1
>>>> PID=601 component_tag=2
>>>> PID=601 audio stream_type=0x3
>>>> PID=602 component_tag=6
>>>> PID=605 component_tag=5
>>>> PID=605 descriptor=0x59
>>>> 0x00000000 65 6e 67 10 00 01 00 01 eng.....
>>>> PID=1005 component_tag=110
>>>> PID=1005 carousel_id=1
>>>> PID=1005 boot_priority_hint=0
>>>> UK application_type_code (0x0101)
>>>> Set boot_pid=1005 carousel_id=1
>>>> Adding PID 1005 to filter
>>>> PID=1006 component_tag=111
>>>> PID=1007 component_tag=112
>>>> PID=650 component_tag=101
>>>> PID=651 component_tag=102
>>>> PID=652 component_tag=103
>>>> Carousel ID=1
>>>> Boot PID=1005
>>>> Video PID=600
>>>> Audio PID=601
>>>> Listening on 0.0.0.0:10101
>>>> DownloadServerInitiate
>>>> BIOP::ServiceGatewayInfo
>>>> 0x00000000 00 00 00 04 73 72 67 00 00 00 00 01 49 53 4f 06
>>>> ....srg.....ISO.
>>>> 0x00000010 00 00 00 28 00 02 49 53 4f 50 0a 00 00 00 01 00
>>>> ...(..ISOP......
>>>> 0x00000020 ac 01 00 01 01 49 53 4f 40 12 01 00 00 00 16 00
>>>> .....ISO@.......
>>>> 0x00000030 65 0a 00 01 80 00 00 42 03 93 87 00 00 00 00 00
>>>> e......B........
>>>>
>>>>
>>>> The conversion error appears to be:
>>>>
>>>> 49530002 - 49534F50
>>>>
>>>> where the first value is the converted result, and the last value is
>>>> what it expects. You can see that in the hex dump above that value is
>>>> there, and the same goes for the DSM::ConnBinder value later on (if I
>>>> override the fatal error).
>>>>
>>>> I'm pretty rubbish at C, but i'm hoping someone on the devel list can
>>>> shed some insight, or possibly a patch, to fix this :-) I'm willing
>>>> to test any patches that people can provide etc.
>>>>
>>>> Regards
>>>>
>>>> Stuart
>>>>
>>>> ------------------------------------------------------------------------------
>>>>
>>>> The Planet: dedicated and managed hosting, cloud storage, colocation
>>>> Stay online with enterprise data centers and the best network in the
>>>> business
>>>> Choose flexible plans and management services without long-term
>>>> contracts
>>>> Personal 24x7 support from experience hosting pros just a phone call
>>>> away.
>>>> http://p.sf.net/sfu/theplanet-com
>>>> _______________________________________________
>>>> Redbutton-devel mailing list
>>>> Red...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/redbutton-devel
>>>>
>>>>
>>>>
>
> Hi,
> I made the edits (7 in total), and now it fails on another part :-( I do
> wonder if the biob_uint16 also has problems, or if that is aligned...
> ./rb-download -vvvvvvv 4163dbutton-download/trunk# dvbtune -f 578166670 -c
> Using DVB card "Twinhan VP7045/46 USB DVB-T"
> tuning DVB-T (in United Kingdom) to 578166670 Hz
> polling....
> Getting frontend event
> FE_STATUS:
> polling....
> Getting frontend event
> FE_STATUS: FE_HAS_SIGNAL FE_HAS_LOCK FE_HAS_CARRIER FE_HAS_VITERBI
> FE_HAS_SYNC
> Bit error rate: 0
> Signal strength: 37481
> SNR: 28270
> FE_STATUS: FE_HAS_SIGNAL FE_HAS_LOCK FE_HAS_CARRIER FE_HAS_VITERBI
> FE_HAS_SYNC
> Getting frontend info
> Adapter 0 is a 'Twinhan VP7045/46 USB DVB-T' DVB-T card
> Trying to open /root/.tzap/channels.conf
> Trying to open /etc/channels.conf
> Getting frontend info
> Searching channels.conf for service_id 4163
> BBC
> ONE:578166670:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_3_4:QAM_16:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:600:601:4163
> Current frequency 578166670; needed 578166670; first_time=1
> Retuning to frequency 578166670
> Waiting for tuner to lock on
> Retuned
> original_network_id=9018
> PMT PID: 4163
> PID=600 video stream_type=0x2
> PID=600 component_tag=1
> PID=601 component_tag=2
> PID=601 audio stream_type=0x3
> PID=602 component_tag=6
> PID=605 component_tag=5
> PID=605 descriptor=0x59
> 0x00000000 65 6e 67 10 00 01 00 01 eng.....
> PID=1005 component_tag=110
> PID=1005 carousel_id=1
> PID=1005 boot_priority_hint=0
> UK application_type_code (0x0101)
> Set boot_pid=1005 carousel_id=1
> Adding PID 1005 to filter
> PID=1006 component_tag=111
> PID=1007 component_tag=112
> PID=650 component_tag=101
> PID=651 component_tag=102
> PID=652 component_tag=103
> Carousel ID=1
> Boot PID=1005
> Video PID=600
> Audio PID=601
> Listening on 0.0.0.0:10101
> DownloadServerInitiate
> BIOP::ServiceGatewayInfo
> 0x00000000 00 00 00 04 73 72 67 00 00 00 00 01 49 53 4f 06 ....srg.....ISO.
> 0x00000010 00 00 00 28 00 02 49 53 4f 50 0a 00 00 00 01 00 ...(..ISOP......
> 0x00000020 ac 01 00 01 01 49 53 4f 40 12 01 00 00 00 16 00 .....ISO@.......
> 0x00000030 65 0a 00 01 80 00 00 42 03 93 87 00 00 00 00 00 e......B........
> IOP::IOR
> typeId: 'srg'
> taggedProfiles_count: 1
> IOP::taggedProfile 0
> BIOPProfileBody:
> carouselId: 1
> moduleId: 256
> objectKey: ''
> 0x00000000 01 .
> DSM::ConnBinder
> taps_count: 1
> BIOP::Tap
> Expecting BIOP_DELIVERY_PARA_USE
> The one thing that does seem to be different is that I now get a compile
> warning about line 72:
> biop.c:72: warning: passing argument 2 of ‘biop_puint32’ makes pointer
> from integer without a cast
> Changing it back to use biop_uint32 removes the error, but the result is
> still the same.
> FYI: The lines that I edited (from fresh SVN copy)
> 72, 260, 278, 284, 301, 238, 429
> I also added the definition in the header file so it would compile.
> Regards
> Stuart
okay, I've just committed a patch that makes sure we don't read shorts
or ints from memory locations which aren't 4-byte aligned.
can you give it a try and see if it fixes the problem?
Once this works, other problems may show up because I wasn't thinking
about this issue when I wrote the rest of the code... let's see what
happens...
- --
Simon Kilvington
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAktgOnsACgkQmt9ZifioJSzPGgCeKXtumCn7cQnIT0CxTKYfjTb1
q/sAnR4Ebes0S8l0rcV9o9vlxOdmMgMF
=I7K8
-----END PGP SIGNATURE-----
|