MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD
Well your original change works for both the old boxes and new (I tested on vu+ uno4kse and GBUE4k), so thats the commit on OE-A… and don,t forget someone posted solo4k not working and thats not mips.
my Xtrend ET7500 (mips) works on the old code no issue, so again not all mips boxes have an issue.
Last edited by twol; 20-04-24 at 18:37.
Gigablue Quad 4K & UE 4K
.........FBC Tuners:
------------------> GT-Sat unicable LNB to 1.5M dish(28.2E)
------------------> Gigablue unicable LNB to 80 cm dish(19.2E)
.......................
Vu+ Uno4KSE, Dreambox dm900
AX HD61, Edision Osmio 4K+, Zgemma H9Combo, Octagon SF8008 , gbtrio4k, h9se using unicable ports
Zgemma H9 C/S into Giga4K
Last edited by birdman; 20-04-24 at 21:09.
MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD
The mmap(2) - Linux man page declares offset as off_t not unsigned int in its in example, so that code does looks wrong there.
sizeof(off_t) changes using -D_FILE_OFFSET_BITS=64 the same way as sizeof(time_t) changes when using -D_TIME_BITS=64
Try just declaring int as size_t to fix it?
This single change alone fixed it for me.
Code:diff --git a/main.c b/main.c index 1c1fee7..a01297d 100644 --- a/main.c +++ b/main.c @@ -1148,7 +1148,7 @@ void getvideo(unsigned char *video, int *xres, int *yres) return; } - int adr, adr2, ofs, ofs2, offset, pageoffset; + size_t adr, adr2, ofs, ofs2, offset, pageoffset; int xtmp,xsub,ytmp,t2,dat1; if (stb_type == BRCM73565 || stb_type == BRCM73625 || stb_type == BRCM7439DAGS || stb_type == BRCM7439 || stb_type == BRCM75845 || stb_type == BRCM72604) {
MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD
If you can make 'adr' work using off_t?
'adr' only works defined with size_t for me.
Origianl declaration:
int adr, adr2, ofs, ofs2, offset, pageoffset;
with off_t:Code:Grabbing 32bit Framebuffer ... ... Framebuffer-Size: 1920 x 1080 Grabbing Video ... Adr: BC000000 Adr2: BC1FE000 OFS: 440 240 stride:780 Adr: BC000000 Adr2: BC1FE000 offset: 1FE000 pageoffset:0 Stride: 1920 Res: 1080 sizeof(off_t) 8 sizeof(Adr:) 4 sizeof(Adr2): 4 sizeof(OFS): 4 sizeof(OFS2): 4 Adr: BC000000 Adr2: BC1FE000 OFS: 440 240 memory_tmp_size:31E000 Mainmemory: <Memmapping failed> Resizing Video to 1920 x 1080 ... Merge Video with Framebuffer ... Saving 24 bit /tmp/screenshot.bmp ... ... Done !
off_t adr;
int adr2, ofs, ofs2, offset, pageoffset;
working with size_t:Code:Grabbing 32bit Framebuffer ... ... Framebuffer-Size: 1920 x 1080 Grabbing Video ... Adr: BC000000 Adr2: FFFFFFFF OFS: BC1FE000 440 stride:240 Adr: BC000000 Adr2: FFFFFFFF offset: BC1FE000 pageoffset:1FE000 Stride: 1920 Res: 1080 sizeof(off_t) 8 sizeof(Adr:) 8 sizeof(Adr2): 4 sizeof(OFS): 4 sizeof(OFS2): 4 Adr: BC000000 Adr2: FFFFFFFF OFS: BC1FE000 440 memory_tmp_size:240 Mainmemory: <Memmapping failed> Resizing Video to 1920 x 1080 ... Merge Video with Framebuffer ... Saving 24 bit /tmp/screenshot.bmp ... ... Done !
size_t adr;
int adr2, ofs, ofs2, offset, pageoffset;
Code:Grabbing 32bit Framebuffer ... ... Framebuffer-Size: 1920 x 1080 Grabbing Video ... Adr: BC000000 Adr2: BC1FE000 OFS: 440 240 stride:780 Adr: BC000000 Adr2: BC1FE000 offset: 1FE000 pageoffset:0 Stride: 1920 Res: 1080 sizeof(off_t) 8 sizeof(Adr:) 4 sizeof(Adr2): 4 sizeof(OFS): 4 sizeof(OFS2): 4 Adr: BC000000 Adr2: BC1FE000 OFS: 440 240 memory_tmp_size:31E000 Merge Video with Framebuffer ... Saving 24 bit /tmp/screenshot.bmp ... ... Done !
If you must declare off_t for the mmap offset, you could try this patch to remove the padding from adr of /* start of videomem */
This seems to also work.
Code:diff --git a/main.c b/main.c index 1c1fee7..9a6e455 100644 --- a/main.c +++ b/main.c @@ -161,8 +161,8 @@ static enum {UNKNOWN, DMNEW, WETEK, AZBOX863x, AZBOX865x, ST, PALLAS, VULCAN, XI static int chr_luma_stride = 0x40; static int chr_luma_register_offset = 0; -static unsigned int registeroffset = 0; -static unsigned int mem2memdma_register = 0; +static off_t registeroffset = 0; +static off_t mem2memdma_register = 0; static int quiet = 0; static int video_dev = 0; @@ -1148,7 +1148,8 @@ void getvideo(unsigned char *video, int *xres, int *yres) return; } - int adr, adr2, ofs, ofs2, offset, pageoffset; + off_t adr; + int adr2, ofs, ofs2, offset, pageoffset; int xtmp,xsub,ytmp,t2,dat1; if (stb_type == BRCM73565 || stb_type == BRCM73625 || stb_type == BRCM7439DAGS || stb_type == BRCM7439 || stb_type == BRCM75845 || stb_type == BRCM72604) { @@ -1158,13 +1159,13 @@ void getvideo(unsigned char *video, int *xres, int *yres) ofs2 = data[chr_luma_register_offset + 28] << 4; /* chroma lines */ adr2 = data[chr_luma_register_offset + 3] << 24 | data[chr_luma_register_offset + 2] << 16 | data[chr_luma_register_offset + 1] << 8; stride = data[0x19] << 8 | data[0x18]; - adr = data[0x37] << 24 | data[0x36] << 16 | data[0x35] << 8; /* start of videomem */ + adr = (data[0x37] << 24 | data[0x36] << 16 | data[0x35] << 8) & 0xffff0000; /* start of videomem */ } else { ofs = data[chr_luma_register_offset + 8] << 4; /* luma lines */ ofs2 = data[chr_luma_register_offset + 12] << 4; /* chroma lines */ adr2 = data[chr_luma_register_offset + 3] << 24 | data[chr_luma_register_offset + 2] << 16 | data[chr_luma_register_offset + 1] << 8; stride = data[0x15] << 8 | data[0x14]; - adr = data[0x1f] << 24 | data[0x1e] << 16 | data[0x1d] << 8; /* start of videomem */ + adr = (data[0x1f] << 24 | data[0x1e] << 16 | data[0x1d] << 8) & 0xffff0000; /* start of videomem */ } offset = adr2 - adr; pageoffset = adr & 0xfff;
MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD
MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD
Of course, it would help in knowing which mmap() produces the error if there weren't 7 instances of exactly the same error message
but a different one on each occasion.Code:"Mainmemory: <Memmapping failed>\n"
There are also 4 printf() calls where the parameters to fulfill the template are missing.
How does this ever get built!
Last edited by birdman; 21-04-24 at 22:42.
MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD
This compiles (only warnings are about unused variables, unknown pragmas and various enum values not handled in switch, if I add -Wall) and works with both these compile commands on an et8000:
Code:gcc main.c -o grab -lpng -ljpeg
main.zipCode:gcc -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 main.c -o grab64 -lpng -ljpeg
MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD
Three pull requests:
- Correct fprintf templates to fit no of parameters https://github.com/oe-alliance/aio-grab/pull/12
- Add discriminating number to <Memmapping failed> error messages. https://github.com/oe-alliance/aio-grab/pull/13
- Modify code to prevent sign extensions from "8bit<<24" item messing up 64-bit file-system API use. https://github.com/oe-alliance/aio-grab/pull/14
MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD