mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-12-18 08:56:42 -05:00
Sverker Wiberg <sverkerw@swipnet.se>
Opening the patch ROM on GusPnP always fails: * iwffff_get_rom_header() gets the card directory wrong when opening the ROM file. * iwffff_get_rom_header() forgets that the ROM header is padded to 512 bytes length. I also fixed some small stuff: * Tried to improve snd_instr_iwffff_open_rom()'s doxygen comment. The commingling of file-system files (denoted by names) and ROM-embedded files (numbers) is somewhat confusing --- I'm still looking for the right words to explain it. * Oh, and snd_instr_iwffff_open_rom() returns -EPERM for invalid bank/file values --- it means the wrong thing: ENOENT would be better.
This commit is contained in:
parent
6ebde1c926
commit
3c55dcabbf
1 changed files with 11 additions and 4 deletions
|
|
@ -39,8 +39,8 @@
|
||||||
|
|
||||||
#ifndef DOC_HIDDEN
|
#ifndef DOC_HIDDEN
|
||||||
|
|
||||||
#define IW_RAM_FILE "/proc/asound/%i/gus-ram-%i"
|
#define IW_RAM_FILE "/proc/asound/card%i/gus-ram-%i"
|
||||||
#define IW_ROM_FILE "/proc/asound/%i/gus-rom-%i"
|
#define IW_ROM_FILE "/proc/asound/card%i/gus-rom-%i"
|
||||||
|
|
||||||
#undef IW_ROM_DEBUG
|
#undef IW_ROM_DEBUG
|
||||||
|
|
||||||
|
|
@ -208,6 +208,10 @@ static int iwffff_get_rom_header(int card, int bank, iwffff_rom_header_t *header
|
||||||
close(fd);
|
close(fd);
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
if (lseek(fd, IWFFFF_ROM_HDR_SIZE, SEEK_SET) < 0) {
|
||||||
|
close(fd);
|
||||||
|
return -errno;
|
||||||
|
}
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -276,7 +280,10 @@ int snd_instr_iwffff_open(snd_iwffff_handle_t **handle, const char *name_fff, co
|
||||||
* \param card card number
|
* \param card card number
|
||||||
* \param bank ROM bank number (0-3)
|
* \param bank ROM bank number (0-3)
|
||||||
* \param file ROM file number
|
* \param file ROM file number
|
||||||
* \return 0 on success otherwise a negative error code
|
* \return 0 on success otherwise a negative \c errno code
|
||||||
|
*
|
||||||
|
* Opens \a file in \a bank in the ROM image of card \a card, and
|
||||||
|
* writes a handle pointer into \a *handle.
|
||||||
*/
|
*/
|
||||||
int snd_instr_iwffff_open_rom(snd_iwffff_handle_t **handle, int card, int bank, int file)
|
int snd_instr_iwffff_open_rom(snd_iwffff_handle_t **handle, int card, int bank, int file)
|
||||||
{
|
{
|
||||||
|
|
@ -291,7 +298,7 @@ int snd_instr_iwffff_open_rom(snd_iwffff_handle_t **handle, int card, int bank,
|
||||||
*handle = NULL;
|
*handle = NULL;
|
||||||
idx = 0;
|
idx = 0;
|
||||||
if (bank > 3 || file > 255)
|
if (bank > 3 || file > 255)
|
||||||
return -1;
|
return -ENOENT;
|
||||||
fd = iwffff_get_rom_header(card, bank, &header);
|
fd = iwffff_get_rom_header(card, bank, &header);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return fd;
|
return fd;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue