LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 521|回复: 3

急急急 BENQ S52本本 Ubuntu不能播放音乐

[复制链接]
发表于 2005-7-26 23:35:34 | 显示全部楼层 |阅读模式
我的情况是声卡被检测到是Corporation 82801FB/FBM/FR/FW/FRW/(ICH6 Family) AC97 Audio Controller 但是播放测试声音的时候测试进程就挂起了 播放MP3的时候是没有声音的
希望坛子里的兄弟帮忙了 感谢阿
以下是我执行/sbin/lspci -v后的信息.
[root@localhost derek]# /sbin/lspci -v
00:00.0 Host bridge: Intel Corporation Mobile 915GM/PM/GMS/910GML Express Proces sor to DRAM Controller (rev 03)
Subsystem: Unknown device 17ff:058b
Flags: bus master, fast devsel, latency 0
Capabilities: [e0] Vendor Specific Information

00:02.0 VGA compatible controller: Intel Corporation Mobile 915GM/GMS/910GML Exp ress Graphics Controller (rev 03) (prog-if 00 [VGA])
Subsystem: Unknown device 17ff:058b
Flags: bus master, fast devsel, latency 0, IRQ 10
Memory at b0080000 (32-bit, non-prefetchable) [size=512K]
I/O ports at 1800
Memory at c0000000 (32-bit, prefetchable) [size=256M]
Memory at b0000000 (32-bit, non-prefetchable) [size=256K]
Capabilities: [d0] Power Management version 2

00:02.1 Display controller: Intel Corporation Mobile 915GM/GMS/910GML Express Gr aphics Controller (rev 03)
Subsystem: Unknown device 17ff:058b
Flags: fast devsel
Memory at 20000000 (32-bit, non-prefetchable) [disabled] [size=512K]
Capabilities: [d0] Power Management version 2

00:1c.0 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Ex press Port 1 (rev 04) (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0
Bus: primary=00, secondary=02, subordinate=02, sec-latency=0
I/O behind bridge: 00000000-00000fff
Memory behind bridge: 00000000-000fffff
Prefetchable memory behind bridge: 0000000000000000-0000000000000000
Capabilities: [40] Express Root Port (Slot+) IRQ 0
Capabilities: [80] Message Signalled Interrupts: 64bit- Queue=0/0 Enable -
Capabilities: [90] #0d [0000]
Capabilities: [a0] Power Management version 2
Capabilities: [100] Virtual Channel
Capabilities: [180] Unknown (5)

00:1d.0 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) US B UHCI #1 (rev 04) (prog-if 00 [UHCI])
Subsystem: Unknown device 17ff:058b
Flags: bus master, medium devsel, latency 0, IRQ 11
I/O ports at 1820

00:1d.1 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) US B UHCI #2 (rev 04) (prog-if 00 [UHCI])
Subsystem: Unknown device 17ff:058b
Flags: bus master, medium devsel, latency 0, IRQ 11
I/O ports at 1840

00:1d.2 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) US B UHCI #3 (rev 04) (prog-if 00 [UHCI])
Subsystem: Unknown device 17ff:058b
Flags: bus master, medium devsel, latency 0, IRQ 10
I/O ports at 1860

00:1d.3 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) US B UHCI #4 (rev 04) (prog-if 00 [UHCI])
Subsystem: Unknown device 17ff:058b
Flags: bus master, medium devsel, latency 0, IRQ 10
I/O ports at 1880

00:1d.7 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) US B2 EHCI Controller (rev 04) (prog-if 20 [EHCI])
Subsystem: Unknown device 17ff:058b
Flags: bus master, medium devsel, latency 0, IRQ 11
Memory at b0040000 (32-bit, non-prefetchable) [size=1K]
Capabilities: [50] Power Management version 2
Capabilities: [58] Debug port

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev d4) (prog-if 01 [Subtractive decode])
Flags: bus master, fast devsel, latency 0
Bus: primary=00, secondary=06, subordinate=07, sec-latency=216
I/O behind bridge: 00004000-00004fff
Memory behind bridge: b8000000-b80fffff
Capabilities: [50] #0d [0000]

00:1e.2 Multimedia audio controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (IC H6 Family) AC'97 Audio Controller (rev 04)
Subsystem: Unknown device 17ff:058b
Flags: bus master, medium devsel, latency 0, IRQ 11
I/O ports at 1c00 [size=256]
I/O ports at 18c0
Memory at b0040800 (32-bit, non-prefetchable) [size=512]
Memory at b0040400 (32-bit, non-prefetchable) [size=256]
Capabilities: [50] Power Management version 2

00:1e.3 Modem: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Modem Controller (rev 04) (prog-if 00 [Generic])
Subsystem: Unknown device 17ff:058b
Flags: medium devsel, IRQ 10
I/O ports at 2400 [size=256]
I/O ports at 2000 [size=128]
Capabilities: [50] Power Management version 2

00:1f.0 ISA bridge: Intel Corporation 82801FBM (ICH6M) LPC Interface Bridge (rev 04)
Subsystem: Unknown device 17ff:058b
Flags: bus master, medium devsel, latency 0

00:1f.1 IDE interface: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) IDE Controller (rev 04) (prog-if 8a [Master SecP PriP])
Subsystem: Unknown device 17ff:058b
Flags: bus master, medium devsel, latency 0, IRQ 10
I/O ports at <unassigned>
I/O ports at <unassigned>
I/O ports at <unassigned>
I/O ports at <unassigned>
I/O ports at 1810

00:1f.3 SMBus: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) SMBus Contr oller (rev 04)
Subsystem: Unknown device 17ff:058b
Flags: medium devsel, IRQ 11
I/O ports at 20a0

06:01.0 CardBus bridge: Texas Instruments Texas Instruments PCIxx21/x515 Cardbus Controller
Subsystem: Unknown device 17ff:058b
Flags: bus master, medium devsel, latency 168, IRQ 10
Memory at b8006000 (32-bit, non-prefetchable) [size=4K]
Bus: primary=06, secondary=07, subordinate=0a, sec-latency=176
Memory window 0: 20400000-207ff000 (prefetchable)
Memory window 1: 20800000-20bff000
I/O window 0: 00004400-000044ff
I/O window 1: 00004800-000048ff
16-bit legacy interface ports at 0001

06:01.2 FireWire (IEEE 1394): Texas Instruments Texas Instruments OHCI Compliant IEEE 1394 Host Controller (prog-if 10 [OHCI])
Subsystem: Unknown device 17ff:058b
Flags: bus master, medium devsel, latency 32, IRQ 10
Memory at b8007000 (32-bit, non-prefetchable) [size=2K]
Memory at b8000000 (32-bit, non-prefetchable) [size=16K]
Capabilities: [44] Power Management version 2

06:01.3 Unknown mass storage controller: Texas Instruments Texas Instruments PCI xx21 Integrated FlashMedia Controller
Subsystem: Unknown device 17ff:058b
Flags: bus master, medium devsel, latency 57, IRQ 10
Memory at b8004000 (32-bit, non-prefetchable) [size=8K]
Capabilities: [44] Power Management version 2

06:03.0 Network controller: Intel Corporation PRO/Wireless 2200BG (rev 05)
Subsystem: Intel Corporation: Unknown device 2701
Flags: bus master, medium devsel, latency 32, IRQ 11
Memory at b8008000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [dc] Power Management version 2

06:08.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139 C+ (rev 10)
Subsystem: QUANTA Computer Inc: Unknown device 0728
Flags: bus master, medium devsel, latency 32, IRQ 10
I/O ports at 4000 [size=256]
Memory at b8007800 (32-bit, non-prefetchable) [size=256]
Capabilities: [50] Power Management version 2
发表于 2005-9-17 19:12:34 | 显示全部楼层
这种笔记本电脑再linux下面是1024x768的分辨率, 如何设置成1280x768的分辨率?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-9-19 15:33:42 | 显示全部楼层
915 resolution.c 代码如下
$sudo  gcc 915 resolution.c  -o 915 resolution 编译
产生915 resolution 执行文件
$sudo 915 resolution  -l   查看当前显示模式
$sudo 915resolution 5c 1280 768    5c为-l 显示中的一种
这样还只是修改了当前设置 重启后将会复原,所以应当在配置文件中进行设置
Ubuntu中应该修改/ect/init.d/rcS 文件
加入脚本代码  sudo 915resolution 5c 1280 768  在此之前需要拷贝文件到/sbin目录下
如果不拷贝者需要指明文件路径如/home/derek/915resolution 5c 1280 768
这样重启就会在启动GDM前设置分辨率.
DONE


/* 915 resolution by steve tomljenovic
*
* This was tested only on Sony VGN-FS550.  Use at your own risk
*
* This code is based on the techniques used in :
*
*   - 855patch.  Many thanks to Christian Zietz (czietz gmx net)
*     for demonstrating how to shadow the VBIOS into system RAM
*     and then modify it.
*
*   - 1280patch by Andrew Tipton (andrewtipton null li).
*
*   - 855resolution by Alain Poirier
*
* This source code is into the public domain.
*/


#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define __USE_GNU
#include <string.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <sys/io.h>
#include <unistd.h>
#include <assert.h>


#define NEW(a) ((a *)(calloc(1, sizeof(a))))
#define FREE(a) (free(a))


#define VBIOS_START         0xc0000
#define VBIOS_SIZE          0x10000


#define VBIOS_FILE    "/dev/mem"
#define VBIOS_OFFSET_IN_FILE VBIOS_START


#define CFG_SIGNATURE       "BIOS_DATA_BLOCK "


#define FALSE 0
#define TRUE 1


typedef unsigned char * address;
typedef unsigned char boolean;


typedef struct {
    unsigned char mode;
    unsigned char bits_per_pixel;
    unsigned short resolution;
    unsigned char unknown;



} __attribute__((packed)) vbios_mode;


typedef struct {
    unsigned char unknow1[2];
    unsigned char x1;
    unsigned char unknow2;
    unsigned char x2;
    unsigned char y1;
    unsigned char unknow3;
    unsigned char y2;


} __attribute__((packed)) vbios_resolution;


typedef struct {
    int bios_fd;
    address bios_ptr;

    address cnfg_ptr;


    vbios_mode * mode_table;
    int mode_table_size;


    boolean unlocked;



} vbios_map;


void initialize_system();
char * get_chipset(void);

vbios_map * open_vbios();
void close_vbios(vbios_map * map);


void unlock_vbios(vbios_map * map);
void relock_vbios(vbios_map * map);


void initialize_system(void) {
    if (iopl(3) < 0) {
        perror("Unable to obtain the proper IO permissions");
        exit(2);
    }



}


static unsigned int get_chipset_id(void) {
    outl(0x80000000, 0xcf8);
    return inl(0xcfc);


}


static char chipset_buffer[256];

char * get_chipset(void) {
    unsigned int id;
    char * name;


    id = get_chipset_id();


    switch (id) {
    case 0x25608086:
        name = "845G";
        break;


    case 0x35808086:
        name = "855GM";
        break;


    case 0x25708086:
        name = "865G";
        break;


    case 0x25908086:
        name = "915GM";
        break;


    default:
        sprintf(chipset_buffer, "Unknown (0x%08x)", id);
        name = chipset_buffer;
        break;
    }


    return name;



}


vbios_map * open_vbios() {
    vbios_map * map = NEW(vbios_map);

    /*
     *  Map the video bios to memory
     */


    map->bios_fd = open(VBIOS_FILE, O_RDWR);
    if(map->bios_fd < 0) {
        perror("Unable to open the BIOS file");
        exit(2);
    }


    map->bios_ptr = mmap((void *)VBIOS_START, VBIOS_SIZE,
                         PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED,
                         map->bios_fd, VBIOS_OFFSET_IN_FILE);


    if (map->bios_ptr == NULL) {
        fprintf(stderr, "Cannot mmap() the video BIOS\n");
        close(map->bios_fd);
        exit(2);
    }


    /*
     * figure out where the configuration information is
     */


    map->cnfg_ptr = memmem(map->bios_ptr, VBIOS_SIZE, CFG_SIGNATURE,
strlen(CFG_SIGNATURE));


    if (map->cnfg_ptr == NULL) {
        fprintf(stderr, "Couldn't find the configuration area in the VBIOS!\n");
        close_vbios(map);
        exit(2);
    }


    /*
     * Figure out where the mode table is and which type of bios we have
     */


    {
        address p = map->bios_ptr;
        address limit = map->bios_ptr + VBIOS_SIZE - (3 * sizeof(vbios_mode));


        while (p < limit && map->mode_table == 0) {
            vbios_mode * mode_ptr = (vbios_mode *) p;


            if (((mode_ptr[0].mode & 0xf0) == 0x30) &&
((mode_ptr[1].mode & 0xf0) == 0x30) &&
                ((mode_ptr[2].mode & 0xf0) == 0x30) &&
((mode_ptr[3].mode & 0xf0) == 0x30)) {


                map->mode_table = mode_ptr;
            }


            p++;
        }


        if (map->mode_table == 0) {
            fprintf(stderr, "Unable to locate mode table!\n");
            close_vbios(map);
            exit(2);
        }
    }


    /*
     * Determine size of mode table
     */


    {
        vbios_mode * mode_ptr = map->mode_table;


        while (mode_ptr->mode != 0xff) {
            map->mode_table_size++;
            mode_ptr++;
        }
    }


    return map;



}


void close_vbios(vbios_map * map) {
    assert(!map->unlocked);

    if(map->bios_ptr == NULL) {
        fprintf(stderr, "BIOS should be open already!\n");
        exit(2);
    }


    munmap(map->bios_ptr, VBIOS_SIZE);
    close(map->bios_fd);


    FREE(map);



}


void unlock_vbios(vbios_map * map) {
    assert(!map->unlocked);

    map->unlocked = TRUE;


    outl(0x80000090, 0xcf8);


#if DEBUG
    {
        unsigned int t = inl(0xcfc);
        printf("unlock PAM: (0x%08x)\n", t);
    }
#endif


    outb(0x33, 0xcfd);
    outb(0x33, 0xcfe);


#if DEBUG
    {
        unsigned int t = inl(0xcfc);
        printf("unlock PAM: (0x%08x)\n", t);
    }
#endif



}


void relock_vbios(vbios_map * map) {
    assert(map->unlocked);

    map->unlocked = FALSE;


    outl(0x80000090, 0xcf8);


#if DEBUG
    {
        unsigned int t = inl(0xcfc);
        printf("relock PAM: (0x%08x)\n", t);
    }
#endif


    outb(0x11, 0xcfd);
    outb(0x11, 0xcfe);


#if DEBUG
    {
        unsigned int t = inl(0xcfc);
        printf("relock PAM: (0x%08x)\n", t);
    }
#endif



}


vbios_resolution * map_resolution(vbios_map * map, unsigned short res) {

    vbios_resolution * ptr = ((vbios_resolution*)(map->bios_ptr + res));


    return ptr;



}


void list_modes(vbios_map *map) {
    unsigned int i, x, y;

    for (i=0; i < map->mode_table_size; i++) {
        vbios_resolution * res = map_resolution(map,
map->mode_table.resolution);


        x = ((((unsigned int) res->x2) & 0xf0) << 4) | res->x1;
        y = ((((unsigned int) res->y2) & 0xf0) << 4) | res->y1;


        if (x != 0 && y != 0) {
            printf("Mode %02x : %dx%d, %d bits/pixel\n",
map->mode_table.mode, x, y, map->mode_table.bits_per_pixel);
        }
    }



}


void set_mode(vbios_map * map, unsigned int mode, unsigned int x,
unsigned int y) {
    unsigned int i;

    for (i=0; i < map->mode_table_size; i++) {
        if (map->mode_table.mode == mode) {
            vbios_resolution * res = map_resolution(map,
map->mode_table.resolution);


            res->x2 = (res->x2 & 0x0f) | ((x >> 4) & 0xf0);
            res->x1 = (x & 0xff);


            res->y2 = (res->y2 & 0x0f) | ((y >> 4) & 0xf0);
            res->y1 = (y & 0xff);
        }
    }



}   


int parse_args(int argc, char *argv[], int *list, int *mode, int *x, int *y) {
    int index = 1;

    *list = *mode = *x = *y = 0;


    if ((argc > index) && !strcmp(argv[index], "-l")) {
        *list = 1;
        index++;


        if(argc<=index) {
            return 0;
        }
    }


    if(argc-index != 3) {
        return -1;
    }


    *mode = (int) strtol(argv[index], NULL, 16);
    *x = atoi(argv[index+1]);
    *y = atoi(argv[index+2]);


    return 0;



}


void usage(char *name) {
    printf("Usage: %s [-l] [mode X Y]\n", name);
    printf("  Set the resolution to XxY for mode\n");
    printf("  Options:\n");
    printf("    -l display the modes found into the vbios\n");


}


int main (int argc, char *argv[]) {
    vbios_map * map;
    char * chipset;
    int list, mode, x, y;

    printf("Intel 915GM VBIOS Hack : version 0.1\n\n");


    if (parse_args(argc, argv, &list, &mode, &x, &y) == -1) {
        usage(argv[0]);
        return 2;
    }


    initialize_system();


    chipset = get_chipset();


    printf("Chipset: %s\n", chipset);


    map = open_vbios();


    printf("\n");


    if (list) {
        list_modes(map);
    }


    if (mode!=0 && x!=0 && y!=0) {
        unlock_vbios(map);
        set_mode(map, mode, x, y);
        relock_vbios(map);


        printf("** Patch mode %02x to resolution %dx%d complete\n", mode, x, y);


        if (list) {
            list_modes(map);
        }
    }


    close_vbios(map);


    return 0;



}
回复 支持 反对

使用道具 举报

发表于 2005-9-20 12:08:22 | 显示全部楼层
目前声卡还没有驱动,等吧,我也在等,本子和楼主是一样的
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表