[alsa-devel] Driver for TerraTec DMX 6Fire USB

Torsten Schenk torsten.schenk at zoho.com
Mon Jan 24 13:10:58 CET 2011


Hello,

I had to review the code since an error came up: when sound was playing and I disconnected the device, the whole system crashed. This bug is now solved (pcm.c: check if a isoc-packet has invalid status on retire, if so, abort streaming).

>> >> diff -Nur a/sound/usb/6fire/pcm.c b/sound/usb/6fire/pcm.c 
>> >> --- a/sound/usb/6fire/pcm.c    1970-01-01 01:00:00.000000000 +0100 
>> >> +++ b/sound/usb/6fire/pcm.c    2011-01-20 23:07:24.000000000 +0100 
>> >... 
>> >> +/* keep next two synced with 
>> >> + * FW_EP_W_MAX_PACKET_SIZE[] and RATES_MAX_PACKET_SIZE */ 
>> >> +static const int RATES_IN_PACKET_SIZE[] = { 228, 228, 420, 420, 404, 404 }; 
>> >> +static const int RATES_OUT_PACKET_SIZE[] = { 228, 228, 420, 420, 604, 604 }; 
>> >> +static const int RATES[] = { 44100, 48000, 88200, 96000, 176400, 192000 }; 
>> > 
>> >Any reason to use capital letters for these? 
>> >Because they are const? 
>> That was exactly the idea. 
> 
>Hm, but it's not so common. Not too annoying as well, though. 
Ok, I thought it would be that way... No matter, I changed it to small letters.

>> >Why x86-dependent? 
>> I thought so because of the firmware stuff. If bit- or byte-order are changed, the firmware uploading might not work. If I figured out the #ifdef stuff for bit and byte order, I will remove this dependency. 
> 
>But you are decoding in bytes, not in words or so. Thus the CPU 
>byte-order doesn't matter. 
I reviewed the code and found exactly one endian-dependend thing: a const array I defined with type u16. I changed that to u8 and removed the x86 dependency.

Greetings,
Torsten
-------------- next part --------------
A non-text attachment was scrubbed...
Name: usb6fire.tar.bz2
Type: application/octet-stream
Size: 13105 bytes
Desc: not available
Url : http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20110124/0f314fd3/attachment-0001.dll 


More information about the Alsa-devel mailing list