Lines Matching full:x

436   $echo 'x -' 'creating lock directory'
443 $echo 'x -' 'creating directory' 'MultiSound.d'
447 $echo 'x -' SKIPPING 'MultiSound.d/setdigital.c' '(file already exists)'
449 $echo 'x -' extracting 'MultiSound.d/setdigital.c' '(text)'
450 sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/setdigital.c' &&
452 X *
453 X * setdigital.c - sets the DIGITAL1 input for a mixer
454 X *
455 X * Copyright (C) 1998 Andrew Veliath
456 X *
457 X * This program is free software; you can redistribute it and/or modify
458 X * it under the terms of the GNU General Public License as published by
459 X * the Free Software Foundation; either version 2 of the License, or
460 X * (at your option) any later version.
461 X *
462 X * This program is distributed in the hope that it will be useful,
463 X * but WITHOUT ANY WARRANTY; without even the implied warranty of
464 X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
465 X * GNU General Public License for more details.
466 X *
467 X * You should have received a copy of the GNU General Public License
468 X * along with this program; if not, write to the Free Software
469 X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
470 X *
471 X ********************************************************************/
472 X
480 X
483 X int fd;
484 X unsigned long recmask, recsrc;
485 X
486 X if (argc != 2) {
487 X fprintf(stderr, "usage: setdigital <mixer device>\n");
488 X exit(1);
489 X }
490 X
491 X if ((fd = open(argv[1], O_RDWR)) < 0) {
492 X perror(argv[1]);
493 X exit(1);
494 X }
495 X
496 X if (ioctl(fd, SOUND_MIXER_READ_RECMASK, &recmask) < 0) {
497 X fprintf(stderr, "error: ioctl read recording mask failed\n");
498 X perror("ioctl");
499 X close(fd);
500 X exit(1);
501 X }
502 X
503 X if (!(recmask & SOUND_MASK_DIGITAL1)) {
504 X fprintf(stderr, "error: cannot find DIGITAL1 device in mixer\n");
505 X close(fd);
506 X exit(1);
507 X }
508 X
509 X if (ioctl(fd, SOUND_MIXER_READ_RECSRC, &recsrc) < 0) {
510 X fprintf(stderr, "error: ioctl read recording source failed\n");
511 X perror("ioctl");
512 X close(fd);
513 X exit(1);
514 X }
515 X
516 X recsrc |= SOUND_MASK_DIGITAL1;
517 X
518 X if (ioctl(fd, SOUND_MIXER_WRITE_RECSRC, &recsrc) < 0) {
519 X fprintf(stderr, "error: ioctl write recording source failed\n");
520 X perror("ioctl");
521 X close(fd);
522 X exit(1);
523 X }
524 X
525 X close(fd);
526 X
527 X return 0;
547 $echo 'x -' SKIPPING 'MultiSound.d/pinnaclecfg.c' '(file already exists)'
549 $echo 'x -' extracting 'MultiSound.d/pinnaclecfg.c' '(text)'
550 sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/pinnaclecfg.c' &&
552 X *
553 X * pinnaclecfg.c - Pinnacle/Fiji Device Configuration Program
554 X *
555 X * This is for NON-PnP mode only. For PnP mode, use isapnptools.
556 X *
557 X * This is Linux-specific, and must be run with root permissions.
558 X *
559 X * Part of the Turtle Beach MultiSound Sound Card Driver for Linux
560 X *
561 X * Copyright (C) 1998 Andrew Veliath
562 X *
563 X * This program is free software; you can redistribute it and/or modify
564 X * it under the terms of the GNU General Public License as published by
565 X * the Free Software Foundation; either version 2 of the License, or
566 X * (at your option) any later version.
567 X *
568 X * This program is distributed in the hope that it will be useful,
569 X * but WITHOUT ANY WARRANTY; without even the implied warranty of
570 X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
571 X * GNU General Public License for more details.
572 X *
573 X * You should have received a copy of the GNU General Public License
574 X * along with this program; if not, write to the Free Software
575 X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
576 X *
577 X ********************************************************************/
578 X
586 X
611 X
615 X
619 X
621 X
624 X outb(reg, cfg);
625 X outb(value, cfg + 1);
626 X if (value != inb(cfg + 1)) {
627 X fprintf(stderr, "error: msnd_write_cfg: I/O error\n");
628 X return -EIO;
629 X }
630 X return 0;
632 X
635 X outb(reg, cfg);
636 X return inb(cfg + 1);
638 X
641 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
642 X return -EIO;
643 X if (msnd_write_cfg(cfg, IREG_IO0_BASEHI, HIBYTE(io)))
644 X return -EIO;
645 X if (msnd_write_cfg(cfg, IREG_IO0_BASELO, LOBYTE(io)))
646 X return -EIO;
647 X return 0;
649 X
652 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
653 X return -EIO;
654 X
655 X *io = MAKEWORD(msnd_read_cfg(cfg, IREG_IO0_BASELO),
656 X msnd_read_cfg(cfg, IREG_IO0_BASEHI));
657 X
658 X return 0;
660 X
663 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
664 X return -EIO;
665 X if (msnd_write_cfg(cfg, IREG_IO1_BASEHI, HIBYTE(io)))
666 X return -EIO;
667 X if (msnd_write_cfg(cfg, IREG_IO1_BASELO, LOBYTE(io)))
668 X return -EIO;
669 X return 0;
671 X
674 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
675 X return -EIO;
676 X
677 X *io = MAKEWORD(msnd_read_cfg(cfg, IREG_IO1_BASELO),
678 X msnd_read_cfg(cfg, IREG_IO1_BASEHI));
679 X
680 X return 0;
682 X
685 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
686 X return -EIO;
687 X if (msnd_write_cfg(cfg, IREG_IRQ_NUMBER, LOBYTE(irq)))
688 X return -EIO;
689 X if (msnd_write_cfg(cfg, IREG_IRQ_TYPE, IRQTYPE_EDGE))
690 X return -EIO;
691 X return 0;
693 X
696 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
697 X return -EIO;
698 X
699 X *irq = msnd_read_cfg(cfg, IREG_IRQ_NUMBER);
700 X
701 X return 0;
703 X
706 X WORD wmem;
707 X
708 X mem >>= 8;
709 X mem &= 0xfff;
710 X wmem = (WORD)mem;
711 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
712 X return -EIO;
713 X if (msnd_write_cfg(cfg, IREG_MEMBASEHI, HIBYTE(wmem)))
714 X return -EIO;
715 X if (msnd_write_cfg(cfg, IREG_MEMBASELO, LOBYTE(wmem)))
716 X return -EIO;
717 X if (wmem && msnd_write_cfg(cfg, IREG_MEMCONTROL, (MEMTYPE_HIADDR | MEMTYPE_16BIT)))
718 X return -EIO;
719 X return 0;
721 X
724 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
725 X return -EIO;
726 X
727 X *mem = MAKEWORD(msnd_read_cfg(cfg, IREG_MEMBASELO),
728 X msnd_read_cfg(cfg, IREG_MEMBASEHI));
729 X *mem <<= 8;
730 X
731 X return 0;
733 X
736 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
737 X return -EIO;
738 X if (msnd_write_cfg(cfg, IREG_ACTIVATE, LD_ACTIVATE))
739 X return -EIO;
740 X return 0;
742 X
745 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
746 X return -EIO;
747 X if (msnd_write_cfg_io0(cfg, num, io0))
748 X return -EIO;
749 X if (msnd_write_cfg_io1(cfg, num, io1))
750 X return -EIO;
751 X if (msnd_write_cfg_irq(cfg, num, irq))
752 X return -EIO;
753 X if (msnd_write_cfg_mem(cfg, num, mem))
754 X return -EIO;
755 X if (msnd_activate_logical(cfg, num))
756 X return -EIO;
757 X return 0;
759 X
762 X if (msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
763 X return -EIO;
764 X if (msnd_read_cfg_io0(cfg, num, io0))
765 X return -EIO;
766 X if (msnd_read_cfg_io1(cfg, num, io1))
767 X return -EIO;
768 X if (msnd_read_cfg_irq(cfg, num, irq))
769 X return -EIO;
770 X if (msnd_read_cfg_mem(cfg, num, mem))
771 X return -EIO;
772 X return 0;
774 X
777 X fprintf(stderr,
778 X "\n"
779 X "pinnaclecfg 1.0\n"
780 X "\n"
781 X "usage: pinnaclecfg <config port> [device config]\n"
782 X "\n"
783 X "This is for use with the card in NON-PnP mode only.\n"
784 X "\n"
785 X "Available devices (not all available for Fiji):\n"
786 X "\n"
787 X " Device Description\n"
788 X " -------------------------------------------------------------------\n"
789 X " reset Reset all devices (i.e. disable)\n"
790 X " show Display current device configurations\n"
791 X "\n"
792 X " dsp <io> <irq> <mem> Audio device\n"
793 X " mpu <io> <irq> Internal Kurzweil synth\n"
794 X " ide <io0> <io1> <irq> On-board IDE controller\n"
795 X " joystick <io> Joystick port\n"
796 X "\n");
797 X exit(1);
799 X
802 X int i;
803 X
804 X for (i = 0; i < 4; ++i)
805 X msnd_write_cfg_logical(config_port, i, 0, 0, 0, 0);
806 X
807 X return 0;
809 X
812 X int i;
813 X int count = 0;
814 X
815 X for (i = 0; i < 4; ++i) {
816 X WORD io0, io1, irq;
817 X int mem;
818 X msnd_read_cfg_logical(config_port, i, &io0, &io1, &irq, &mem);
819 X switch (i) {
820 X case 0:
821 X if (io0 || irq || mem) {
822 X printf("dsp 0x%x %d 0x%x\n", io0, irq, mem);
823 X ++count;
824 X }
825 X break;
826 X case 1:
827 X if (io0 || irq) {
828 X printf("mpu 0x%x %d\n", io0, irq);
829 X ++count;
830 X }
831 X break;
832 X case 2:
833 X if (io0 || io1 || irq) {
834 X printf("ide 0x%x 0x%x %d\n", io0, io1, irq);
835 X ++count;
836 X }
837 X break;
838 X case 3:
839 X if (io0) {
840 X printf("joystick 0x%x\n", io0);
841 X ++count;
842 X }
843 X break;
844 X }
845 X }
846 X
847 X if (count == 0)
848 X fprintf(stderr, "no devices configured\n");
849 X
850 X return 0;
852 X
855 X int io, irq, mem;
856 X
857 X if (argc < 3 ||
858 X sscanf(argv[0], "0x%x", &io) != 1 ||
859 X sscanf(argv[1], "%d", &irq) != 1 ||
860 X sscanf(argv[2], "0x%x", &mem) != 1)
861 X usage();
862 X
863 X if (!(io == 0x290 ||
864 X io == 0x260 ||
865 X io == 0x250 ||
866 X io == 0x240 ||
867 X io == 0x230 ||
868 X io == 0x220 ||
869 X io == 0x210 ||
870 X io == 0x3e0)) {
871 X fprintf(stderr, "error: io must be one of "
872 X "210, 220, 230, 240, 250, 260, 290, or 3E0\n");
873 X usage();
874 X }
875 X
876 X if (!(irq == 5 ||
877 X irq == 7 ||
878 X irq == 9 ||
879 X irq == 10 ||
880 X irq == 11 ||
881 X irq == 12)) {
882 X fprintf(stderr, "error: irq must be one of "
883 X "5, 7, 9, 10, 11 or 12\n");
884 X usage();
885 X }
886 X
887 X if (!(mem == 0xb0000 ||
888 X mem == 0xc8000 ||
889 X mem == 0xd0000 ||
890 X mem == 0xd8000 ||
891 X mem == 0xe0000 ||
892 X mem == 0xe8000)) {
893 X fprintf(stderr, "error: mem must be one of "
894 X "0xb0000, 0xc8000, 0xd0000, 0xd8000, 0xe0000 or 0xe8000\n");
895 X usage();
896 X }
897 X
898 X return msnd_write_cfg_logical(config_port, 0, io, 0, irq, mem);
900 X
903 X int io, irq;
904 X
905 X if (argc < 2 ||
906 X sscanf(argv[0], "0x%x", &io) != 1 ||
907 X sscanf(argv[1], "%d", &irq) != 1)
908 X usage();
909 X
910 X return msnd_write_cfg_logical(config_port, 1, io, 0, irq, 0);
912 X
915 X int io0, io1, irq;
916 X
917 X if (argc < 3 ||
918 X sscanf(argv[0], "0x%x", &io0) != 1 ||
919 X sscanf(argv[0], "0x%x", &io1) != 1 ||
920 X sscanf(argv[1], "%d", &irq) != 1)
921 X usage();
922 X
923 X return msnd_write_cfg_logical(config_port, 2, io0, io1, irq, 0);
925 X
928 X int io;
929 X
930 X if (argc < 1 ||
931 X sscanf(argv[0], "0x%x", &io) != 1)
932 X usage();
933 X
934 X return msnd_write_cfg_logical(config_port, 3, io, 0, 0, 0);
936 X
939 X char *device;
940 X int rv = 0;
941 X
942 X --argc; ++argv;
943 X
944 X if (argc < 2)
945 X usage();
946 X
947 X sscanf(argv[0], "0x%x", &config_port);
948 X if (config_port != 0x250 && config_port != 0x260 && config_port != 0x270) {
949 X fprintf(stderr, "error: <config port> must be 0x250, 0x260 or 0x270\n");
950 X exit(1);
951 X }
952 X if (ioperm(config_port, 2, 1)) {
953 X perror("ioperm");
954 X fprintf(stderr, "note: pinnaclecfg must be run as root\n");
955 X exit(1);
956 X }
957 X device = argv[1];
958 X
959 X argc -= 2; argv += 2;
960 X
961 X if (strcmp(device, "reset") == 0)
962 X rv = cfg_reset();
963 X else if (strcmp(device, "show") == 0)
964 X rv = cfg_show();
965 X else if (strcmp(device, "dsp") == 0)
966 X rv = cfg_dsp(argc, argv);
967 X else if (strcmp(device, "mpu") == 0)
968 X rv = cfg_mpu(argc, argv);
969 X else if (strcmp(device, "ide") == 0)
970 X rv = cfg_ide(argc, argv);
971 X else if (strcmp(device, "joystick") == 0)
972 X rv = cfg_joystick(argc, argv);
973 X else {
974 X fprintf(stderr, "error: unknown device %s\n", device);
975 X usage();
976 X }
977 X
978 X if (rv)
979 X fprintf(stderr, "error: device configuration failed\n");
980 X
981 X return 0;
1001 $echo 'x -' SKIPPING 'MultiSound.d/Makefile' '(file already exists)'
1003 $echo 'x -' extracting 'MultiSound.d/Makefile' '(text)'
1004 sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/Makefile' &&
1008 X
1010 X
1012 X rm -f $(PROGS)
1031 $echo 'x -' SKIPPING 'MultiSound.d/conv.l' '(file already exists)'
1033 $echo 'x -' extracting 'MultiSound.d/conv.l' '(text)'
1034 sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/conv.l' &&
1061 $echo 'x -' SKIPPING 'MultiSound.d/msndreset.c' '(file already exists)'
1063 $echo 'x -' extracting 'MultiSound.d/msndreset.c' '(text)'
1064 sed 's/^X//' << 'SHAR_EOF' > 'MultiSound.d/msndreset.c' &&
1066 X *
1067 X * msndreset.c - resets the MultiSound card
1068 X *
1069 X * Copyright (C) 1998 Andrew Veliath
1070 X *
1071 X * This program is free software; you can redistribute it and/or modify
1072 X * it under the terms of the GNU General Public License as published by
1073 X * the Free Software Foundation; either version 2 of the License, or
1074 X * (at your option) any later version.
1075 X *
1076 X * This program is distributed in the hope that it will be useful,
1077 X * but WITHOUT ANY WARRANTY; without even the implied warranty of
1078 X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1079 X * GNU General Public License for more details.
1080 X *
1081 X * You should have received a copy of the GNU General Public License
1082 X * along with this program; if not, write to the Free Software
1083 X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
1084 X *
1085 X ********************************************************************/
1086 X
1094 X
1097 X int fd;
1098 X
1099 X if (argc != 2) {
1100 X fprintf(stderr, "usage: msndreset <mixer device>\n");
1101 X exit(1);
1102 X }
1103 X
1104 X if ((fd = open(argv[1], O_RDWR)) < 0) {
1105 X perror(argv[1]);
1106 X exit(1);
1107 X }
1108 X
1109 X if (ioctl(fd, SOUND_MIXER_PRIVATE1, 0) < 0) {
1110 X fprintf(stderr, "error: msnd ioctl reset failed\n");
1111 X perror("ioctl");
1112 X close(fd);
1113 X exit(1);
1114 X }
1115 X
1116 X close(fd);
1117 X
1118 X return 0;